简单使用MVP+Retract+Rxjava视频播放


implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'io.reactivex.rxjava2:rxjava:2.1.13'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.google.dagger:dagger:2.8'
annotationProcessor 'com.google.dagger:dagger-compiler:2.7'
implementation 'com.facebook.fresco:fresco:0.12.0'
// 支持 GIF 动图,需要添加
implementation 'com.facebook.fresco:animated-gif:0.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'

activity_main.xml

<?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=".MainActivity">

    <com.viewpagerindicator.TabPageIndicator
        android:id="@+id/titles"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />

    <android.support.v4.view.ViewPager
        android:id="@+id/vp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"></android.support.v4.view.ViewPager>
</LinearLayout>

fragment_img.xml

<?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.support.v7.widget.RecyclerView
        android:id="@+id/rv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />
</LinearLayout>


fragment_video.xml

<?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.support.v7.widget.RecyclerView
        android:id="@+id/rv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />
</LinearLayout>


img_item.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:face="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:orientation="horizontal"
        >

        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/imgtou1"
            android:layout_marginTop="5dp"
            android:layout_width="50dp"
            android:layout_height="50dp"
            face:roundAsCircle="true"
            />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/text4"
            android:layout_marginLeft="15dp"
            />

    </LinearLayout>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/text3"
        />
    <com.facebook.drawee.view.SimpleDraweeView
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:id="@+id/img"
        />
</LinearLayout>
 
 

vedio_item.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:face="http://schemas.android.com/apk/res-auto"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:orientation="horizontal"
        >

        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/imgtou"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginTop="5dp"
            face:roundAsCircle="true"
            />

        <TextView
            android:id="@+id/text2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="15dp"
            />

    </LinearLayout>

    <TextView
        android:id="@+id/text1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        />


    <VideoView
        android:id="@+id/surface_view"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        />
</LinearLayout>

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>


app

MyApp

package com.example.app;

import android.app.Application;

import com.facebook.drawee.backends.pipeline.Fresco;

public class MyApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Fresco.initialize(this);
    }
}
 
 

week2demo

bean

ImgBean

package com.example.week2demo.bean;

import java.util.List;

public class ImgBean {

    /**
     * code : 200
     * msg : 成功!
     * data : [{"type":"10","text":"哪个女人不爱美?一份最新的调查显示,女性平均每天要往脸上涂抹168种成分来护肤!","user_id":"22615830","name":"梁煊","screen_name":"梁煊","profile_image":"http://qzapp.qlogo.cn/qzapp/100336987/0FF000F368B69AFC0DA33B1B6B5CA9E7/100","created_at":"2018-05-16 22:12:01","create_time":null,"passtime":"2018-05-16 22:12:01","love":"105","hate":"7","comment":"11","repost":"0","bookmark":"1","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58240","theme_name":"搞笑图片","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"7","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/05/14/5af9b23f8b1ab_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/05/14/5af9b23f8b1ab_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/05/14/5af9b23f8b1ab_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/05/14/5af9b23f8b1ab_1.jpg","width":"750","height":"2098","tag":"","t":1526479921,"ding":"105","favourite":"1","top_cmt":null,"themes":null},{"type":"10","text":"妹子很漂亮,不过仔细一看,要不起啊!","user_id":"16346788","name":"hguM","screen_name":"hguM","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/04/20/58f8444f4074a_mini.jpg","created_at":"2017-09-06 05:52:01","create_time":null,"passtime":"2017-09-06 05:52:01","love":"870","hate":"82","comment":"209","repost":"21","bookmark":"129","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"3500","theme_name":"社会百态","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"82","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2017/08/23/599cba9c81f62.gif","image2":"http://wimg.spriteapp.cn/ugc/2017/08/23/599cba9c81f62.gif","is_gif":true,"image0":"http://wimg.spriteapp.cn/ugc/2017/08/23/599cba9c81f62.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2017/08/23/599cba9c81f62.gif","width":"187","height":"271","tag":"","t":1504648321,"ding":"870","favourite":"129","top_cmt":null,"themes":null},{"type":"10","text":"相传只有18岁年轻女孩,才能做到这个动作。不相信的小伙伴儿可以试一下","user_id":"22320147","name":"段家老司机","screen_name":"段家老司机","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/04/17/5ad5892394de8_mini.jpg","created_at":"2018-04-29 05:18:02","create_time":null,"passtime":"2018-04-29 05:18:02","love":"113","hate":"16","comment":"31","repost":"0","bookmark":"2","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"8466","theme_name":"生活技巧","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"16","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/04/27/5ae318062df6a_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/04/27/5ae318062df6a_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/04/27/5ae318062df6a_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/04/27/5ae318062df6a_1.jpg","width":"960","height":"540","tag":"","t":1524950282,"ding":"113","favourite":"2","top_cmt":null,"themes":null},{"type":"10","text":"一人一句那种特别尬的撩妹金句,评论区全是尬撩现场","user_id":"20746808","name":"思恋那份青涩","screen_name":"思恋那份青涩","profile_image":"http://wimg.spriteapp.cn/profile/20170512120439.jpg","created_at":"2018-02-18 11:34:02","create_time":null,"passtime":"2018-02-18 11:34:02","love":"1007","hate":"133","comment":"276","repost":"116","bookmark":"902","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"133","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/02/17/c69b9f2a139f11e898a6842b2b4c75ab_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/02/17/c69b9f2a139f11e898a6842b2b4c75ab_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/02/17/c69b9f2a139f11e898a6842b2b4c75ab_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/02/17/c69b9f2a139f11e898a6842b2b4c75ab_1.jpg","width":"617","height":"8207","tag":"","t":1518924842,"ding":"1007","favourite":"902","top_cmt":null,"themes":null},{"type":"10","text":"[今日互动] 如果可以放纵一次,你最想做什么?","user_id":"19794323","name":"这又神马情况","screen_name":"这又神马情况","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/11/23/5a16a76c2ceeb_mini.jpg","created_at":"2018-04-24 23:18:01","create_time":null,"passtime":"2018-04-24 23:18:01","love":"205","hate":"21","comment":"173","repost":"12","bookmark":"15","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"3500","theme_name":"社会百态","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"21","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/04/24/5ade958f3dc39_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/04/24/5ade958f3dc39_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/04/24/5ade958f3dc39_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/04/24/5ade958f3dc39_1.jpg","width":"810","height":"12286","tag":"","t":1524583081,"ding":"205","favourite":"15","top_cmt":null,"themes":null},{"type":"10","text":"作为一只流浪猫,这生活质量好的不是一点点了~","user_id":"18682920","name":"黑皮咪咪眼","screen_name":"黑皮咪咪眼","profile_image":"http://wimg.spriteapp.cn/profile/large/2016/06/27/577119b7d372e_mini.jpg","created_at":"2018-03-16 09:17:33","create_time":null,"passtime":"2018-03-16 09:17:33","love":"613","hate":"104","comment":"70","repost":"30","bookmark":"22","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"104","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/03/15/5aaa24b99b659_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/03/15/5aaa24b99b659_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/03/15/5aaa24b99b659_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/03/15/5aaa24b99b659_1.jpg","width":"640","height":"3790","tag":"","t":1521163053,"ding":"613","favourite":"22","top_cmt":null,"themes":null},{"type":"10","text":"早高峰的地铁好挤,把俩人的嘴巴都挤在一起了,我看不见,我看不见~","user_id":"18682920","name":"黑皮咪咪眼","screen_name":"黑皮咪咪眼","profile_image":"http://wimg.spriteapp.cn/profile/large/2016/06/27/577119b7d372e_mini.jpg","created_at":"2018-03-17 22:10:02","create_time":null,"passtime":"2018-03-17 22:10:02","love":"570","hate":"61","comment":"98","repost":"15","bookmark":"17","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58132","theme_name":"秀恩爱撒狗粮","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"61","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/03/17/5aac99f9e35e6.gif","image2":"http://wimg.spriteapp.cn/ugc/2018/03/17/5aac99f9e35e6.gif","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/03/17/5aac99f9e35e6.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/03/17/5aac99f9e35e6.gif","width":"170","height":"273","tag":"","t":1521295802,"ding":"570","favourite":"17","top_cmt":null,"themes":null},{"type":"10","text":"看来\u201c社会鹅\u201d,遇到了强劲的对手 !","user_id":"13943553","name":"龘靐龗齾齉爩虌麷灩韊","screen_name":"龘靐龗齾齉爩虌麷灩韊","profile_image":"http://wimg.spriteapp.cn/profile/large/2016/10/07/57f7b339ed872_mini.jpg","created_at":"2018-04-02 08:28:01","create_time":null,"passtime":"2018-04-02 08:28:01","love":"166","hate":"15","comment":"47","repost":"2","bookmark":"3","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58240","theme_name":"搞笑图片","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"15","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/04/01/5ac03b21f03ad_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/04/01/5ac03b21f03ad_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/04/01/5ac03b21f03ad_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/04/01/5ac03b21f03ad_1.jpg","width":"440","height":"1486","tag":"","t":1522628881,"ding":"166","favourite":"3","top_cmt":null,"themes":null},{"type":"10","text":"被俩喵星人撒了碗猫粮!最后那一搂过分了啊","user_id":"17474065","name":"马小梅","screen_name":"马小梅","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/02/24/5a90448611639_mini.jpg","created_at":"2018-04-12 00:48:02","create_time":null,"passtime":"2018-04-12 00:48:02","love":"215","hate":"53","comment":"34","repost":"10","bookmark":"6","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"53","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/04/09/5acb7969c79c8.gif","image2":"http://wimg.spriteapp.cn/ugc/2018/04/09/5acb7969c79c8.gif","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/04/09/5acb7969c79c8.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/04/09/5acb7969c79c8.gif","width":"184","height":"229","tag":"","t":1523465282,"ding":"215","favourite":"6","top_cmt":null,"themes":null},{"type":"10","text":"玩游戏常遇到的问题\u2014\u2014卡了","user_id":"19531820","name":"臭宝蛋蛋","screen_name":"臭宝蛋蛋","profile_image":"http://tva4.sinaimg.cn/crop.0.0.996.996.50/e7f9e94djw8f6ursgyso3j20ro0rp0wy.jpg","created_at":"2018-03-10 23:00:02","create_time":null,"passtime":"2018-03-10 23:00:02","love":"1130","hate":"44","comment":"136","repost":"77","bookmark":"111","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"44","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/03/07/5a9f65d920499.gif","image2":"http://wimg.spriteapp.cn/ugc/2018/03/07/5a9f65d920499.gif","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/03/07/5a9f65d920499.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/03/07/5a9f65d920499.gif","width":"200","height":"199","tag":"","t":1520694002,"ding":"1130","favourite":"111","top_cmt":null,"themes":null},{"type":"10","text":"和我在成都的街头走一走,走走吃吃喝喝!","user_id":"5348609","name":"我有了一个男朋友ヽ、","screen_name":"我有了一个男朋友ヽ、","profile_image":"http://wimg.spriteapp.cn/profile/large/2016/07/26/57974925b34a6_mini.jpg","created_at":"2018-03-15 23:52:01","create_time":null,"passtime":"2018-03-15 23:52:01","love":"1511","hate":"110","comment":"231","repost":"389","bookmark":"715","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"3500","theme_name":"社会百态","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"110","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/03/15/5aa9d64640266_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/03/15/5aa9d64640266_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/03/15/5aa9d64640266_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/03/15/5aa9d64640266_1.jpg","width":"750","height":"54059","tag":"","t":1521129121,"ding":"1511","favourite":"715","top_cmt":null,"themes":null},{"type":"10","text":"如果是真爱,那就大声说出来!!!","user_id":"19040254","name":"图片妞","screen_name":"图片妞","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/03/23/5ab5216427ba2_mini.jpg","created_at":"2018-05-11 07:36:02","create_time":null,"passtime":"2018-05-11 07:36:02","love":"83","hate":"12","comment":"32","repost":"2","bookmark":"3","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"55163","theme_name":"主版块","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"12","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/05/09/5af2baf6a33b4_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/05/09/5af2baf6a33b4_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/05/09/5af2baf6a33b4_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/05/09/5af2baf6a33b4_1.jpg","width":"440","height":"2865","tag":"","t":1525995362,"ding":"83","favourite":"3","top_cmt":null,"themes":null},{"type":"10","text":"当女同事对你有好感的时候....","user_id":"21179533","name":"冷眼看世界UN6","screen_name":"冷眼看世界UN6","profile_image":"http://qzapp.qlogo.cn/qzapp/100336987/978F8BE909512DF20CFD9B9A129B04CF/100","created_at":"2017-09-25 14:58:02","create_time":null,"passtime":"2017-09-25 14:58:02","love":"3727","hate":"72","comment":"266","repost":"57","bookmark":"157","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58240","theme_name":"搞笑图片","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"72","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2017/09/23/59c6645819385_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2017/09/23/59c6645819385_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2017/09/23/59c6645819385_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2017/09/23/59c6645819385_1.jpg","width":"1279","height":"1706","tag":"","t":1506322682,"ding":"3727","favourite":"157","top_cmt":null,"themes":null},{"type":"10","text":"真人版王者峡谷已经在建设中了,姐夫们有什么疑问就提出来吧","user_id":"19837434","name":"蛮夷阿涂","screen_name":"蛮夷阿涂","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/03/10/58c2180891031_mini.jpg","created_at":"2017-10-03 12:42:02","create_time":null,"passtime":"2017-10-03 12:42:02","love":"1259","hate":"143","comment":"515","repost":"71","bookmark":"73","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"143","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2017/10/02/59d1da57b28b0.gif","image2":"http://wimg.spriteapp.cn/ugc/2017/10/02/59d1da57b28b0.gif","is_gif":true,"image0":"http://wimg.spriteapp.cn/ugc/2017/10/02/59d1da57b28b0.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2017/10/02/59d1da57b28b0.gif","width":"355","height":"299","tag":"","t":1507005722,"ding":"1259","favourite":"73","top_cmt":null,"themes":null},{"type":"10","text":"姐夫老铁们,求个大胆的想法!","user_id":"17588230","name":"神马情况这是","screen_name":"神马情况这是","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/06/15/59429c46ba478_mini.jpg","created_at":"2017-10-06 15:08:01","create_time":null,"passtime":"2017-10-06 15:08:01","love":"1121","hate":"143","comment":"531","repost":"22","bookmark":"22","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"56855","theme_name":"很内涵","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"143","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2017/10/05/59d5fd5c1749a.gif","image2":"http://wimg.spriteapp.cn/ugc/2017/10/05/59d5fd5c1749a.gif","is_gif":true,"image0":"http://wimg.spriteapp.cn/ugc/2017/10/05/59d5fd5c1749a.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2017/10/05/59d5fd5c1749a.gif","width":"200","height":"118","tag":"","t":1507273681,"ding":"1121","favourite":"22","top_cmt":null,"themes":null},{"type":"10","text":"简单分析下妇联。。不对,《复联3》。","user_id":"13601386","name":"百思小娜","screen_name":"百思小娜","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/03/25/5ab762a102bc1_mini.jpg","created_at":"2018-05-17 08:36:01","create_time":null,"passtime":"2018-05-17 08:36:01","love":"235","hate":"15","comment":"51","repost":"16","bookmark":"13","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58240","theme_name":"搞笑图片","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"15","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/05/14/5af921a39331d_1.jpg","image2":"http://wimg.spriteapp.cn/ugc/2018/05/14/5af921a39331d_1.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/05/14/5af921a39331d_1.jpg","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/05/14/5af921a39331d_1.jpg","width":"750","height":"2639","tag":"","t":1526517361,"ding":"235","favourite":"13","top_cmt":null,"themes":null},{"type":"10","text":"说了多少遍了让你走正门,你非要翻窗户,这不高跟鞋掉了吧!","user_id":"19268252","name":"夏小檬","screen_name":"夏小檬","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/10/09/59db2392b3321_mini.jpg","created_at":"2018-02-17 14:48:02","create_time":null,"passtime":"2018-02-17 14:48:02","love":"528","hate":"58","comment":"61","repost":"1","bookmark":"9","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"58","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/02/16/5a862a1722129.gif","image2":"http://wimg.spriteapp.cn/ugc/2018/02/16/5a862a1722129.gif","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/02/16/5a862a1722129.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/02/16/5a862a1722129.gif","width":"220","height":"300","tag":"","t":1518850082,"ding":"528","favourite":"9","top_cmt":null,"themes":null},{"type":"10","text":"这货还有训练的必要吗?","user_id":"21361792","name":"欢乐二哈_","screen_name":"欢乐二哈_","profile_image":"http://wx.qlogo.cn/mmopen/vi_32/v9q4lvibU1ZaMsIfqrgW76VrODaJqo9k2xNC6ocFoMpwC6DnfB8zVRu9JRa7mrcuWMFH5XszKAjDM2hTmSM31vw/0","created_at":"2017-09-25 23:00:02","create_time":null,"passtime":"2017-09-25 23:00:02","love":"2365","hate":"101","comment":"286","repost":"408","bookmark":"340","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"17083","theme_name":"爆笑Gif","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"101","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2017/09/24/59c78f750512e.gif","image2":"http://wimg.spriteapp.cn/ugc/2017/09/24/59c78f750512e.gif","is_gif":true,"image0":"http://wimg.spriteapp.cn/ugc/2017/09/24/59c78f750512e.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2017/09/24/59c78f750512e.gif","width":"299","height":"255","tag":"","t":1506351602,"ding":"2365","favourite":"340","top_cmt":null,"themes":null},{"type":"10","text":"脑补一下健身房骑动感单车   教练带着一帮孩子嗨","user_id":"21228478","name":"hardy辰","screen_name":"hardy辰","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/09/26/59ca2107ac5db_mini.jpg","created_at":"2017-09-24 16:46:01","create_time":null,"passtime":"2017-09-24 16:46:01","love":"2985","hate":"86","comment":"118","repost":"385","bookmark":"210","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"17083","theme_name":"爆笑Gif","theme_type":"1","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"86","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2017/09/22/59c53126045b9.gif","image2":"http://wimg.spriteapp.cn/ugc/2017/09/22/59c53126045b9.gif","is_gif":true,"image0":"http://wimg.spriteapp.cn/ugc/2017/09/22/59c53126045b9.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2017/09/22/59c53126045b9.gif","width":"198","height":"237","tag":"","t":1506242761,"ding":"2985","favourite":"210","top_cmt":null,"themes":null},{"type":"10","text":"狗:老板,稍微修下,等会儿要见妹纸","user_id":"17474065","name":"马小梅","screen_name":"马小梅","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/02/24/5a90448611639_mini.jpg","created_at":"2018-04-12 19:34:01","create_time":null,"passtime":"2018-04-12 19:34:01","love":"146","hate":"14","comment":"11","repost":"13","bookmark":"4","bimageuri":"","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"","videotime":0,"original_pid":"0","cache_version":2,"playcount":null,"playfcount":null,"cai":"14","weixin_url":null,"image1":"http://wimg.spriteapp.cn/ugc/2018/04/09/5aca67e3a3d8b.gif","image2":"http://wimg.spriteapp.cn/ugc/2018/04/09/5aca67e3a3d8b.gif","is_gif":false,"image0":"http://wimg.spriteapp.cn/ugc/2018/04/09/5aca67e3a3d8b.gif","image_small":null,"cdn_img":"http://wimg.spriteapp.cn/ugc/2018/04/09/5aca67e3a3d8b.gif","width":"180","height":"239","tag":"","t":1523532841,"ding":"146","favourite":"4","top_cmt":null,"themes":null}]
     */

    private int code;
    private String msg;
    private List<DataBean> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * type : 10
         * text : 哪个女人不爱美?一份最新的调查显示,女性平均每天要往脸上涂抹168种成分来护肤!
         * user_id : 22615830
         * name : 梁煊
         * screen_name : 梁煊
         * profile_image : http://qzapp.qlogo.cn/qzapp/100336987/0FF000F368B69AFC0DA33B1B6B5CA9E7/100
         * created_at : 2018-05-16 22:12:01
         * create_time : null
         * passtime : 2018-05-16 22:12:01
         * love : 105
         * hate : 7
         * comment : 11
         * repost : 0
         * bookmark : 1
         * bimageuri :
         * voiceuri : null
         * voicetime : null
         * voicelength : null
         * status : 4
         * theme_id : 58240
         * theme_name : 搞笑图片
         * theme_type : 1
         * videouri :
         * videotime : 0
         * original_pid : 0
         * cache_version : 2
         * playcount : null
         * playfcount : null
         * cai : 7
         * weixin_url : null
         * image1 : http://wimg.spriteapp.cn/ugc/2018/05/14/5af9b23f8b1ab_1.jpg
         * image2 : http://wimg.spriteapp.cn/ugc/2018/05/14/5af9b23f8b1ab_1.jpg
         * is_gif : false
         * image0 : http://wimg.spriteapp.cn/ugc/2018/05/14/5af9b23f8b1ab_1.jpg
         * image_small : null
         * cdn_img : http://wimg.spriteapp.cn/ugc/2018/05/14/5af9b23f8b1ab_1.jpg
         * width : 750
         * height : 2098
         * tag :
         * t : 1526479921
         * ding : 105
         * favourite : 1
         * top_cmt : null
         * themes : null
         */

        private String type;
        private String text;
        private String user_id;
        private String name;
        private String screen_name;
        private String profile_image;
        private String created_at;
        private Object create_time;
        private String passtime;
        private String love;
        private String hate;
        private String comment;
        private String repost;
        private String bookmark;
        private String bimageuri;
        private Object voiceuri;
        private Object voicetime;
        private Object voicelength;
        private String status;
        private String theme_id;
        private String theme_name;
        private String theme_type;
        private String videouri;
        private int videotime;
        private String original_pid;
        private int cache_version;
        private Object playcount;
        private Object playfcount;
        private String cai;
        private Object weixin_url;
        private String image1;
        private String image2;
        private boolean is_gif;
        private String image0;
        private Object image_small;
        private String cdn_img;
        private String width;
        private String height;
        private String tag;
        private int t;
        private String ding;
        private String favourite;
        private Object top_cmt;
        private Object themes;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public String getUser_id() {
            return user_id;
        }

        public void setUser_id(String user_id) {
            this.user_id = user_id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getScreen_name() {
            return screen_name;
        }

        public void setScreen_name(String screen_name) {
            this.screen_name = screen_name;
        }

        public String getProfile_image() {
            return profile_image;
        }

        public void setProfile_image(String profile_image) {
            this.profile_image = profile_image;
        }

        public String getCreated_at() {
            return created_at;
        }

        public void setCreated_at(String created_at) {
            this.created_at = created_at;
        }

        public Object getCreate_time() {
            return create_time;
        }

        public void setCreate_time(Object create_time) {
            this.create_time = create_time;
        }

        public String getPasstime() {
            return passtime;
        }

        public void setPasstime(String passtime) {
            this.passtime = passtime;
        }

        public String getLove() {
            return love;
        }

        public void setLove(String love) {
            this.love = love;
        }

        public String getHate() {
            return hate;
        }

        public void setHate(String hate) {
            this.hate = hate;
        }

        public String getComment() {
            return comment;
        }

        public void setComment(String comment) {
            this.comment = comment;
        }

        public String getRepost() {
            return repost;
        }

        public void setRepost(String repost) {
            this.repost = repost;
        }

        public String getBookmark() {
            return bookmark;
        }

        public void setBookmark(String bookmark) {
            this.bookmark = bookmark;
        }

        public String getBimageuri() {
            return bimageuri;
        }

        public void setBimageuri(String bimageuri) {
            this.bimageuri = bimageuri;
        }

        public Object getVoiceuri() {
            return voiceuri;
        }

        public void setVoiceuri(Object voiceuri) {
            this.voiceuri = voiceuri;
        }

        public Object getVoicetime() {
            return voicetime;
        }

        public void setVoicetime(Object voicetime) {
            this.voicetime = voicetime;
        }

        public Object getVoicelength() {
            return voicelength;
        }

        public void setVoicelength(Object voicelength) {
            this.voicelength = voicelength;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getTheme_id() {
            return theme_id;
        }

        public void setTheme_id(String theme_id) {
            this.theme_id = theme_id;
        }

        public String getTheme_name() {
            return theme_name;
        }

        public void setTheme_name(String theme_name) {
            this.theme_name = theme_name;
        }

        public String getTheme_type() {
            return theme_type;
        }

        public void setTheme_type(String theme_type) {
            this.theme_type = theme_type;
        }

        public String getVideouri() {
            return videouri;
        }

        public void setVideouri(String videouri) {
            this.videouri = videouri;
        }

        public int getVideotime() {
            return videotime;
        }

        public void setVideotime(int videotime) {
            this.videotime = videotime;
        }

        public String getOriginal_pid() {
            return original_pid;
        }

        public void setOriginal_pid(String original_pid) {
            this.original_pid = original_pid;
        }

        public int getCache_version() {
            return cache_version;
        }

        public void setCache_version(int cache_version) {
            this.cache_version = cache_version;
        }

        public Object getPlaycount() {
            return playcount;
        }

        public void setPlaycount(Object playcount) {
            this.playcount = playcount;
        }

        public Object getPlayfcount() {
            return playfcount;
        }

        public void setPlayfcount(Object playfcount) {
            this.playfcount = playfcount;
        }

        public String getCai() {
            return cai;
        }

        public void setCai(String cai) {
            this.cai = cai;
        }

        public Object getWeixin_url() {
            return weixin_url;
        }

        public void setWeixin_url(Object weixin_url) {
            this.weixin_url = weixin_url;
        }

        public String getImage1() {
            return image1;
        }

        public void setImage1(String image1) {
            this.image1 = image1;
        }

        public String getImage2() {
            return image2;
        }

        public void setImage2(String image2) {
            this.image2 = image2;
        }

        public boolean isIs_gif() {
            return is_gif;
        }

        public void setIs_gif(boolean is_gif) {
            this.is_gif = is_gif;
        }

        public String getImage0() {
            return image0;
        }

        public void setImage0(String image0) {
            this.image0 = image0;
        }

        public Object getImage_small() {
            return image_small;
        }

        public void setImage_small(Object image_small) {
            this.image_small = image_small;
        }

        public String getCdn_img() {
            return cdn_img;
        }

        public void setCdn_img(String cdn_img) {
            this.cdn_img = cdn_img;
        }

        public String getWidth() {
            return width;
        }

        public void setWidth(String width) {
            this.width = width;
        }

        public String getHeight() {
            return height;
        }

        public void setHeight(String height) {
            this.height = height;
        }

        public String getTag() {
            return tag;
        }

        public void setTag(String tag) {
            this.tag = tag;
        }

        public int getT() {
            return t;
        }

        public void setT(int t) {
            this.t = t;
        }

        public String getDing() {
            return ding;
        }

        public void setDing(String ding) {
            this.ding = ding;
        }

        public String getFavourite() {
            return favourite;
        }

        public void setFavourite(String favourite) {
            this.favourite = favourite;
        }

        public Object getTop_cmt() {
            return top_cmt;
        }

        public void setTop_cmt(Object top_cmt) {
            this.top_cmt = top_cmt;
        }

        public Object getThemes() {
            return themes;
        }

        public void setThemes(Object themes) {
            this.themes = themes;
        }
    }
}
 
 

VideoBean

package com.example.week2demo.bean;

import java.util.List;

public class VideoBean {

    /**
     * code : 200
     * msg : 成功!
     * data : [{"type":"41","text":"郭阳郭亮小品《昨天今天明天》,哈哈哈哈哈哈哈这俩兄弟光站那儿我就想笑","user_id":"20746583","name":"紫尛少年","screen_name":"紫尛少年","profile_image":"http://wimg.spriteapp.cn/profile/20170512102523.jpg","created_at":"2018-04-19 17:33:01","create_time":null,"passtime":"2018-04-19 17:33:01","love":"160","hate":"9","comment":"14","repost":"14","bookmark":"24","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"http://wvideo.spriteapp.cn/video/2018/0418/fbf9a05242d111e8863f842b2b4c75ab_wpd.mp4","videotime":430,"original_pid":"0","cache_version":2,"playcount":"4632","playfcount":"604","cai":"9","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg","width":"854","height":"480","tag":"","t":1524130381,"ding":"160","favourite":"24","top_cmt":null,"themes":null},{"type":"41","text":"一波让你笑到生活都不能自理的神回复","user_id":"18482739","name":"年少滥情不花心","screen_name":"年少滥情不花心","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/07/04/595b4417f130c_mini.jpg","created_at":"2018-05-03 18:14:01","create_time":null,"passtime":"2018-05-03 18:14:01","love":"168","hate":"10","comment":"19","repost":"17","bookmark":"34","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0501/27801944_508.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"55163","theme_name":"主版块","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2018/0501/5be2e28c-4d20-11e8-8743-1866daeb0df1_wpd.mp4","videotime":83,"original_pid":"0","cache_version":2,"playcount":"7163","playfcount":"1104","cai":"10","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0501/27801944_508.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0501/27801944_508.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0501/27801944_508.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0501/27801944_508.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0501/27801944_508.jpg","width":"640","height":"360","tag":"","t":1525342441,"ding":"168","favourite":"34","top_cmt":null,"themes":null},{"type":"41","text":"儿子带回来这么漂亮的女朋友,老妈居然不同意!","user_id":"22032265","name":"陈茜Sli","screen_name":"陈茜Sli","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/05/03/5aea978c55454_mini.jpg","created_at":"2018-05-04 06:44:01","create_time":null,"passtime":"2018-05-04 06:44:01","love":"309","hate":"20","comment":"34","repost":"33","bookmark":"14","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0503/27818976_917.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58191","theme_name":"搞笑视频","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2018/0503/5aea972d6ab1c_wpd.mp4","videotime":39,"original_pid":"0","cache_version":2,"playcount":"19086","playfcount":"3404","cai":"20","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0503/27818976_917.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0503/27818976_917.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0503/27818976_917.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0503/27818976_917.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0503/27818976_917.jpg","width":"352","height":"624","tag":"","t":1525387441,"ding":"309","favourite":"14","top_cmt":null,"themes":null},{"type":"41","text":"老外的确牛逼,否则春晚我们可能还看不到那么精彩的空中\u201c福\u201d字","user_id":"21347621","name":"早上不易空腹吃东西","screen_name":"早上不易空腹吃东西","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/03/29/5abc4ae01e2ac_mini.jpg","created_at":"2018-02-27 15:31:01","create_time":null,"passtime":"2018-02-27 15:31:01","love":"1387","hate":"43","comment":"125","repost":"105","bookmark":"117","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0226/5a93ab84870b4_wpd.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"55163","theme_name":"主版块","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2018/0226/5a93ab84870b4_wpd.mp4","videotime":118,"original_pid":"0","cache_version":2,"playcount":"63726","playfcount":"3092","cai":"43","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0226/5a93ab84870b4_wpd.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0226/5a93ab84870b4_wpd.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0226/5a93ab84870b4_wpd.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0226/5a93ab84870b4_wpd.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0226/5a93ab84870b4_wpd.jpg","width":"640","height":"368","tag":"","t":1519716661,"ding":"1387","favourite":"117","top_cmt":null,"themes":null},{"type":"41","text":"一首\u201c黝黑色的回忆\u201d给身边晒黑的男男女女","user_id":"18380255","name":"敏智的选择","screen_name":"敏智的选择","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/07/11/59645b78871e2_mini.jpg","created_at":"2017-09-18 09:57:02","create_time":null,"passtime":"2017-09-18 09:57:02","love":"2631","hate":"123","comment":"187","repost":"870","bookmark":"329","bimageuri":"http://wimg.spriteapp.cn/picture/2017/0917/26367425_551.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58191","theme_name":"搞笑视频","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2017/0917/5390718c-9ba8-11e7-993c-1866daeb0df1_wpd.mp4","videotime":162,"original_pid":"0","cache_version":2,"playcount":"111759","playfcount":"1750","cai":"123","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2017/0917/26367425_551.jpg","image2":"http://wimg.spriteapp.cn/picture/2017/0917/26367425_551.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2017/0917/26367425_551.jpg","image_small":"http://wimg.spriteapp.cn/picture/2017/0917/26367425_551.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2017/0917/26367425_551.jpg","width":"1066","height":"600","tag":"","t":1505699822,"ding":"2631","favourite":"329","top_cmt":null,"themes":null},{"type":"41","text":"厉害,2分钟教你做一把可以开合的纸伞~ 简单易懂! ","user_id":"15731740","name":"全世界的猪都笑了-","screen_name":"全世界的猪都笑了-","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/04/02/5ac1c32cabf32_mini.jpg","created_at":"2018-04-14 16:54:07","create_time":null,"passtime":"2018-04-14 16:54:07","love":"321","hate":"11","comment":"88","repost":"68","bookmark":"273","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0413/8870b3103ec011e88b47842b2b4c75ab_wpd.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"http://wvideo.spriteapp.cn/video/2018/0413/8870b3103ec011e88b47842b2b4c75ab_wpd.mp4","videotime":141,"original_pid":"0","cache_version":2,"playcount":"8800","playfcount":"731","cai":"11","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0413/8870b3103ec011e88b47842b2b4c75ab_wpd.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0413/8870b3103ec011e88b47842b2b4c75ab_wpd.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0413/8870b3103ec011e88b47842b2b4c75ab_wpd.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0413/8870b3103ec011e88b47842b2b4c75ab_wpd.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0413/8870b3103ec011e88b47842b2b4c75ab_wpd.jpg","width":"600","height":"600","tag":"","t":1523696047,"ding":"321","favourite":"273","top_cmt":null,"themes":null},{"type":"41","text":"我的意中人是个盖世英雄,有天他踏着七彩空头,手持98k,八倍镜娶我,狗命","user_id":"20005106","name":"我爱你小酒窝~","screen_name":"我爱你小酒窝~","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/02/24/5a91895a832cd_mini.jpg","created_at":"2018-02-23 21:25:02","create_time":null,"passtime":"2018-02-23 21:25:02","love":"1119","hate":"66","comment":"85","repost":"288","bookmark":"139","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0223/5a8f89dbe82c4__b.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"http://wvideo.spriteapp.cn/video/2018/0223/5a8f89dc0691a_wpd.mp4","videotime":19,"original_pid":"0","cache_version":2,"playcount":"78482","playfcount":"25934","cai":"66","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0223/5a8f89dbe82c4__b.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0223/5a8f89dbe82c4__b.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0223/5a8f89dbe82c4__b.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0223/5a8f89dbe82c4__b.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0223/5a8f89dbe82c4__b.jpg","width":"960","height":"540","tag":"","t":1519392302,"ding":"1119","favourite":"139","top_cmt":null,"themes":null},{"type":"41","text":"考驾照都经历过的辛酸史 想起都是一把泪","user_id":"19345936","name":"江湖大佬精彩视频","screen_name":"江湖大佬精彩视频","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/03/03/58b96188d0caf_mini.jpg","created_at":"2017-09-25 10:22:02","create_time":null,"passtime":"2017-09-25 10:22:02","love":"3565","hate":"65","comment":"671","repost":"1181","bookmark":"178","bimageuri":"http://wimg.spriteapp.cn/picture/2017/0924/26427779_496.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"55163","theme_name":"主版块","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2017/0924/748f2348-a0f2-11e7-9187-1866daeb0df1cutblack_wpd.mp4","videotime":86,"original_pid":"0","cache_version":2,"playcount":"130926","playfcount":"13934","cai":"65","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2017/0924/26427779_496.jpg","image2":"http://wimg.spriteapp.cn/picture/2017/0924/26427779_496.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2017/0924/26427779_496.jpg","image_small":"http://wimg.spriteapp.cn/picture/2017/0924/26427779_496.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2017/0924/26427779_496.jpg","width":"360","height":"450","tag":"","t":1506306122,"ding":"3565","favourite":"178","top_cmt":null,"themes":null},{"type":"41","text":"听见了没?说你呢\u2026\u2026","user_id":"17874820","name":"神思化伐","screen_name":"神思化伐","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/01/14/5a5b3dfd34258_mini.jpg","created_at":"2018-04-24 03:18:02","create_time":null,"passtime":"2018-04-24 03:18:02","love":"169","hate":"21","comment":"90","repost":"4","bookmark":"11","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0423/5addd1eff3119_wpd.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58191","theme_name":"搞笑视频","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2018/0423/5addd1eff3119_wpd.mp4","videotime":23,"original_pid":"0","cache_version":2,"playcount":"10966","playfcount":"1518","cai":"21","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0423/5addd1eff3119_wpd.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0423/5addd1eff3119_wpd.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0423/5addd1eff3119_wpd.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0423/5addd1eff3119_wpd.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0423/5addd1eff3119_wpd.jpg","width":"368","height":"640","tag":"","t":1524511082,"ding":"169","favourite":"11","top_cmt":null,"themes":null},{"type":"41","text":"有没有比这招更阴的了,新手能被吓出心脏病\u2026\u2026","user_id":"15262111","name":"共醉江湖","screen_name":"共醉江湖","profile_image":"http://wimg.spriteapp.cn/profile/large/2016/09/20/57e0cd620e99f_mini.jpg","created_at":"2018-03-09 21:07:01","create_time":null,"passtime":"2018-03-09 21:07:01","love":"1083","hate":"99","comment":"65","repost":"123","bookmark":"118","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0306/27294836_116.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"http://wvideo.spriteapp.cn/video/2018/0306/914daf80-2145-11e8-82e6-1866daeb0df1cutblack_wpd.mp4","videotime":42,"original_pid":"0","cache_version":2,"playcount":"108233","playfcount":"29868","cai":"99","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0306/27294836_116.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0306/27294836_116.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0306/27294836_116.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0306/27294836_116.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0306/27294836_116.jpg","width":"514","height":"480","tag":"","t":1520600821,"ding":"1083","favourite":"118","top_cmt":null,"themes":null},{"type":"41","text":"找对象","user_id":"20557625","name":"强少-精彩视频gif动图","screen_name":"强少-精彩视频gif动图","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/07/09/5961fd7c0b115_mini.jpg","created_at":"2018-02-28 19:56:01","create_time":null,"passtime":"2018-02-28 19:56:01","love":"1358","hate":"117","comment":"349","repost":"312","bookmark":"83","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0227/5a9520909ea58__b.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"55163","theme_name":"主版块","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2018/0227/5a952090b0972_wpd.mp4","videotime":14,"original_pid":"0","cache_version":2,"playcount":"107647","playfcount":"20933","cai":"117","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0227/5a9520909ea58__b.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0227/5a9520909ea58__b.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0227/5a9520909ea58__b.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0227/5a9520909ea58__b.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0227/5a9520909ea58__b.jpg","width":"540","height":"960","tag":"","t":1519818961,"ding":"1358","favourite":"83","top_cmt":null,"themes":null},{"type":"41","text":"陕西大哥吐槽现在年轻人的花钱,说的太对啦","user_id":"21356219","name":"五星红旗_","screen_name":"五星红旗_","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/09/21/59c3ac21d1081_mini.jpg","created_at":"2017-09-29 08:36:02","create_time":null,"passtime":"2017-09-29 08:36:02","love":"1954","hate":"83","comment":"138","repost":"466","bookmark":"258","bimageuri":"http://wimg.spriteapp.cn/picture/2017/0927/59cb287896845cutblack_wpd.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58191","theme_name":"搞笑视频","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2017/0927/59cb287896845cutblack_wpd.mp4","videotime":409,"original_pid":"0","cache_version":2,"playcount":"54093","playfcount":"6498","cai":"83","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2017/0927/59cb287896845cutblack_wpd.jpg","image2":"http://wimg.spriteapp.cn/picture/2017/0927/59cb287896845cutblack_wpd.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2017/0927/59cb287896845cutblack_wpd.jpg","image_small":"http://wimg.spriteapp.cn/picture/2017/0927/59cb287896845cutblack_wpd.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2017/0927/59cb287896845cutblack_wpd.jpg","width":"450","height":"272","tag":"","t":1506645362,"ding":"1954","favourite":"258","top_cmt":null,"themes":null},{"type":"41","text":"男子酒后跟老婆抱怨,不料说漏嘴爆出别人家老婆床上秘密!","user_id":"14636251","name":"小V史俊飞","screen_name":"小V史俊飞","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/10/05/59d5eff6639d7_mini.jpg","created_at":"2018-04-09 20:20:01","create_time":null,"passtime":"2018-04-09 20:20:01","love":"123","hate":"15","comment":"11","repost":"6","bookmark":"1","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0322/5ab329492e918_wpd.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58191","theme_name":"搞笑视频","theme_type":"1","videouri":"http://dvideo.spriteapp.cn/video/2018/0322/5ab329492e918_wpd.mp4","videotime":66,"original_pid":"0","cache_version":2,"playcount":"9115","playfcount":"808","cai":"15","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0322/5ab329492e918_wpd.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0322/5ab329492e918_wpd.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0322/5ab329492e918_wpd.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0322/5ab329492e918_wpd.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0322/5ab329492e918_wpd.jpg","width":"1066","height":"600","tag":"","t":1523276401,"ding":"123","favourite":"1","top_cmt":null,"themes":null},{"type":"41","text":"传说中的超认真黑暗料理,传说可以美容养颜","user_id":"20730250","name":"陌路囿妳","screen_name":"陌路囿妳","profile_image":"http://wimg.spriteapp.cn/profile/20170508151509.jpg","created_at":"2018-04-20 03:23:02","create_time":null,"passtime":"2018-04-20 03:23:02","love":"117","hate":"6","comment":"20","repost":"11","bookmark":"4","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0419/4014930e43aa11e8a1ae842b2b4c75ab_wpd.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"http://wvideo.spriteapp.cn/video/2018/0419/4014930e43aa11e8a1ae842b2b4c75ab_wpd.mp4","videotime":42,"original_pid":"0","cache_version":2,"playcount":"1723","playfcount":"420","cai":"6","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0419/4014930e43aa11e8a1ae842b2b4c75ab_wpd.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0419/4014930e43aa11e8a1ae842b2b4c75ab_wpd.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0419/4014930e43aa11e8a1ae842b2b4c75ab_wpd.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0419/4014930e43aa11e8a1ae842b2b4c75ab_wpd.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0419/4014930e43aa11e8a1ae842b2b4c75ab_wpd.jpg","width":"960","height":"540","tag":"","t":1524165782,"ding":"117","favourite":"4","top_cmt":null,"themes":null},{"type":"41","text":"保险公司的套路,一听分析 你就懂了","user_id":"17739051","name":"老梁观世界","screen_name":"老梁观世界","profile_image":"http://img.spriteapp.cn/profile/20160310113442.jpg","created_at":"2018-04-24 15:19:02","create_time":null,"passtime":"2018-04-24 15:19:02","love":"318","hate":"12","comment":"81","repost":"56","bookmark":"29","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0421/27667165_471.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"http://wvideo.spriteapp.cn/video/2018/0421/39b227d0-44f2-11e8-9616-1866daeb0df1_wpd.mp4","videotime":75,"original_pid":"0","cache_version":2,"playcount":"12453","playfcount":"2364","cai":"12","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0421/27667165_471.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0421/27667165_471.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0421/27667165_471.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0421/27667165_471.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0421/27667165_471.jpg","width":"540","height":"360","tag":"","t":1524554342,"ding":"318","favourite":"29","top_cmt":null,"themes":null},{"type":"41","text":"用二胡演奏黄昏,真是高手","user_id":"10431163","name":"段子梁非凡","screen_name":"段子梁非凡","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/04/15/5ad233fe929f0_mini.jpg","created_at":"2018-04-21 21:45:02","create_time":null,"passtime":"2018-04-21 21:45:02","love":"830","hate":"19","comment":"205","repost":"49","bookmark":"124","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0419/27643162_868.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"22871","theme_name":"音乐汇","theme_type":"1","videouri":"http://dvideo.spriteapp.cn/video/2018/0419/5ad881d1f3a1d_wpd.mp4","videotime":289,"original_pid":"0","cache_version":2,"playcount":"19844","playfcount":"356","cai":"19","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0419/27643162_868.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0419/27643162_868.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0419/27643162_868.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0419/27643162_868.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0419/27643162_868.jpg","width":"854","height":"480","tag":"","t":1524318302,"ding":"830","favourite":"124","top_cmt":null,"themes":null},{"type":"41","text":"吃鸡游戏还能结婚了??感觉除了吃鸡,你们什么都会......我们玩的恐怕不是同一个游戏","user_id":"20730222","name":"廖馨玥","screen_name":"廖馨玥","profile_image":"http://wimg.spriteapp.cn/profile/20170508150338.jpg","created_at":"2018-04-20 13:56:01","create_time":null,"passtime":"2018-04-20 13:56:01","love":"741","hate":"28","comment":"288","repost":"122","bookmark":"61","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0419/27639364_799.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"0","theme_name":"","theme_type":"0","videouri":"http://wvideo.spriteapp.cn/video/2018/0419/5fd7c36a439f11e8a1ae842b2b4c75ab_wpd.mp4","videotime":34,"original_pid":"0","cache_version":2,"playcount":"33728","playfcount":"7848","cai":"28","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0419/27639364_799.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0419/27639364_799.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0419/27639364_799.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0419/27639364_799.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0419/27639364_799.jpg","width":"480","height":"640","tag":"","t":1524203761,"ding":"741","favourite":"61","top_cmt":null,"themes":null},{"type":"41","text":"广场舞男占领广场,穿白裤子那个就属你最骚气","user_id":"22001742","name":"黑逃","screen_name":"黑逃","profile_image":"http://wimg.spriteapp.cn/profile/large/2018/04/14/5ad1ec167a7a0_mini.jpg","created_at":"2018-04-27 21:33:01","create_time":null,"passtime":"2018-04-27 21:33:01","love":"665","hate":"26","comment":"97","repost":"48","bookmark":"60","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0425/5adfbbc07736a__b.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"58191","theme_name":"搞笑视频","theme_type":"1","videouri":"http://dvideo.spriteapp.cn/video/2018/0425/5adfbbc08f750_wpd.mp4","videotime":74,"original_pid":"0","cache_version":2,"playcount":"24717","playfcount":"1315","cai":"26","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0425/5adfbbc07736a__b.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0425/5adfbbc07736a__b.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0425/5adfbbc07736a__b.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0425/5adfbbc07736a__b.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0425/5adfbbc07736a__b.jpg","width":"368","height":"640","tag":"","t":1524835981,"ding":"665","favourite":"60","top_cmt":null,"themes":null},{"type":"41","text":"【秀恩爱系列】吃了这块鸡,来世还做情侣","user_id":"14655668","name":"坏才刘科学","screen_name":"坏才刘科学","profile_image":"http://wimg.spriteapp.cn/profile/large/2016/05/06/572c4cd5790bd_mini.jpg","created_at":"2018-04-20 10:14:01","create_time":null,"passtime":"2018-04-20 10:14:01","love":"242","hate":"17","comment":"100","repost":"29","bookmark":"11","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0419/27633741_572.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"55163","theme_name":"主版块","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2018/0419/5ad7e792e7655_wpd.mp4","videotime":79,"original_pid":"0","cache_version":2,"playcount":"10249","playfcount":"482","cai":"17","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0419/27633741_572.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0419/27633741_572.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0419/27633741_572.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0419/27633741_572.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0419/27633741_572.jpg","width":"1066","height":"600","tag":"","t":1524190441,"ding":"242","favourite":"11","top_cmt":null,"themes":null},{"type":"41","text":"这小短片拍的比有些剧不要强太多!","user_id":"18380255","name":"敏智的选择","screen_name":"敏智的选择","profile_image":"http://wimg.spriteapp.cn/profile/large/2017/07/11/59645b78871e2_mini.jpg","created_at":"2018-02-28 13:00:02","create_time":null,"passtime":"2018-02-28 13:00:02","love":"2320","hate":"78","comment":"155","repost":"432","bookmark":"286","bimageuri":"http://wimg.spriteapp.cn/picture/2018/0227/27271887_377.jpg","voiceuri":null,"voicetime":null,"voicelength":null,"status":"4","theme_id":"55163","theme_name":"主版块","theme_type":"1","videouri":"http://wvideo.spriteapp.cn/video/2018/0227/ff459c38-1bc7-11e8-a12f-90b11c479401_wpd.mp4","videotime":109,"original_pid":"0","cache_version":2,"playcount":"94067","playfcount":"11943","cai":"78","weixin_url":null,"image1":"http://wimg.spriteapp.cn/picture/2018/0227/27271887_377.jpg","image2":"http://wimg.spriteapp.cn/picture/2018/0227/27271887_377.jpg","is_gif":false,"image0":"http://wimg.spriteapp.cn/picture/2018/0227/27271887_377.jpg","image_small":"http://wimg.spriteapp.cn/picture/2018/0227/27271887_377.jpg","cdn_img":"http://wimg.spriteapp.cn/picture/2018/0227/27271887_377.jpg","width":"360","height":"636","tag":"","t":1519794002,"ding":"2320","favourite":"286","top_cmt":null,"themes":null}]
     */

    private int code;
    private String msg;
    private List<DataBean> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * type : 41
         * text : 郭阳郭亮小品《昨天今天明天》,哈哈哈哈哈哈哈这俩兄弟光站那儿我就想笑
         * user_id : 20746583
         * name : 紫尛少年
         * screen_name : 紫尛少年
         * profile_image : http://wimg.spriteapp.cn/profile/20170512102523.jpg
         * created_at : 2018-04-19 17:33:01
         * create_time : null
         * passtime : 2018-04-19 17:33:01
         * love : 160
         * hate : 9
         * comment : 14
         * repost : 14
         * bookmark : 24
         * bimageuri : http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg
         * voiceuri : null
         * voicetime : null
         * voicelength : null
         * status : 4
         * theme_id : 0
         * theme_name :
         * theme_type : 0
         * videouri : http://wvideo.spriteapp.cn/video/2018/0418/fbf9a05242d111e8863f842b2b4c75ab_wpd.mp4
         * videotime : 430
         * original_pid : 0
         * cache_version : 2
         * playcount : 4632
         * playfcount : 604
         * cai : 9
         * weixin_url : null
         * image1 : http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg
         * image2 : http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg
         * is_gif : false
         * image0 : http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg
         * image_small : http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg
         * cdn_img : http://wimg.spriteapp.cn/picture/2018/0418/27621757_529.jpg
         * width : 854
         * height : 480
         * tag :
         * t : 1524130381
         * ding : 160
         * favourite : 24
         * top_cmt : null
         * themes : null
         */

        private String type;
        private String text;
        private String user_id;
        private String name;
        private String screen_name;
        private String profile_image;
        private String created_at;
        private Object create_time;
        private String passtime;
        private String love;
        private String hate;
        private String comment;
        private String repost;
        private String bookmark;
        private String bimageuri;
        private Object voiceuri;
        private Object voicetime;
        private Object voicelength;
        private String status;
        private String theme_id;
        private String theme_name;
        private String theme_type;
        private String videouri;
        private int videotime;
        private String original_pid;
        private int cache_version;
        private String playcount;
        private String playfcount;
        private String cai;
        private Object weixin_url;
        private String image1;
        private String image2;
        private boolean is_gif;
        private String image0;
        private String image_small;
        private String cdn_img;
        private String width;
        private String height;
        private String tag;
        private int t;
        private String ding;
        private String favourite;
        private Object top_cmt;
        private Object themes;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public String getUser_id() {
            return user_id;
        }

        public void setUser_id(String user_id) {
            this.user_id = user_id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getScreen_name() {
            return screen_name;
        }

        public void setScreen_name(String screen_name) {
            this.screen_name = screen_name;
        }

        public String getProfile_image() {
            return profile_image;
        }

        public void setProfile_image(String profile_image) {
            this.profile_image = profile_image;
        }

        public String getCreated_at() {
            return created_at;
        }

        public void setCreated_at(String created_at) {
            this.created_at = created_at;
        }

        public Object getCreate_time() {
            return create_time;
        }

        public void setCreate_time(Object create_time) {
            this.create_time = create_time;
        }

        public String getPasstime() {
            return passtime;
        }

        public void setPasstime(String passtime) {
            this.passtime = passtime;
        }

        public String getLove() {
            return love;
        }

        public void setLove(String love) {
            this.love = love;
        }

        public String getHate() {
            return hate;
        }

        public void setHate(String hate) {
            this.hate = hate;
        }

        public String getComment() {
            return comment;
        }

        public void setComment(String comment) {
            this.comment = comment;
        }

        public String getRepost() {
            return repost;
        }

        public void setRepost(String repost) {
            this.repost = repost;
        }

        public String getBookmark() {
            return bookmark;
        }

        public void setBookmark(String bookmark) {
            this.bookmark = bookmark;
        }

        public String getBimageuri() {
            return bimageuri;
        }

        public void setBimageuri(String bimageuri) {
            this.bimageuri = bimageuri;
        }

        public Object getVoiceuri() {
            return voiceuri;
        }

        public void setVoiceuri(Object voiceuri) {
            this.voiceuri = voiceuri;
        }

        public Object getVoicetime() {
            return voicetime;
        }

        public void setVoicetime(Object voicetime) {
            this.voicetime = voicetime;
        }

        public Object getVoicelength() {
            return voicelength;
        }

        public void setVoicelength(Object voicelength) {
            this.voicelength = voicelength;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getTheme_id() {
            return theme_id;
        }

        public void setTheme_id(String theme_id) {
            this.theme_id = theme_id;
        }

        public String getTheme_name() {
            return theme_name;
        }

        public void setTheme_name(String theme_name) {
            this.theme_name = theme_name;
        }

        public String getTheme_type() {
            return theme_type;
        }

        public void setTheme_type(String theme_type) {
            this.theme_type = theme_type;
        }

        public String getVideouri() {
            return videouri;
        }

        public void setVideouri(String videouri) {
            this.videouri = videouri;
        }

        public int getVideotime() {
            return videotime;
        }

        public void setVideotime(int videotime) {
            this.videotime = videotime;
        }

        public String getOriginal_pid() {
            return original_pid;
        }

        public void setOriginal_pid(String original_pid) {
            this.original_pid = original_pid;
        }

        public int getCache_version() {
            return cache_version;
        }

        public void setCache_version(int cache_version) {
            this.cache_version = cache_version;
        }

        public String getPlaycount() {
            return playcount;
        }

        public void setPlaycount(String playcount) {
            this.playcount = playcount;
        }

        public String getPlayfcount() {
            return playfcount;
        }

        public void setPlayfcount(String playfcount) {
            this.playfcount = playfcount;
        }

        public String getCai() {
            return cai;
        }

        public void setCai(String cai) {
            this.cai = cai;
        }

        public Object getWeixin_url() {
            return weixin_url;
        }

        public void setWeixin_url(Object weixin_url) {
            this.weixin_url = weixin_url;
        }

        public String getImage1() {
            return image1;
        }

        public void setImage1(String image1) {
            this.image1 = image1;
        }

        public String getImage2() {
            return image2;
        }

        public void setImage2(String image2) {
            this.image2 = image2;
        }

        public boolean isIs_gif() {
            return is_gif;
        }

        public void setIs_gif(boolean is_gif) {
            this.is_gif = is_gif;
        }

        public String getImage0() {
            return image0;
        }

        public void setImage0(String image0) {
            this.image0 = image0;
        }

        public String getImage_small() {
            return image_small;
        }

        public void setImage_small(String image_small) {
            this.image_small = image_small;
        }

        public String getCdn_img() {
            return cdn_img;
        }

        public void setCdn_img(String cdn_img) {
            this.cdn_img = cdn_img;
        }

        public String getWidth() {
            return width;
        }

        public void setWidth(String width) {
            this.width = width;
        }

        public String getHeight() {
            return height;
        }

        public void setHeight(String height) {
            this.height = height;
        }

        public String getTag() {
            return tag;
        }

        public void setTag(String tag) {
            this.tag = tag;
        }

        public int getT() {
            return t;
        }

        public void setT(int t) {
            this.t = t;
        }

        public String getDing() {
            return ding;
        }

        public void setDing(String ding) {
            this.ding = ding;
        }

        public String getFavourite() {
            return favourite;
        }

        public void setFavourite(String favourite) {
            this.favourite = favourite;
        }

        public Object getTop_cmt() {
            return top_cmt;
        }

        public void setTop_cmt(Object top_cmt) {
            this.top_cmt = top_cmt;
        }

        public Object getThemes() {
            return themes;
        }

        public void setThemes(Object themes) {
            this.themes = themes;
        }
    }
}
 
 

component

HttpComponent

package com.example.week2demo.component;

import com.example.week2demo.module.HttpModule;
import com.example.week2demo.ui.fragment.ImgFragmet;
import com.example.week2demo.ui.fragment.VideoFragment;

import dagger.Component;

@Component(modules = HttpModule.class)
public interface HttpComponent {
    void inject(ImgFragmet imgFragmet);

    void inject(VideoFragment videoFragment);
}
 
 

module

HttpModule

package com.example.week2demo.module;

import com.example.week2demo.net.WeekApi;
import com.example.week2demo.net.WeekApiService;

import java.util.concurrent.TimeUnit;

import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

@Module
public class HttpModule {
    @Provides
    OkHttpClient.Builder provideOkHttpClientBuilder() {
        HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
        loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        return new OkHttpClient.Builder()
                .addInterceptor(loggingInterceptor)
                .writeTimeout(20, TimeUnit.SECONDS)
                .readTimeout(20, TimeUnit.SECONDS)
                .connectTimeout(10, TimeUnit.SECONDS);
    }

    @Provides
    WeekApi provideWeekApi(OkHttpClient.Builder builder) {
        WeekApiService weekApiService = new Retrofit.Builder()
                .baseUrl("https://www.apiopen.top/")
                .client(builder.build())
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .build()
                .create(WeekApiService.class);
        return WeekApi.getWeekApi(weekApiService);
    }
}
 
 

net

WeekApi

package com.example.week2demo.net;

import com.example.week2demo.bean.ImgBean;
import com.example.week2demo.bean.VideoBean;

import io.reactivex.Observable;


public class WeekApi {
    private static WeekApi weekApi;
    private WeekApiService weekApiService;

    public WeekApi(WeekApiService weekApiService) {
        this.weekApiService = weekApiService;
    }

    public static WeekApi getWeekApi(WeekApiService weekApiService) {
        if (weekApi == null) {
            weekApi = new WeekApi(weekApiService);
        }
        return weekApi;
    }

    public Observable<ImgBean> getImage() {
        return weekApiService.getImage();
    }

    public Observable<VideoBean> getVideo() {
        return weekApiService.getVideo();
    }
}
 
 

WeekApiService

package com.example.week2demo.net;

import com.example.week2demo.bean.ImgBean;
import com.example.week2demo.bean.VideoBean;

import io.reactivex.Observable;
import retrofit2.http.GET;

public interface WeekApiService {

    @GET("satinApi?type=3&page=1")
    Observable<ImgBean> getImage();

    @GET("satinApi?type=4&page=1")
    Observable<VideoBean> getVideo();
}
 
 

ui

adapter

ImgAdapter

package com.example.week2demo.ui.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.week2demo.R;
import com.example.week2demo.bean.ImgBean;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.backends.pipeline.PipelineDraweeController;
import com.facebook.drawee.view.SimpleDraweeView;

import java.util.List;

public class ImgAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    private Context context;
    private List<ImgBean.DataBean> data;
    private LayoutInflater inflater;

    public ImgAdapter(Context context, List<ImgBean.DataBean> data) {
        this.context = context;
        this.data = data;
        inflater = LayoutInflater.from(context);
    }

    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.img_item, parent, false);
        return new ImgViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
        ImgViewHolder imgViewHolder = (ImgViewHolder) holder;
        ImgBean.DataBean dataBean = data.get(position);
        imgViewHolder.imgtou1.setImageURI(dataBean.getProfile_image());
        imgViewHolder.text4.setText(dataBean.getName());
        imgViewHolder.text3.setText(dataBean.getText());
        if (dataBean.isIs_gif()) {
            PipelineDraweeController controller =
                    (PipelineDraweeController) Fresco.newDraweeControllerBuilder()
                            .setUri(dataBean.getImage0())
                            .setAutoPlayAnimations(true) //自动播放gif动画
                            .build();
            imgViewHolder.img.setController(controller);
        } else {
            imgViewHolder.img.setImageURI(dataBean.getImage0());
        }
    }

    @Override
    public int getItemCount() {
        return data.size();
    }

    class ImgViewHolder extends RecyclerView.ViewHolder {

        private final SimpleDraweeView imgtou1;
        private final TextView text4;
        private final TextView text3;
        private final SimpleDraweeView img;

        public ImgViewHolder(View itemView) {
            super(itemView);
            imgtou1 = itemView.findViewById(R.id.imgtou1);
            text4 = itemView.findViewById(R.id.text4);
            text3 = itemView.findViewById(R.id.text3);
            img = itemView.findViewById(R.id.img);
        }
    }

    public void setData(List<ImgBean.DataBean> list){
        if (data!=null){
            data.clear();
            data.addAll(list);
            notifyDataSetChanged();
        }
    }
}

TabPageIndicatorAdapter

package com.example.week2demo.ui.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.week2demo.ui.fragment.ImgFragmet;
import com.example.week2demo.ui.fragment.VideoFragment;

public class TabPageIndicatorAdapter extends FragmentPagerAdapter {
    /**
     * Tab标题
     */
    private static final String[] TITLE = new String[]{"图片", "视频", "另一面", "女人",
            "财经", "数码", "情感", "科技"};

    public TabPageIndicatorAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        if (position % 2 == 0) {
            fragment = new ImgFragmet();
        } else {
            fragment = new VideoFragment();
        }


        return fragment;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return TITLE[position % TITLE.length];
    }

    @Override
    public int getCount() {
        return TITLE.length;
    }
}
 
 

VideoAdapter

package com.example.week2demo.ui.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.VideoView;

import com.example.week2demo.R;
import com.example.week2demo.bean.VideoBean;
import com.facebook.drawee.view.SimpleDraweeView;

import java.util.List;

public class VideoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    private Context context;
    private List<VideoBean.DataBean> data;
    private LayoutInflater inflater;

    public VideoAdapter(Context context, List<VideoBean.DataBean> data) {
        this.context = context;
        this.data = data;
        inflater = LayoutInflater.from(context);
    }

    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.vedio_item, parent, false);
        return new VideoViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
        VideoViewHolder videoViewHolder = (VideoViewHolder) holder;
        VideoBean.DataBean dataBean = data.get(position);
        videoViewHolder.imgtou.setImageURI(dataBean.getProfile_image());
        videoViewHolder.text1.setText(dataBean.getText());
        videoViewHolder.text2.setText(dataBean.getName());
        videoViewHolder.videoView.setVideoPath(dataBean.getVideouri());
        videoViewHolder.videoView.start();

    }

    @Override
    public int getItemCount() {
        return data.size();
    }

    class VideoViewHolder extends RecyclerView.ViewHolder {

        private final SimpleDraweeView imgtou;
        private final TextView text2;
        private final TextView text1;
        private final VideoView videoView;

        public VideoViewHolder(View itemView) {
            super(itemView);
            imgtou = itemView.findViewById(R.id.imgtou);
            text2 = itemView.findViewById(R.id.text2);
            text1 = itemView.findViewById(R.id.text1);
            videoView = itemView.findViewById(R.id.surface_view);
        }
    }

    public void setData(List<VideoBean.DataBean> list) {
        if (data != null) {
            data.clear();
            data.addAll(list);
            notifyDataSetChanged();
        }
    }
}
 
 

base

BaseContract

package com.example.week2demo.ui.base;

public interface BaseContract {
    interface BasePresenter<T extends BaseView> {
        void attachView(T view);

        void detachView();

    }

    interface BaseView {
        void showLoading();
    }
}
 
 

BaseFragment

package com.example.week2demo.ui.base;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.week2demo.ui.inter.IBase;

import javax.inject.Inject;

public abstract class BaseFragment<T extends BaseContract.BasePresenter> extends Fragment implements IBase,
        BaseContract.BaseView {

    @Inject
    protected T mPresenter;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle
            savedInstanceState) {
        inject();
        View view = inflater.inflate(getContentLayout(), null);
        initView(view);
        if (mPresenter != null) {
            mPresenter.attachView(this);
        }
        return view;

    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mPresenter != null) {
            mPresenter.detachView();
        }
    }

    @Override
    public void showLoading() {

    }
}
 
 

BasePresenter

package com.example.week2demo.ui.base;

public class BasePresenter<T extends BaseContract.BaseView> implements BaseContract.BasePresenter<T> {

    protected T mView;

    @Override
    public void attachView(T view) {
        if (view != null) {
            this.mView = view;
        }
    }

    @Override
    public void detachView() {
        if (mView != null) {
            mView = null;
        }
    }
}
 
 

contract

WeekContract

package com.example.week2demo.ui.contract;

import com.example.week2demo.bean.ImgBean;
import com.example.week2demo.bean.VideoBean;
import com.example.week2demo.ui.base.BaseContract;

import java.util.List;

public interface WeekContract {
    interface View extends BaseContract.BaseView {
        void imgSuccess(List<ImgBean.DataBean> data);

        void videoSuccess(List<VideoBean.DataBean> data);
    }

    interface Presenter extends BaseContract.BasePresenter<View> {
        void getImage();
        void getVideo();
    }
}
 
 

fragment

ImgFragmet

package com.example.week2demo.ui.fragment;

import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.example.week2demo.R;
import com.example.week2demo.bean.ImgBean;
import com.example.week2demo.bean.VideoBean;
import com.example.week2demo.component.DaggerHttpComponent;
import com.example.week2demo.ui.adapter.ImgAdapter;
import com.example.week2demo.ui.base.BaseFragment;
import com.example.week2demo.ui.contract.WeekContract;
import com.example.week2demo.ui.presenter.WeekPresenter;

import java.util.ArrayList;
import java.util.List;

public class ImgFragmet extends BaseFragment<WeekPresenter> implements WeekContract.View {
    private List<ImgBean.DataBean> data = new ArrayList<>();
    private ImgAdapter imgAdapter;

    @Override
    public int getContentLayout() {
        return R.layout.fragment_img;
    }

    @Override
    public void inject() {
        DaggerHttpComponent.builder()
                .build()
                .inject(this);
    }

    @Override
    public void initView(View view) {
        RecyclerView rv = view.findViewById(R.id.rv);
        //设置布局管理器
        rv.setLayoutManager(new LinearLayoutManager(getContext()));
        //加分割线
        rv.addItemDecoration(new DividerItemDecoration(getContext(),RecyclerView.VERTICAL));
        //设置适配器
        imgAdapter = new ImgAdapter(getContext(), data);
        rv.setAdapter(imgAdapter);

        //先去请求数据
        mPresenter.getImage();

    }

    @Override
    public void imgSuccess(List<ImgBean.DataBean> data) {
        if (imgAdapter!=null){
            imgAdapter.setData(data);
        }
    }

    @Override
    public void videoSuccess(List<VideoBean.DataBean> data) {

    }
}
 
 

VideoFragment

package com.example.week2demo.ui.fragment;

import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.example.week2demo.R;
import com.example.week2demo.bean.ImgBean;
import com.example.week2demo.bean.VideoBean;
import com.example.week2demo.component.DaggerHttpComponent;
import com.example.week2demo.ui.adapter.VideoAdapter;
import com.example.week2demo.ui.base.BaseFragment;
import com.example.week2demo.ui.contract.WeekContract;
import com.example.week2demo.ui.presenter.WeekPresenter;

import java.util.ArrayList;
import java.util.List;

public class VideoFragment extends BaseFragment<WeekPresenter> implements WeekContract.View{
    private List<VideoBean.DataBean> data = new ArrayList<>();
    private VideoAdapter videoAdapter;

    @Override
    public void imgSuccess(List<ImgBean.DataBean> data) {

    }



    @Override
    public int getContentLayout() {
        return R.layout.fragment_video;
    }

    @Override
    public void inject() {
        DaggerHttpComponent.builder()
                .build()
                .inject(this);
    }

    @Override
    public void initView(View view) {
       RecyclerView rv=  view.findViewById(R.id.rv);
        //设置布局管理器
        rv.setLayoutManager(new LinearLayoutManager(getContext()));
        //加分割线
        rv.addItemDecoration(new DividerItemDecoration(getContext(),RecyclerView.VERTICAL));
        //设置适配器
        videoAdapter = new VideoAdapter(getContext(), data);
        rv.setAdapter(videoAdapter);

        //请求数据
        mPresenter.getVideo();
    }

    @Override
    public void videoSuccess(List<VideoBean.DataBean> data) {
        if (videoAdapter!=null){
            videoAdapter.setData(data);
        }
    }
}
 
 

inter

IBase

package com.example.week2demo.ui.inter;

import android.view.View;

public interface IBase {
    int getContentLayout();

    void inject();

    void initView(View view);
}
 
 

presenter

WeekPresenter

package com.example.week2demo.ui.presenter;

import com.example.week2demo.bean.ImgBean;
import com.example.week2demo.bean.VideoBean;
import com.example.week2demo.net.WeekApi;
import com.example.week2demo.ui.base.BasePresenter;
import com.example.week2demo.ui.contract.WeekContract;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;

public class WeekPresenter extends BasePresenter<WeekContract.View> implements WeekContract.Presenter {
    private WeekApi weekApi;

    @Inject
    public WeekPresenter(WeekApi weekApi) {
        this.weekApi = weekApi;
    }

    @Override
    public void getImage() {
        weekApi.getImage()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .map(new Function<ImgBean, List<ImgBean.DataBean>>() {

                    @Override
                    public List<ImgBean.DataBean> apply(ImgBean imgBean) throws Exception {
                        return imgBean.getData();
                    }
                }).subscribe(new Consumer<List<ImgBean.DataBean>>() {
            @Override
            public void accept(List<ImgBean.DataBean> dataBeans) throws Exception {
                if (mView != null) {
                    mView.imgSuccess(dataBeans);
                }
            }
        });
    }

    @Override
    public void getVideo() {
        weekApi.getVideo()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .map(new Function<VideoBean, List<VideoBean.DataBean>>() {
                    @Override
                    public List<VideoBean.DataBean> apply(VideoBean videoBean) throws Exception {
                        return videoBean.getData();
                    }
                }).subscribe(new Consumer<List<VideoBean.DataBean>>() {
            @Override
            public void accept(List<VideoBean.DataBean> dataBeans) throws Exception {
                if (mView != null) {
                    mView.videoSuccess(dataBeans);
                }
            }
        });
    }
}
 
 

MainActivity

package com.example.week2demo;

import android.os.Bundle;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;

import com.example.week2demo.ui.adapter.TabPageIndicatorAdapter;
import com.viewpagerindicator.TabPageIndicator;

public class MainActivity extends AppCompatActivity {

    private TabPageIndicator mTabPageIndicator;
    private ViewPager mVp;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        FragmentPagerAdapter adapter = new TabPageIndicatorAdapter(getSupportFragmentManager());
        mVp.setAdapter(adapter);
        mTabPageIndicator.setViewPager(mVp);

    }

    private void initView() {
        mTabPageIndicator = (TabPageIndicator) findViewById(R.id.titles);
        mVp = (ViewPager) findViewById(R.id.vp);
    }


}
 
 


配置library



https://github.com/githubzhangshaohang120/shipin  

猜你喜欢

转载自blog.csdn.net/zhang1223665986/article/details/80423886