public class FragmentScrollView extends Fragment { private PullToRefreshScrollView refreshScrollView; private ViewPager viewPager; private ListView listView; private List<DataDataBean.ResultsBean> list = new ArrayList<>();//记录当前展示的所有数据 private int page_num = 1; private MyAdapter listViewAdapter; private ILoadingLayout startLabels; private List<String> imageUrlList; private Handler handler = new Handler(){ @Override public void handleMessage(Message msg) { if (msg.what == 0){ //显示下一页....拿到当前页+1 viewPager.setCurrentItem(viewPager.getCurrentItem() +1); //再次发送消息 handler.sendEmptyMessageDelayed(0,2000); } } }; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_scrollview, container, false); refreshScrollView = view.findViewById(R.id.refresh_scroll_view); viewPager = view.findViewById(R.id.image_view_pager); listView = view.findViewById(R.id.scroll_list_view); return view; } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); //失去焦点 listView.setFocusable(false); //轮播图 lunBoTu(); //listView展示数据 //1.获取网络数据,,,展示在listView上 getDataFromNet(); //2.设置刷新模式 /*设置pullToRefreshListView的刷新模式,BOTH代表支持上拉和下拉,PULL_FROM_END代表上拉,PULL_FROM_START代表下拉 */ refreshScrollView.setMode(PullToRefreshBase.Mode.BOTH); //3.通过getLoadingLayoutProxy 方法来指定上拉和下拉时显示的状态的区别(也就是设置向下拉的时候头部里面显示的文字) //此时这里设置的是下拉刷新的时候显示的文字,所以第一个设置true表示现在是刷新,第二个设置为false startLabels = refreshScrollView.getLoadingLayoutProxy(true, false); startLabels.setPullLabel("下拉刷新"); startLabels.setRefreshingLabel("正在刷新..."); startLabels.setReleaseLabel("放开刷新"); ILoadingLayout endLabels = refreshScrollView.getLoadingLayoutProxy(false, true); endLabels.setPullLabel("上拉刷新"); endLabels.setRefreshingLabel("正在载入..."); endLabels.setReleaseLabel("放开刷新..."); /** * 监听事件 */ refreshScrollView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ScrollView>() { @Override public void onPullDownToRefresh(PullToRefreshBase<ScrollView> refreshView) { getRefreshData(); } @Override public void onPullUpToRefresh(PullToRefreshBase<ScrollView> refreshView) { page_num++; getDataFromNet(); } }); } /** * 轮播图的方法 */ private void lunBoTu() { NetDataUtil.getData("http://v3.wufazhuce.com:8000/api/reading/index/?version=3.5.0&platform=android", getActivity(), new JsonCallBack() { @Override public void getJsonString(String json) { //这个结合记录轮播图的所有地址 imageUrlList = new ArrayList<String>(); //解析数据 Gson gson = new Gson(); LunBoBean lunBoBean = gson.fromJson(json, LunBoBean.class); List<LunBoBean.DataBean.EssayBean> essay = lunBoBean.getData().getEssay(); for (LunBoBean.DataBean.EssayBean essayBean: essay) { //essayBean.getAuthor().get(0).getWeb_url() imageUrlList.add(essayBean.getAuthor().get(0).getWeb_url()); } //此时应该根据图片的路径,加载图片,设置适配器 ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getActivity(), imageUrlList); viewPager.setAdapter(viewPagerAdapter); //1.手动可以无限滑动....maxValue....把当前开始展示的位置放在足够大的某个位置 viewPager.setCurrentItem(imageUrlList.size()*100000); //2.自动轮播 handler.sendEmptyMessageDelayed(0,2000); } }); } /** * 下拉刷新获取数据 */ private void getRefreshData() { NetDataUtil.getData("http://gank.io/api/data/Android/10/1", getActivity(), new JsonCallBack() { @Override public void getJsonString(String json) { //解析 Gson gson = new Gson(); DataDataBean dataDataBean = gson.fromJson(json, DataDataBean.class); //先清空一下数据 list.clear(); //添加到集合的最前边,,,,(0,,,,) list.addAll(0,dataDataBean.getResults()); //设置适配器 setAdapter(); //设置适配器之后停止刷新的操作 refreshScrollView.onRefreshComplete(); //可以设置刷新的时间.... startLabels.setLastUpdatedLabel("上次更新时间:"+new SimpleDateFormat("HH:mm").format(new Date(System.currentTimeMillis())));//last最近的,最后一次update修改/更新 } }); } /** * 刚开始进入页面获取网络数据....还可以作为上拉加载获取数据的操作 * * */ private void getDataFromNet() { //第一个参数是接口,第二个上下文,第三个回调json数据 NetDataUtil.getData("http://gank.io/api/data/Android/10/"+page_num, getActivity(), new JsonCallBack() { @Override public void getJsonString(String json) { //解析 Gson gson = new Gson(); DataDataBean dataDataBean = gson.fromJson(json, DataDataBean.class); //往后面添加... list.addAll(dataDataBean.getResults()); //设置适配器 setAdapter(); //停止刷新 refreshScrollView.onRefreshComplete(); } }); } /** * 设置适配器的方法 */ private void setAdapter() { if (listViewAdapter == null){ listViewAdapter = new MyAdapter(getActivity(),list); listView.setAdapter(listViewAdapter); }else { listViewAdapter.notifyDataSetChanged(); } } } ++++++++++++++++++++++++++++++++++++++++++++++++++package com.example.hello.myappzuoye; import java.util.List; /** * Created by on 2017/10/19. */ public class LunBoBean { /** * res : 0 * data : {"essay":[{"content_id":"2867","hp_title":"200万很好啊,但我就想要5000月薪","hp_makettime":"2017-10-19 06:00:00","guide_word":"你以为自己是天才枪手,其实只是炮灰。","start_video":"","author":[{"user_id":"7181466","user_name":"十三妹丁无畏","desc":"菜鸟乐评小编,专业观众。不客观,杂食,偏爱postpunk&newwave。超典型射手,LGBTQ人权平等拥护。\r\n微博:@十三妹丁无畏","wb_name":"@十三妹丁无畏","is_settled":"0","settled_type":"0","summary":"音乐编辑","fans_total":"3012","web_url":"http://image.wufazhuce.com/Fng58eK6AcGwxDjTftvM4_j9DfeB"}],"has_audio":false,"author_list":[{"user_id":"7181466","user_name":"十三妹丁无畏","desc":"菜鸟乐评小编,专业观众。不客观,杂食,偏爱postpunk&newwave。超典型射手,LGBTQ人权平等拥护。\r\n微博:@十三妹丁无畏","wb_name":"@十三妹丁无畏","is_settled":"0","settled_type":"0","summary":"音乐编辑","fans_total":"3012","web_url":"http://image.wufazhuce.com/Fng58eK6AcGwxDjTftvM4_j9DfeB"}]},{"content_id":"2866","hp_title":"去屠宰场谈恋爱好吗?","hp_makettime":"2017-10-19 06:00:00","guide_word":"无论从哪条路走下来,都会跌入相同滑道,相同结局。","start_video":"","author":[{"user_id":"6859004","user_name":"兔草","desc":"生于武汉,现居上海。写小说、评论、剧本等。小说见ONE、豆瓣、《野草》等。","wb_name":"@兔草啊吐槽","is_settled":"0","settled_type":"0","summary":"退役文案,杂耍写手","fans_total":"78","web_url":"http://image.wufazhuce.com/FmIxumvucSMThvBqzjla4dEmFbwL"}],"has_audio":false,"author_list":[{"user_id":"6859004","user_name":"兔草","desc":"生于武汉,现居上海。写小说、评论、剧本等。小说见ONE、豆瓣、《野草》等。","wb_name":"@兔草啊吐槽","is_settled":"0","settled_type":"0","summary":"退役文案,杂耍写手","fans_total":"78","web_url":"http://image.wufazhuce.com/FmIxumvucSMThvBqzjla4dEmFbwL"}]},{"content_id":"2863","hp_title":"冬日恶狠狠清单","hp_makettime":"2017-10-18 06:00:00","guide_word":"生活里一切都很好,只是我的内心仍有风暴肆虐。","start_video":"","author":[{"user_id":"4813757","user_name":"苏更生","desc":"「一个」App常驻作家,微信公众号:hulizhai","wb_name":"@假苏更生","is_settled":"0","settled_type":"0","summary":"「一个」App常驻作家,微信公众号:hulizhai","fans_total":"17274","web_url":"http://image.wufazhuce.com/Fg_e6teZsb3lZ1QStYtdnAkh6bO8"}],"has_audio":false,"author_list":[{"user_id":"4813757","user_name":"苏更生","desc":"「一个」App常驻作家,微信公众号:hulizhai","wb_name":"@假苏更生","is_settled":"0","settled_type":"0","summary":"「一个」App常驻作家,微信公众号:hulizhai","fans_total":"17274","web_url":"http://image.wufazhuce.com/Fg_e6teZsb3lZ1QStYtdnAkh6bO8"}]},{"content_id":"2862","hp_title":"关于她的命运","hp_makettime":"2017-10-18 06:00:00","guide_word":"两手空空。我们就这样迎向了未来。","start_video":"","author":[{"user_id":"4813479","user_name":"荞麦","desc":"「一个」常驻作家。最新随笔集《当一切在我们周围暗下来》。","wb_name":"@荞麦chen","is_settled":"0","settled_type":"0","summary":"「一个」常驻作家。最新随笔集《当一切在我们周围暗下来》。","fans_total":"4975","web_url":"http://image.wufazhuce.com/FsRokzycWWx_CucHTFUN4OFBh5s6"}],"has_audio":true,"author_list":[{"user_id":"4813479","user_name":"荞麦","desc":"「一个」常驻作家。最新随笔集《当一切在我们周围暗下来》。","wb_name":"@荞麦chen","is_settled":"0","settled_type":"0","summary":"「一个」常驻作家。最新随笔集《当一切在我们周围暗下来》。","fans_total":"4975","web_url":"http://image.wufazhuce.com/FsRokzycWWx_CucHTFUN4OFBh5s6"}]},{"content_id":"2861","hp_title":"附近的人","hp_makettime":"2017-10-17 06:00:00","guide_word":"她整个人被震荡着,被拖走,被摇撼。她情不自禁地发出低声的尖叫。","start_video":"","author":[{"user_id":"7867217","user_name":"MENG","desc":"MENG,MeRead读书会创办人,不务正业写作者。","wb_name":"@萌之刺刺","is_settled":"0","settled_type":"0","summary":"MeRead创办人,不务正业写作者。","fans_total":"1340","web_url":"http://image.wufazhuce.com/Fjs4uDTgQAXnIOPEvnnIIA7HdBxS"}],"has_audio":true,"author_list":[{"user_id":"7867217","user_name":"MENG","desc":"MENG,MeRead读书会创办人,不务正业写作者。","wb_name":"@萌之刺刺","is_settled":"0","settled_type":"0","summary":"MeRead创办人,不务正业写作者。","fans_total":"1340","web_url":"http://image.wufazhuce.com/Fjs4uDTgQAXnIOPEvnnIIA7HdBxS"}]},{"content_id":"2860","hp_title":"我说过的每一句谎,都是因为我爱你","hp_makettime":"2017-10-16 06:00:00","guide_word":"你要是爱他,就得说谎,不管你愿不愿意。","start_video":"","author":[{"user_id":"7898995","user_name":"李开春","desc":"爱国儿女,鸡汤爱好者,不务正业的理工女。","wb_name":"@李开开开春","is_settled":"0","settled_type":"0","summary":"爱国儿女,鸡汤爱好者,不务正业的理工女。","fans_total":"6801","web_url":"http://image.wufazhuce.com/FuCd1X9lLbWuu3Ps_aoMd8vJjQml"}],"has_audio":false,"author_list":[{"user_id":"7898995","user_name":"李开春","desc":"爱国儿女,鸡汤爱好者,不务正业的理工女。","wb_name":"@李开开开春","is_settled":"0","settled_type":"0","summary":"爱国儿女,鸡汤爱好者,不务正业的理工女。","fans_total":"6801","web_url":"http://image.wufazhuce.com/FuCd1X9lLbWuu3Ps_aoMd8vJjQml"}]},{"content_id":"2859","hp_title":"建设北路32号B栋","hp_makettime":"2017-10-16 06:00:00","guide_word":"人活着就是在积分的话,三十年能换个什么狗屁东西呢?","start_video":"","author":[{"user_id":"7448679","user_name":"阿枣","desc":"写作者,翻译。","wb_name":"","is_settled":"0","settled_type":"0","summary":"写作者,翻译。","fans_total":"45","web_url":"http://image.wufazhuce.com/FjM-TK7UjhU11Rdshf-a6SeA2_uL"}],"has_audio":true,"author_list":[{"user_id":"7448679","user_name":"阿枣","desc":"写作者,翻译。","wb_name":"","is_settled":"0","settled_type":"0","summary":"写作者,翻译。","fans_total":"45","web_url":"http://image.wufazhuce.com/FjM-TK7UjhU11Rdshf-a6SeA2_uL"}]},{"content_id":"2858","hp_title":"另一个空间","hp_makettime":"2017-10-15 06:00:00","guide_word":"你说,这是不是童话故事?","start_video":"","author":[{"user_id":"7754467","user_name":"程皎旸","desc":"旅居香港,曾获香港青年文学奖。公众号:薄荷子弹。","wb_name":"@程皎旸-","is_settled":"0","settled_type":"0","summary":"青年作家,记者。","fans_total":"786","web_url":"http://image.wufazhuce.com/Fl5nYa_3VrmE5_42lRc8pF5hsypQ"}],"has_audio":false,"author_list":[{"user_id":"7754467","user_name":"程皎旸","desc":"旅居香港,曾获香港青年文学奖。公众号:薄荷子弹。","wb_name":"@程皎旸-","is_settled":"0","settled_type":"0","summary":"青年作家,记者。","fans_total":"786","web_url":"http://image.wufazhuce.com/Fl5nYa_3VrmE5_42lRc8pF5hsypQ"}]},{"content_id":"2856","hp_title":"贱兮兮地给所有人点赞","hp_makettime":"2017-10-15 06:00:00","guide_word":"它像一幅数字版清明上河图,卷首已然人山人海。","start_video":"","author":[{"user_id":"7654034","user_name":"黄集伟","desc":"黄集伟,专栏作者,曾有\u201c阅读笔记\u201d系列、\u201c语词笔记\u201d系列、《孤岛访谈录》等闲书出版。","wb_name":"","is_settled":"0","settled_type":"0","summary":"黄集伟,专栏作者。","fans_total":"3732","web_url":"http://image.wufazhuce.com/FvVmWbqlle7jlUCTeozoval9NyBH"}],"has_audio":false,"author_list":[{"user_id":"7654034","user_name":"黄集伟","desc":"黄集伟,专栏作者,曾有\u201c阅读笔记\u201d系列、\u201c语词笔记\u201d系列、《孤岛访谈录》等闲书出版。","wb_name":"","is_settled":"0","settled_type":"0","summary":"黄集伟,专栏作者。","fans_total":"3732","web_url":"http://image.wufazhuce.com/FvVmWbqlle7jlUCTeozoval9NyBH"}]},{"content_id":"2857","hp_title":"女孩们的友谊","hp_makettime":"2017-10-14 06:00:00","guide_word":"起码她的包没有我的贵。","start_video":"","author":[{"user_id":"5553913","user_name":"周苏婕","desc":"周苏婕,青年作家。微信公众号:sujiewriting","wb_name":"@anan周苏婕","is_settled":"0","settled_type":"0","summary":"周苏婕,青年作家。微信公众号:sujiewriting","fans_total":"1939","web_url":"http://image.wufazhuce.com/FmDRnQ1XhReHRHB4jYqAPSx8htsP"}],"has_audio":false,"author_list":[{"user_id":"5553913","user_name":"周苏婕","desc":"周苏婕,青年作家。微信公众号:sujiewriting","wb_name":"@anan周苏婕","is_settled":"0","settled_type":"0","summary":"周苏婕,青年作家。微信公众号:sujiewriting","fans_total":"1939","web_url":"http://image.wufazhuce.com/FmDRnQ1XhReHRHB4jYqAPSx8htsP"}]}],"serial":[{"id":"445","serial_id":"50","number":"9","title":"相亲攻略手册(7)·七月,悲喜交加(下)","excerpt":"我很感谢他最后没有跟我说抱歉,或者跟我说,我是个好姑娘。","read_num":"23300","maketime":"2017-10-19 06:00:00","start_video":"","author":{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"},"has_audio":false,"author_list":[{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439","445"]},{"id":"452","serial_id":"49","number":"10","title":"我在三十岁的第一年 II · 第十话","excerpt":"人生就是一场大型错位。","read_num":"33300","maketime":"2017-10-18 06:00:00","start_video":"","author":{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"},"has_audio":false,"author_list":[{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"}],"serial_list":["428","429","433","436","440","442","448","449","450","452"]},{"id":"439","serial_id":"50","number":"8","title":"相亲攻略手册(7)·七月,悲喜交加(上)","excerpt":"我想等的人,也不再是你。","read_num":"40500","maketime":"2017-10-17 06:00:00","start_video":"","author":{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"},"has_audio":false,"author_list":[{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439","445"]},{"id":"450","serial_id":"49","number":"9","title":"我在三十岁的第一年 II · 第九话","excerpt":"如果一个人被迫过着清心寡欲的生活,只要有一个机会,她就会跑向纵情享乐。","read_num":"40300","maketime":"2017-10-16 06:00:00","start_video":"","author":{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"},"has_audio":false,"author_list":[{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"}],"serial_list":["428","429","433","436","440","442","448","449","450","452"]},{"id":"444","serial_id":"50","number":"7","title":"相亲攻略手册(6)·六月,青草盛开(下)","excerpt":"他始终横亘在我的生活里,就像是心头一根温和的刺。","read_num":"42700","maketime":"2017-10-14 06:00:00","start_video":"","author":{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"},"has_audio":false,"author_list":[{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439","445"]},{"id":"449","serial_id":"49","number":"8","title":"我在三十岁的第一年 II · 第八话","excerpt":"日常生活给再多奇迹,也总是乏味和平庸的结尾最多。","read_num":"43600","maketime":"2017-10-13 06:00:00","start_video":"","author":{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"},"has_audio":false,"author_list":[{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"}],"serial_list":["428","429","433","436","440","442","448","449","450","452"]},{"id":"438","serial_id":"50","number":"6","title":"相亲攻略手册(6)·六月,青草盛开(上)","excerpt":"但谁知道,终究是一语成谶。","read_num":"45800","maketime":"2017-10-12 06:00:00","start_video":"","author":{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"},"has_audio":false,"author_list":[{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439","445"]},{"id":"448","serial_id":"49","number":"7","title":"我在三十岁的第一年 II · 第七话","excerpt":"人所有一切的行动,不过是遵循内心最强烈的愿望。","read_num":"42500","maketime":"2017-10-11 06:00:00","start_video":"","author":{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"},"has_audio":false,"author_list":[{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"}],"serial_list":["428","429","433","436","440","442","448","449","450","452"]},{"id":"437","serial_id":"50","number":"5","title":"相亲攻略手册(5)·五月,我们对面坐着","excerpt":"该死的小雀跃。","read_num":"47500","maketime":"2017-10-10 06:00:00","start_video":"","author":{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"},"has_audio":false,"author_list":[{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439","445"]},{"id":"442","serial_id":"49","number":"6","title":"我在三十岁的第一年 II · 第六话","excerpt":"我不是拜金,我只是习惯了金钱带来的快乐。","read_num":"50800","maketime":"2017-10-09 06:00:00","start_video":"","author":{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"},"has_audio":false,"author_list":[{"user_id":"4808838","user_name":"毛利","desc":"毛利,专栏作家。《我在三十岁的第一年》即将上市。","wb_name":"@毛利","is_settled":"0","settled_type":"0","summary":"专栏作家。","fans_total":"8263","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"}],"serial_list":["428","429","433","436","440","442","448","449","450","452"]}],"question":[{"question_id":"1888","question_title":"我们能为想自杀的人做点什么?","answer_title":"","answer_content":"不要对一个没有双腿的人说奔跑是一件多么轻松的事情。","question_makettime":"2017-10-19 06:00:00","start_video":"","author_list":[{"user_id":"7834279","user_name":"露易莎大能个儿","desc":"你想看到什么?","wb_name":"@露易莎大能个儿","is_settled":"0","settled_type":"0","summary":"朝阳区唯一的精灵。","fans_total":"713","web_url":"http://image.wufazhuce.com/FjREAxQyRS8OCKo9VJ1pmMFWCEKA"}],"asker_list":[{"user_id":"0","user_name":"高高","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1886","question_title":"受邀参加前任婚礼该怎么办?","answer_title":"","answer_content":"当初是你要分开,分开就分开,现在又要用婚礼,来抢我的钱。","question_makettime":"2017-10-18 06:00:00","start_video":"","author_list":[{"user_id":"0","user_name":"网友","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}],"asker_list":[{"user_id":"0","user_name":"丰博","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1887","question_title":"为人父母之后心境会有怎样的变化?","answer_title":"","answer_content":"当森林甬道遍布,我也只有祝福。","question_makettime":"2017-10-17 06:00:00","start_video":"","author_list":[{"user_id":"4814673","user_name":"刘墨闻","desc":"设计师,青年作者。@刘墨闻","wb_name":"","is_settled":"0","settled_type":"0","summary":"设计师,青年作者。","fans_total":"2113","web_url":"http://image.wufazhuce.com/FvHffjDa1ORrg83qhajnR_zhwJlg"}],"asker_list":[{"user_id":"0","user_name":"in_Mars","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1884","question_title":"世界上有会亏钱的老虎机吗?","answer_title":"","answer_content":"所有看似随机的人工结果背后都有迹可循。","question_makettime":"2017-10-16 06:00:00","start_video":"","author_list":[{"user_id":"0","user_name":"温义飞","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}],"asker_list":[{"user_id":"0","user_name":"老李","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1885","question_title":"智商高的人会缺少人情味儿吗?","answer_title":"","answer_content":"智商高的人会缺少人情味儿吗?","question_makettime":"2017-10-15 06:00:00","start_video":"","author_list":[{"user_id":"8185629","user_name":"行尸走肥肉","desc":"一位拥有三双拖鞋的便衣诗人。","wb_name":"@行尸走肥肉","is_settled":"0","settled_type":"0","summary":"一位拥有三双拖鞋的便衣诗人。","fans_total":"1498","web_url":"http://image.wufazhuce.com/FiE2WkXRL8Vf3k1683CDDgU7VqgM"}],"asker_list":[{"user_id":"0","user_name":"网友","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1883","question_title":"你有过哪些一见如故的经历?","answer_title":"","answer_content":"那种只看一眼就觉得遇到对的人的感觉,就像晒到了午后的太阳。","question_makettime":"2017-10-14 06:00:00","start_video":"","author_list":[{"user_id":"0","user_name":"网友","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}],"asker_list":[{"user_id":"0","user_name":"一个App工作室 ","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1882","question_title":"为什么会很难接受爱豆公开恋情?","answer_title":"","answer_content":"众生都坠入情网,你是我们唯一寄望。","question_makettime":"2017-10-13 06:00:00","start_video":"","author_list":[{"user_id":"0","user_name":"王花花","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}],"asker_list":[{"user_id":"0","user_name":"路小路","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1881","question_title":"吃多少苦才能过上幸福的生活?","answer_title":"","answer_content":"吃了这么多苦,只是为了过上普通人的生活。","question_makettime":"2017-10-12 06:00:00","start_video":"","author_list":[{"user_id":"8473724","user_name":"青崖白鹿","desc":"且放白鹿青崖间。","wb_name":"","is_settled":"0","settled_type":"0","summary":"且放白鹿青崖间。","fans_total":"312","web_url":"http://image.wufazhuce.com/FviXy-X_ds4zr1JIDd2TvvSfpvBO"}],"asker_list":[{"user_id":"0","user_name":"丁丁","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1880","question_title":"为什么傲慢是七宗罪之首?","answer_title":"","answer_content":"傲慢动摇了信仰的根基,使任何尝试性的沟通都无法成功。","question_makettime":"2017-10-11 06:00:00","start_video":"","author_list":[{"user_id":"4814646","user_name":"三三","desc":"律师,青年作者,一个全年出现的圣诞老人。","wb_name":"@三三坡","is_settled":"0","settled_type":"0","summary":"律师,青年作者,一个全年出现的圣诞老人。","fans_total":"511","web_url":"http://image.wufazhuce.com/Frilgx0XpHkpgggE2jzQM0rHbnVB"}],"asker_list":[{"user_id":"0","user_name":"皮卡诺","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]},{"question_id":"1879","question_title":"如果恋人不愿意公开恋情,你会怎么看待?","answer_title":"","answer_content":"确定不反思一下是不是自己太丑?","question_makettime":"2017-10-10 06:00:00","start_video":"","author_list":[{"user_id":"7523856","user_name":"网友","desc":"网友","wb_name":"","is_settled":"0","settled_type":"0","summary":"网友","fans_total":"488","web_url":"http://image.wufazhuce.com/Fvx6SPugEWRuXLvAkuB7gCGaHRjR"}],"asker_list":[{"user_id":"0","user_name":"勺哥","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}]}]} */ private int res; private DataBean data; public int getRes() { return res; } public void setRes(int res) { this.res = res; } public DataBean getData() { return data; } public void setData(DataBean data) { this.data = data; } public static class DataBean { private List<EssayBean> essay; private List<SerialBean> serial; private List<QuestionBean> question; public List<EssayBean> getEssay() { return essay; } public void setEssay(List<EssayBean> essay) { this.essay = essay; } public List<SerialBean> getSerial() { return serial; } public void setSerial(List<SerialBean> serial) { this.serial = serial; } public List<QuestionBean> getQuestion() { return question; } public void setQuestion(List<QuestionBean> question) { this.question = question; } public static class EssayBean { /** * content_id : 2867 * hp_title : 200万很好啊,但我就想要5000月薪 * hp_makettime : 2017-10-19 06:00:00 * guide_word : 你以为自己是天才枪手,其实只是炮灰。 * start_video : * author : [{"user_id":"7181466","user_name":"十三妹丁无畏","desc":"菜鸟乐评小编,专业观众。不客观,杂食,偏爱postpunk&newwave。超典型射手,LGBTQ人权平等拥护。\r\n微博:@十三妹丁无畏","wb_name":"@十三妹丁无畏","is_settled":"0","settled_type":"0","summary":"音乐编辑","fans_total":"3012","web_url":"http://image.wufazhuce.com/Fng58eK6AcGwxDjTftvM4_j9DfeB"}] * has_audio : false * author_list : [{"user_id":"7181466","user_name":"十三妹丁无畏","desc":"菜鸟乐评小编,专业观众。不客观,杂食,偏爱postpunk&newwave。超典型射手,LGBTQ人权平等拥护。\r\n微博:@十三妹丁无畏","wb_name":"@十三妹丁无畏","is_settled":"0","settled_type":"0","summary":"音乐编辑","fans_total":"3012","web_url":"http://image.wufazhuce.com/Fng58eK6AcGwxDjTftvM4_j9DfeB"}] */ private String content_id; private String hp_title; private String hp_makettime; private String guide_word; private String start_video; private boolean has_audio; private List<AuthorBean> author; private List<AuthorListBean> author_list; public String getContent_id() { return content_id; } public void setContent_id(String content_id) { this.content_id = content_id; } public String getHp_title() { return hp_title; } public void setHp_title(String hp_title) { this.hp_title = hp_title; } public String getHp_makettime() { return hp_makettime; } public void setHp_makettime(String hp_makettime) { this.hp_makettime = hp_makettime; } public String getGuide_word() { return guide_word; } public void setGuide_word(String guide_word) { this.guide_word = guide_word; } public String getStart_video() { return start_video; } public void setStart_video(String start_video) { this.start_video = start_video; } public boolean isHas_audio() { return has_audio; } public void setHas_audio(boolean has_audio) { this.has_audio = has_audio; } public List<AuthorBean> getAuthor() { return author; } public void setAuthor(List<AuthorBean> author) { this.author = author; } public List<AuthorListBean> getAuthor_list() { return author_list; } public void setAuthor_list(List<AuthorListBean> author_list) { this.author_list = author_list; } public static class AuthorBean { /** * user_id : 7181466 * user_name : 十三妹丁无畏 * desc : 菜鸟乐评小编,专业观众。不客观,杂食,偏爱postpunk&newwave。超典型射手,LGBTQ人权平等拥护。 微博:@十三妹丁无畏 * wb_name : @十三妹丁无畏 * is_settled : 0 * settled_type : 0 * summary : 音乐编辑 * fans_total : 3012 * web_url : http://image.wufazhuce.com/Fng58eK6AcGwxDjTftvM4_j9DfeB */ private String user_id; private String user_name; private String desc; private String wb_name; private String is_settled; private String settled_type; private String summary; private String fans_total; private String web_url; public String getUser_id() { return user_id; } public void setUser_id(String user_id) { this.user_id = user_id; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getWb_name() { return wb_name; } public void setWb_name(String wb_name) { this.wb_name = wb_name; } public String getIs_settled() { return is_settled; } public void setIs_settled(String is_settled) { this.is_settled = is_settled; } public String getSettled_type() { return settled_type; } public void setSettled_type(String settled_type) { this.settled_type = settled_type; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public String getFans_total() { return fans_total; } public void setFans_total(String fans_total) { this.fans_total = fans_total; } public String getWeb_url() { return web_url; } public void setWeb_url(String web_url) { this.web_url = web_url; } } public static class AuthorListBean { /** * user_id : 7181466 * user_name : 十三妹丁无畏 * desc : 菜鸟乐评小编,专业观众。不客观,杂食,偏爱postpunk&newwave。超典型射手,LGBTQ人权平等拥护。 微博:@十三妹丁无畏 * wb_name : @十三妹丁无畏 * is_settled : 0 * settled_type : 0 * summary : 音乐编辑 * fans_total : 3012 * web_url : http://image.wufazhuce.com/Fng58eK6AcGwxDjTftvM4_j9DfeB */ private String user_id; private String user_name; private String desc; private String wb_name; private String is_settled; private String settled_type; private String summary; private String fans_total; private String web_url; public String getUser_id() { return user_id; } public void setUser_id(String user_id) { this.user_id = user_id; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getWb_name() { return wb_name; } public void setWb_name(String wb_name) { this.wb_name = wb_name; } public String getIs_settled() { return is_settled; } public void setIs_settled(String is_settled) { this.is_settled = is_settled; } public String getSettled_type() { return settled_type; } public void setSettled_type(String settled_type) { this.settled_type = settled_type; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public String getFans_total() { return fans_total; } public void setFans_total(String fans_total) { this.fans_total = fans_total; } public String getWeb_url() { return web_url; } public void setWeb_url(String web_url) { this.web_url = web_url; } } } public static class SerialBean { /** * id : 445 * serial_id : 50 * number : 9 * title : 相亲攻略手册(7)·七月,悲喜交加(下) * excerpt : 我很感谢他最后没有跟我说抱歉,或者跟我说,我是个好姑娘。 * read_num : 23300 * maketime : 2017-10-19 06:00:00 * start_video : * author : {"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"} * has_audio : false * author_list : [{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3387","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}] * serial_list : ["430","431","434","435","437","438","444","439","445"] */ private String id; private String serial_id; private String number; private String title; private String excerpt; private String read_num; private String maketime; private String start_video; private AuthorBeanX author; private boolean has_audio; private List<AuthorListBeanX> author_list; private List<String> serial_list; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getSerial_id() { return serial_id; } public void setSerial_id(String serial_id) { this.serial_id = serial_id; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getExcerpt() { return excerpt; } public void setExcerpt(String excerpt) { this.excerpt = excerpt; } public String getRead_num() { return read_num; } public void setRead_num(String read_num) { this.read_num = read_num; } public String getMaketime() { return maketime; } public void setMaketime(String maketime) { this.maketime = maketime; } public String getStart_video() { return start_video; } public void setStart_video(String start_video) { this.start_video = start_video; } public AuthorBeanX getAuthor() { return author; } public void setAuthor(AuthorBeanX author) { this.author = author; } public boolean isHas_audio() { return has_audio; } public void setHas_audio(boolean has_audio) { this.has_audio = has_audio; } public List<AuthorListBeanX> getAuthor_list() { return author_list; } public void setAuthor_list(List<AuthorListBeanX> author_list) { this.author_list = author_list; } public List<String> getSerial_list() { return serial_list; } public void setSerial_list(List<String> serial_list) { this.serial_list = serial_list; } public static class AuthorBeanX { /** * user_id : 4814710 * user_name : 姚佳黛 * desc : 喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。 * wb_name : * is_settled : 0 * settled_type : 0 * summary : 学医的见过手术室血肉横飞的文字编辑。 * fans_total : 3387 * web_url : http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt */ private String user_id; private String user_name; private String desc; private String wb_name; private String is_settled; private String settled_type; private String summary; private String fans_total; private String web_url; public String getUser_id() { return user_id; } public void setUser_id(String user_id) { this.user_id = user_id; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getWb_name() { return wb_name; } public void setWb_name(String wb_name) { this.wb_name = wb_name; } public String getIs_settled() { return is_settled; } public void setIs_settled(String is_settled) { this.is_settled = is_settled; } public String getSettled_type() { return settled_type; } public void setSettled_type(String settled_type) { this.settled_type = settled_type; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public String getFans_total() { return fans_total; } public void setFans_total(String fans_total) { this.fans_total = fans_total; } public String getWeb_url() { return web_url; } public void setWeb_url(String web_url) { this.web_url = web_url; } } public static class AuthorListBeanX { /** * user_id : 4814710 * user_name : 姚佳黛 * desc : 喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。 * wb_name : * is_settled : 0 * settled_type : 0 * summary : 学医的见过手术室血肉横飞的文字编辑。 * fans_total : 3387 * web_url : http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt */ private String user_id; private String user_name; private String desc; private String wb_name; private String is_settled; private String settled_type; private String summary; private String fans_total; private String web_url; public String getUser_id() { return user_id; } public void setUser_id(String user_id) { this.user_id = user_id; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getWb_name() { return wb_name; } public void setWb_name(String wb_name) { this.wb_name = wb_name; } public String getIs_settled() { return is_settled; } public void setIs_settled(String is_settled) { this.is_settled = is_settled; } public String getSettled_type() { return settled_type; } public void setSettled_type(String settled_type) { this.settled_type = settled_type; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public String getFans_total() { return fans_total; } public void setFans_total(String fans_total) { this.fans_total = fans_total; } public String getWeb_url() { return web_url; } public void setWeb_url(String web_url) { this.web_url = web_url; } } } public static class QuestionBean { /** * question_id : 1888 * question_title : 我们能为想自杀的人做点什么? * answer_title : * answer_content : 不要对一个没有双腿的人说奔跑是一件多么轻松的事情。 * question_makettime : 2017-10-19 06:00:00 * start_video : * author_list : [{"user_id":"7834279","user_name":"露易莎大能个儿","desc":"你想看到什么?","wb_name":"@露易莎大能个儿","is_settled":"0","settled_type":"0","summary":"朝阳区唯一的精灵。","fans_total":"713","web_url":"http://image.wufazhuce.com/FjREAxQyRS8OCKo9VJ1pmMFWCEKA"}] * asker_list : [{"user_id":"0","user_name":"高高","web_url":"http://image.wufazhuce.com/placeholder-author-avatar.png","summary":"","desc":"","is_settled":"","settled_type":"","fans_total":"","wb_name":""}] */ private String question_id; private String question_title; private String answer_title; private String answer_content; private String question_makettime; private String start_video; private List<AuthorListBeanXX> author_list; private List<AskerListBean> asker_list; public String getQuestion_id() { return question_id; } public void setQuestion_id(String question_id) { this.question_id = question_id; } public String getQuestion_title() { return question_title; } public void setQuestion_title(String question_title) { this.question_title = question_title; } public String getAnswer_title() { return answer_title; } public void setAnswer_title(String answer_title) { this.answer_title = answer_title; } public String getAnswer_content() { return answer_content; } public void setAnswer_content(String answer_content) { this.answer_content = answer_content; } public String getQuestion_makettime() { return question_makettime; } public void setQuestion_makettime(String question_makettime) { this.question_makettime = question_makettime; } public String getStart_video() { return start_video; } public void setStart_video(String start_video) { this.start_video = start_video; } public List<AuthorListBeanXX> getAuthor_list() { return author_list; } public void setAuthor_list(List<AuthorListBeanXX> author_list) { this.author_list = author_list; } public List<AskerListBean> getAsker_list() { return asker_list; } public void setAsker_list(List<AskerListBean> asker_list) { this.asker_list = asker_list; } public static class AuthorListBeanXX { /** * user_id : 7834279 * user_name : 露易莎大能个儿 * desc : 你想看到什么? * wb_name : @露易莎大能个儿 * is_settled : 0 * settled_type : 0 * summary : 朝阳区唯一的精灵。 * fans_total : 713 * web_url : http://image.wufazhuce.com/FjREAxQyRS8OCKo9VJ1pmMFWCEKA */ private String user_id; private String user_name; private String desc; private String wb_name; private String is_settled; private String settled_type; private String summary; private String fans_total; private String web_url; public String getUser_id() { return user_id; } public void setUser_id(String user_id) { this.user_id = user_id; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getWb_name() { return wb_name; } public void setWb_name(String wb_name) { this.wb_name = wb_name; } public String getIs_settled() { return is_settled; } public void setIs_settled(String is_settled) { this.is_settled = is_settled; } public String getSettled_type() { return settled_type; } public void setSettled_type(String settled_type) { this.settled_type = settled_type; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public String getFans_total() { return fans_total; } public void setFans_total(String fans_total) { this.fans_total = fans_total; } public String getWeb_url() { return web_url; } public void setWeb_url(String web_url) { this.web_url = web_url; } } public static class AskerListBean { /** * user_id : 0 * user_name : 高高 * web_url : http://image.wufazhuce.com/placeholder-author-avatar.png * summary : * desc : * is_settled : * settled_type : * fans_total : * wb_name : */ private String user_id; private String user_name; private String web_url; private String summary; private String desc; private String is_settled; private String settled_type; private String fans_total; private String wb_name; public String getUser_id() { return user_id; } public void setUser_id(String user_id) { this.user_id = user_id; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getWeb_url() { return web_url; } public void setWeb_url(String web_url) { this.web_url = web_url; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getIs_settled() { return is_settled; } public void setIs_settled(String is_settled) { this.is_settled = is_settled; } public String getSettled_type() { return settled_type; } public void setSettled_type(String settled_type) { this.settled_type = settled_type; } public String getFans_total() { return fans_total; } public void setFans_total(String fans_total) { this.fans_total = fans_total; } public String getWb_name() { return wb_name; } public void setWb_name(String wb_name) { this.wb_name = wb_name; } } } } }++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++package com.example.hello.myappzuoye; import android.content.Context; import android.util.AttributeSet; import android.widget.ListView; /** * Created by on 2017/10/19. */ public class MyListView extends ListView { public MyListView(Context context) { super(context); } public MyListView(Context context, AttributeSet attrs) { super(context, attrs); } public MyListView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } /** * 重新计算高度 * @param widthMeasureSpec * @param heightMeasureSpec */ @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); } /* @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); }*/ }+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++package com.example.hello.myappzuoye.frment; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import android.widget.ScrollView; import com.example.hello.myappzuoye.bean.DataDataBean; import com.example.hello.myappzuoye.JsonCallBack; import com.example.hello.myappzuoye.LunBoBean; import com.example.hello.myappzuoye.adapter.MyAdapter; import com.example.hello.myappzuoye.R; import com.example.hello.myappzuoye.adapter.ViewPagerAdapter; import com.example.hello.myappzuoye.util.NetDataUtil; import com.google.gson.Gson; import com.handmark.pulltorefresh.library.ILoadingLayout; import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshScrollView; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * Created by on 2017/10/18. */ public class FragmentScrollView extends Fragment { private PullToRefreshScrollView refreshScrollView; private ViewPager viewPager; private ListView listView; private List<DataDataBean.ResultsBean> list = new ArrayList<>();//记录当前展示的所有数据 private int page_num = 1; private MyAdapter listViewAdapter; private ILoadingLayout startLabels; private List<String> imageUrlList; private Handler handler = new Handler(){ @Override public void handleMessage(Message msg) { if (msg.what == 0){ //显示下一页....拿到当前页+1 viewPager.setCurrentItem(viewPager.getCurrentItem() +1); //再次发送消息 handler.sendEmptyMessageDelayed(0,2000); } } }; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_scrollview, container, false); refreshScrollView = view.findViewById(R.id.refresh_scroll_view); viewPager = view.findViewById(R.id.image_view_pager); listView = view.findViewById(R.id.scroll_list_view); return view; } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); //失去焦点 listView.setFocusable(false); //轮播图 lunBoTu(); //listView展示数据 //1.获取网络数据,,,展示在listView上 getDataFromNet(); //2.设置刷新模式 /*设置pullToRefreshListView的刷新模式,BOTH代表支持上拉和下拉,PULL_FROM_END代表上拉,PULL_FROM_START代表下拉 */ refreshScrollView.setMode(PullToRefreshBase.Mode.BOTH); //3.通过getLoadingLayoutProxy 方法来指定上拉和下拉时显示的状态的区别(也就是设置向下拉的时候头部里面显示的文字) //此时这里设置的是下拉刷新的时候显示的文字,所以第一个设置true表示现在是刷新,第二个设置为false startLabels = refreshScrollView.getLoadingLayoutProxy(true, false); startLabels.setPullLabel("下拉刷新"); startLabels.setRefreshingLabel("正在刷新..."); startLabels.setReleaseLabel("放开刷新"); ILoadingLayout endLabels = refreshScrollView.getLoadingLayoutProxy(false, true); endLabels.setPullLabel("上拉刷新"); endLabels.setRefreshingLabel("正在载入..."); endLabels.setReleaseLabel("放开刷新..."); /** * 监听事件 */ refreshScrollView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ScrollView>() { @Override public void onPullDownToRefresh(PullToRefreshBase<ScrollView> refreshView) { getRefreshData(); } @Override public void onPullUpToRefresh(PullToRefreshBase<ScrollView> refreshView) { page_num++; getDataFromNet(); } }); } /** * 轮播图的方法 */ private void lunBoTu() { NetDataUtil.getData("http://v3.wufazhuce.com:8000/api/reading/index/?version=3.5.0&platform=android", getActivity(), new JsonCallBack() { @Override public void getJsonString(String json) { //这个结合记录轮播图的所有地址 imageUrlList = new ArrayList<String>(); //解析数据 Gson gson = new Gson(); LunBoBean lunBoBean = gson.fromJson(json, LunBoBean.class); List<LunBoBean.DataBean.EssayBean> essay = lunBoBean.getData().getEssay(); for (LunBoBean.DataBean.EssayBean essayBean: essay) { //essayBean.getAuthor().get(0).getWeb_url() imageUrlList.add(essayBean.getAuthor().get(0).getWeb_url()); } //此时应该根据图片的路径,加载图片,设置适配器 ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getActivity(), imageUrlList); viewPager.setAdapter(viewPagerAdapter); //1.手动可以无限滑动....maxValue....把当前开始展示的位置放在足够大的某个位置 viewPager.setCurrentItem(imageUrlList.size()*100000); //2.自动轮播 handler.sendEmptyMessageDelayed(0,2000); } }); } /** * 下拉刷新获取数据 */ private void getRefreshData() { NetDataUtil.getData("http://gank.io/api/data/Android/10/1", getActivity(), new JsonCallBack() { @Override public void getJsonString(String json) { //解析 Gson gson = new Gson(); DataDataBean dataDataBean = gson.fromJson(json, DataDataBean.class); //先清空一下数据 list.clear(); //添加到集合的最前边,,,,(0,,,,) list.addAll(0,dataDataBean.getResults()); //设置适配器 setAdapter(); //设置适配器之后停止刷新的操作 refreshScrollView.onRefreshComplete(); //可以设置刷新的时间.... startLabels.setLastUpdatedLabel("上次更新时间:"+new SimpleDateFormat("HH:mm").format(new Date(System.currentTimeMillis())));//last最近的,最后一次update修改/更新 } }); } /** * 刚开始进入页面获取网络数据....还可以作为上拉加载获取数据的操作 * * */ private void getDataFromNet() { //第一个参数是接口,第二个上下文,第三个回调json数据 NetDataUtil.getData("http://gank.io/api/data/Android/10/"+page_num, getActivity(), new JsonCallBack() { @Override public void getJsonString(String json) { //解析 Gson gson = new Gson(); DataDataBean dataDataBean = gson.fromJson(json, DataDataBean.class); //往后面添加... list.addAll(dataDataBean.getResults()); //设置适配器 setAdapter(); //停止刷新 refreshScrollView.onRefreshComplete(); } }); } /** * 设置适配器的方法 */ private void setAdapter() { if (listViewAdapter == null){ listViewAdapter = new MyAdapter(getActivity(),list); listView.setAdapter(listViewAdapter); }else { listViewAdapter.notifyDataSetChanged(); } } }+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++package com.example.hello.myappzuoye.adapter; import android.content.Context; import android.support.v4.view.PagerAdapter; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.example.hello.myappzuoye.util.ImageLoaderUtil; import com.nostra13.universalimageloader.core.ImageLoader; import java.util.List; /** * Created by on */ public class ViewPagerAdapter extends PagerAdapter { Context context; List<String> imageUrlList; public ViewPagerAdapter(Context context, List<String> imageUrlList) { this.context = context; this.imageUrlList = imageUrlList; } @Override public int getCount() { return Integer.MAX_VALUE; } @Override public boolean isViewFromObject(View view, Object object) { return view == object; } @Override public Object instantiateItem(ViewGroup container, int position) { //1.创建imageView...添加到容器中 ImageView imageView = new ImageView(context); imageView.setScaleType(ImageView.ScaleType.FIT_XY); //展示图片 ImageLoader.getInstance().displayImage(imageUrlList.get(position%imageUrlList.size()),imageView, ImageLoaderUtil.gettupianyuanjiao()); //添加 container.addView(imageView); //2.返回当前展示的imageView控件 return imageView; } @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView((View) object); } }
+++++++++++++++++++++++++++++++++++++++++++++++++++fragment_scrollview
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <!--中多了几个属性 分别以ptr开头,这是指定pullToRefreshListView在刷新的时候出现的特效, 比如ptrDrawable第一个是指定刷新时显示的图片,ptrAnimationStyle第二个是指定刷新的图片以何种方式显示出来, ptrHeaderBackground第三个是指定刷新时头部的背景,ptrHeaderTextColor第四个是指定刷新时头部字体的颜色。--> <com.handmark.pulltorefresh.library.PullToRefreshScrollView xmlns:ptr="http://schemas.android.com/apk/res-auto" android:id="@+id/refresh_scroll_view" android:layout_width="match_parent" android:layout_height="match_parent" ptr:ptrAnimationStyle="flip" ptr:ptrDrawable="@drawable/default_ptr_flip" ptr:ptrHeaderBackground="#383838" ptr:ptrHeaderTextColor="#FFFFFF"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v4.view.ViewPager android:id="@+id/image_view_pager" android:layout_width="match_parent" android:layout_height="200dp"> </android.support.v4.view.ViewPager> <com.example.hello.myappzuoye.MyListView android:id="@+id/scroll_list_view" android:layout_width="match_parent" android:layout_height="match_parent"> </com.example.hello.myappzuoye.MyListView> </LinearLayout> </com.handmark.pulltorefresh.library.PullToRefreshScrollView> </LinearLayout>
PullToRefreshListView刷新2
最新推荐文章于 2020-04-02 14:17:05 发布