GridView

来源:互联网 发布:win8动态壁纸软件 编辑:程序博客网 时间:2024/06/18 09:59


//main

import android.os.Handler;import android.os.Message;import android.support.v4.view.ViewPager;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.GridView;import com.example.grideview.Utis.MyTask;import com.example.grideview.adapter.GvAdapter;import com.example.grideview.adapter.VpAdapter;import com.example.grideview.bean.ResultBean;import com.google.gson.Gson;import java.util.List;public class MainActivity extends AppCompatActivity {    private ViewPager vp;    private GridView gv;    private  int index=0;    private List<ResultBean.DataBean.EssayBean> essay;    private Handler handler=new Handler(){        @Override        public void handleMessage(Message msg) {            index++;            vp.setCurrentItem(index);           handler.sendEmptyMessageDelayed(1,2000);        }    };    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_main);        vp = (ViewPager) findViewById(R.id.vp);        gv = (GridView) findViewById(R.id.grid_view);        MyTask myTask=new MyTask(new MyTask.Icallbacks() {            @Override            public void updateUiByjson(String jsonstr) {                Gson gson=new Gson();                ResultBean resultBean = gson.fromJson(jsonstr, ResultBean.class);                ResultBean.DataBean data = resultBean.getData();                essay= data.getEssay();                vp.setAdapter(new VpAdapter(essay,MainActivity.this));                vp.setCurrentItem(index);                gv.setAdapter(new GvAdapter(essay,MainActivity.this));            }        });        myTask.execute("http://v3.wufazhuce.com:8000/api/reading/index/?version=3.5.0&platform=android");        handler.sendEmptyMessageDelayed(1,2000);    }}


//适配GvAdapter

public class GvAdapter extends BaseAdapter{    private List<ResultBean.DataBean.EssayBean> list;    private Context context;    public GvAdapter(List<ResultBean.DataBean.EssayBean> list, Context context) {        this.list = list;        this.context = context;    }    @Override    public int getCount() {        return list.size();    }    @Override    public Object getItem(int position) {        return list.get(position);    }    @Override    public long getItemId(int position) {        return position;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        if(convertView==null){            convertView= View.inflate(context, R.layout.item_gv, null);            holder=new ViewHolder();            holder.imageView= (ImageView) convertView.findViewById(R.id.img_gv);            holder.textView= (TextView) convertView.findViewById(R.id.text_gv);           convertView.setTag(holder);        }else{            holder= (ViewHolder) convertView.getTag();        }        holder.textView.setText(list.get(position).getAuthor().get(0).getUser_name());        ImageLoader.getInstance().displayImage(list.get(position%list.size()).getAuthor().get(0).getWeb_url(),holder.imageView, ImageloaderUtil.getImageOptions());        return convertView;    }    class ViewHolder{        ImageView imageView;        TextView  textView;    }}


//适配器VpageAdapter
public class VpAdapter extends PagerAdapter {    private List<ResultBean.DataBean.EssayBean> list;    private Context context;    public VpAdapter(List<ResultBean.DataBean.EssayBean> list, Context context) {        this.list = list;        this.context = context;    }    @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) {        ImageView imageView=new ImageView(context);        imageView.setScaleType(ImageView.ScaleType.FIT_XY);        ImageLoader.getInstance().displayImage(list.get(position%list.size()).getAuthor().get(0).getWeb_url(),imageView, ImageloaderUtil.getImageOptions());        container.addView(imageView);        return imageView;    }    @Override    public void destroyItem(ViewGroup container, int position, Object object) {        container.removeView((View) object);    }}


Bean包解析的数据

public class ResultBean {    /**     * res : 0     * data : {"essay":[{"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":"17026","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":"17026","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":"4745","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":"4746","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":"MENGMeRead读书会创办人,不务正业写作者。","wb_name":"@萌之刺刺","is_settled":"0","settled_type":"0","summary":"MeRead创办人,不务正业写作者。","fans_total":"1276","web_url":"http://image.wufazhuce.com/Fjs4uDTgQAXnIOPEvnnIIA7HdBxS"}],"has_audio":true,"author_list":[{"user_id":"7867217","user_name":"MENG","desc":"MENGMeRead读书会创办人,不务正业写作者。","wb_name":"@萌之刺刺","is_settled":"0","settled_type":"0","summary":"MeRead创办人,不务正业写作者。","fans_total":"1276","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":"6756","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":"6756","web_url":"http://image.wufazhuce.com/FuCd1X9lLbWuu3Ps_aoMd8vJjQml"}]},{"content_id":"2859","hp_title":"建设北路32B","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":"43","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":"43","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":"782","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":"782","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":"3728","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":"3728","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":"1927","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":"1927","web_url":"http://image.wufazhuce.com/FmDRnQ1XhReHRHB4jYqAPSx8htsP"}]},{"content_id":"2855","hp_title":"去往墓地途中","hp_makettime":"2017-10-13 06:00:00","guide_word":"所有的坟都只是一个孤零零的土包,人们每次来祭扫,都是在荒草与落叶间张望。","start_video":"","author":[{"user_id":"5540827","user_name":"与路","desc":"作家,重度白日梦患者。","wb_name":"","is_settled":"0","settled_type":"0","summary":"作家,重度白日梦患者。","fans_total":"165","web_url":"http://image.wufazhuce.com/FqsR2GNvE2NfQuRQmBkE5MRn6x19"}],"has_audio":true,"author_list":[{"user_id":"5540827","user_name":"与路","desc":"作家,重度白日梦患者。","wb_name":"","is_settled":"0","settled_type":"0","summary":"作家,重度白日梦患者。","fans_total":"165","web_url":"http://image.wufazhuce.com/FqsR2GNvE2NfQuRQmBkE5MRn6x19"}]},{"content_id":"2847","hp_title":"傻瓜,OK","hp_makettime":"2017-10-13 06:00:00","guide_word":"这世界,有人或者狗需要你,有人或者狗想着你,那就是爱。","start_video":"","author":[{"user_id":"4814692","user_name":"周云蓬","desc":"音乐人","wb_name":"@周云蓬","is_settled":"0","settled_type":"0","summary":"音乐人","fans_total":"1837","web_url":"http://image.wufazhuce.com/Fqj2PPxzczKRicQ0c5hluOPiE-fl"}],"has_audio":false,"author_list":[{"user_id":"4814692","user_name":"周云蓬","desc":"音乐人","wb_name":"@周云蓬","is_settled":"0","settled_type":"0","summary":"音乐人","fans_total":"1837","web_url":"http://image.wufazhuce.com/Fqj2PPxzczKRicQ0c5hluOPiE-fl"}]}],"serial":[{"id":"452","serial_id":"49","number":"10","title":"我在三十岁的第一年 II · 第十话","excerpt":"人生就是一场大型错位。","read_num":"21400","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":"8096","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":"8096","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":"33000","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":"3174","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":"3174","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439"]},{"id":"450","serial_id":"49","number":"9","title":"我在三十岁的第一年 II · 第九话","excerpt":"如果一个人被迫过着清心寡欲的生活,只要有一个机会,她就会跑向纵情享乐。","read_num":"36400","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":"8096","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":"8096","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":"40000","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":"3174","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":"3174","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439"]},{"id":"449","serial_id":"49","number":"8","title":"我在三十岁的第一年 II · 第八话","excerpt":"日常生活给再多奇迹,也总是乏味和平庸的结尾最多。","read_num":"41600","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":"8096","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":"8096","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":"44100","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":"3174","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":"3174","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439"]},{"id":"448","serial_id":"49","number":"7","title":"我在三十岁的第一年 II · 第七话","excerpt":"人所有一切的行动,不过是遵循内心最强烈的愿望。","read_num":"41100","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":"8096","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":"8096","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":"46000","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":"3174","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":"3174","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439"]},{"id":"442","serial_id":"49","number":"6","title":"我在三十岁的第一年 II · 第六话","excerpt":"我不是拜金,我只是习惯了金钱带来的快乐。","read_num":"49500","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":"8096","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":"8096","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"}],"serial_list":["428","429","433","436","440","442","448","449","450","452"]},{"id":"435","serial_id":"50","number":"4","title":"相亲攻略手册(4·四月,遍地蔷薇","excerpt":"那个名字我看着眼熟,细看后心口一跳,带着些酥酥的痒。","read_num":"55800","maketime":"2017-10-07 06:00:00","start_video":"","author":{"user_id":"4814710","user_name":"姚佳黛","desc":"喜欢码字儿的精分水瓶座菇凉,脑洞和食量一样大。过气网络小说作者,有一个公众号:头上没有草原的茸茸。","wb_name":"","is_settled":"0","settled_type":"0","summary":"学医的见过手术室血肉横飞的文字编辑。 ","fans_total":"3174","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":"3174","web_url":"http://image.wufazhuce.com/FoREns_Rl0UOQCYzdBuMAxX239Dt"}],"serial_list":["430","431","434","435","437","438","444","439"]}],"question":[{"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":"2106","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":"1488","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":"311","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":"509","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":"486","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":""}]},{"question_id":"1878","question_title":"有过哪些让你印象深刻的作弊经历?","answer_title":"","answer_content":"被教务处主任从背后拿走手机的那一秒,我感受到了人生第一次最强烈的懵逼感。","question_makettime":"2017-10-09 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":""}]}]}     */    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 : 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":"17026","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":"17026","web_url":"http://image.wufazhuce.com/Fg_e6teZsb3lZ1QStYtdnAkh6bO8"}]             */            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 : 4813757                 * user_name : 苏更生                 * desc : 「一个」App常驻作家,微信公众号:hulizhai                 * wb_name : @假苏更生                 * is_settled : 0                 * settled_type : 0                 * summary : 「一个」App常驻作家,微信公众号:hulizhai                 * fans_total : 17026                 * web_url : http://image.wufazhuce.com/Fg_e6teZsb3lZ1QStYtdnAkh6bO8                 */                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 : 4813757                 * user_name : 苏更生                 * desc : 「一个」App常驻作家,微信公众号:hulizhai                 * wb_name : @假苏更生                 * is_settled : 0                 * settled_type : 0                 * summary : 「一个」App常驻作家,微信公众号:hulizhai                 * fans_total : 17026                 * web_url : http://image.wufazhuce.com/Fg_e6teZsb3lZ1QStYtdnAkh6bO8                 */                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 : 452             * serial_id : 49             * number : 10             * title : 我在三十岁的第一年 II · 第十话             * excerpt : 人生就是一场大型错位。             * read_num : 21400             * 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":"8096","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":"8096","web_url":"http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4"}]             * serial_list : ["428","429","433","436","440","442","448","449","450","452"]             */            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 : 4808838                 * user_name : 毛利                 * desc : 毛利,专栏作家。《我在三十岁的第一年》即将上市。                 * wb_name : @毛利                 * is_settled : 0                 * settled_type : 0                 * summary : 专栏作家。                 * fans_total : 8096                 * web_url : http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4                 */                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 : 4808838                 * user_name : 毛利                 * desc : 毛利,专栏作家。《我在三十岁的第一年》即将上市。                 * wb_name : @毛利                 * is_settled : 0                 * settled_type : 0                 * summary : 专栏作家。                 * fans_total : 8096                 * web_url : http://image.wufazhuce.com/Fl3AgUQb4i6WocmORrnhMPkcDkV4                 */                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 : 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":""}]             */            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 : 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;                }            }            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;                }            }        }    }}




工具类

public class ImageloaderUtil {    /**     * ImageLoader的配置     * @param context     */    public static void initConfig(Context context) {        //配置//        File cacheFile=context.getExternalCacheDir();        File cacheFile= new File(Environment.getExternalStorageDirectory()+"/"+"imgages");        ImageLoaderConfiguration config=new ImageLoaderConfiguration.Builder(context)                .memoryCacheExtraOptions(480, 800)//缓存图片最大的长和宽                .threadPoolSize(2)//线程池的数量                .threadPriority(4)                .memoryCacheSize(2*1024*1024)//设置内存缓存区大小                .diskCacheSize(20*1024*1024)//设置sd卡缓存区大小                .diskCache(new UnlimitedDiskCache(cacheFile))//自定义缓存目录                .writeDebugLogs()//打印日志内容                .diskCacheFileNameGenerator(new Md5FileNameGenerator())//给缓存的文件名进行md5加密处理                .build();        ImageLoader.getInstance().init(config);    }    /**     * 获取图片设置类     * @return     */    public static DisplayImageOptions getImageOptions(){        DisplayImageOptions optionsoptions=new DisplayImageOptions.Builder()                .cacheInMemory(true)//使用内存缓存                .cacheOnDisk(true)//使用磁盘缓存                .bitmapConfig(Bitmap.Config.RGB_565)//设置图片格式                .build();        return optionsoptions;    }}


工具类

public class MyTask extends AsyncTask<String,Void,String> {    //申请一个接口类对象    private  Icallbacks icallbacks;    //将无参构造设置成私有的,使之在外部不能够调用    private MyTask(){}    //定义有参构造方法    public MyTask(Icallbacks icallbacks) {        this.icallbacks = icallbacks;    }    @Override    protected String doInBackground(String... params) {        String str="";        try {             //使用HttpUrlConnection            URL url=new URL(params[0]);            HttpURLConnection connection=(HttpURLConnection) url.openConnection();            connection.setRequestMethod("GET");            connection.setReadTimeout(5000);            connection.setConnectTimeout(5000);            if(connection.getResponseCode()==200){                InputStream inputStream=connection.getInputStream();                //调用工具类中的静态方法                str=StreamToString.streamToStr(inputStream,"utf-8");            }        } catch (MalformedURLException e) {            e.printStackTrace();        }catch (IOException e){            e.printStackTrace();        }        return str;    }    @Override    protected void onPostExecute(String s) {        super.onPostExecute(s);        //解析,封装到bean,更新ui组件        icallbacks.updateUiByjson(s);    }    //定义一个接口    public interface Icallbacks{        /**         * 根据回传的json字符串,解析并更新页面组件         * @param jsonstr         */        void updateUiByjson(String jsonstr);    }}



工具类

public class StreamToString {    public static String streamToStr(InputStream inputStream,String chartSet){        StringBuilder builder=new StringBuilder();        try {            BufferedReader br=new BufferedReader(new InputStreamReader(inputStream,chartSet));            String con;            while ((con=br.readLine())!=null){                builder.append(con);            }            br.close();            return builder.toString();        } catch (Exception e) {            e.printStackTrace();        }        return "";    }}


//工具类

public class MyApplication extends Application {    @Override    public void onCreate() {        super.onCreate();        ImageloaderUtil.initConfig(this);    }} 




//activity-main

<?xml version="1.0" encoding="utf-8"?><LinearLayout    xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical"    tools:context="com.example.grideview.MainActivity">    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="200dp"        >        <android.support.v4.view.ViewPager            android:layout_width="match_parent"            android:layout_height="match_parent"            android:id="@+id/vp"            ></android.support.v4.view.ViewPager>        <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_alignBottom="@+id/vp"            android:orientation="horizontal"            >            <TextView                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:gravity="center"                android:text="assssaaass"                />        </LinearLayout>    </RelativeLayout>    <LinearLayout        android:layout_width="match_parent"        android:layout_height="match_parent"        android:orientation="vertical"        >        <GridView            android:id="@+id/grid_view"            android:layout_width="match_parent"            android:layout_height="match_parent"            android:numColumns="2"></GridView>    </LinearLayout></LinearLayout>



//item-gv

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical"    android:layout_gravity="center"    android:gravity="center"    >    <ImageView        android:id="@+id/img_gv"        android:layout_width="150dp"        android:layout_height="150dp" />    <TextView        android:id="@+id/text_gv"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_weight="1"        android:gravity="center" /></LinearLayout>


//要加的权限

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
android:name=".MyApplication"


原创粉丝点击