zengjiebin лет назад: 7
Родитель
Сommit
b77b9a0645
28 измененных файлов с 407 добавлено и 392 удалено
  1. 3 3
      app/build.gradle
  2. 0 0
      app/libs/appstoreutils-201810101432.aar
  3. BIN
      app/libs/mdsdk-201810101155.jar
  4. BIN
      app/libs/mdsdk.jar
  5. 3 3
      app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java
  6. 14 14
      app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java
  7. 4 1
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  8. 16 11
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMiDong.java
  9. 48 97
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment.java
  10. 93 164
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment2.java
  11. 6 11
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtDownloadWelfareList.java
  12. 17 16
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFindChild.java
  13. 1 6
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGiftCenter.java
  14. 0 7
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMiDong.java
  15. 94 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMiDongWeChatTaskList.java
  16. 1 5
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMsgCenter.java
  17. 1 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMsgReply.java
  18. 1 5
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyDownloadWelfareList.java
  19. 1 6
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyGift.java
  20. 1 4
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSearchApp.java
  21. 1 1
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSignCardRecord.java
  22. 1 1
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWatchFocus.java
  23. 1 5
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareUseRecord.java
  24. 0 24
      app/src/main/res/layout/act_midong_layout.xml
  25. 3 5
      app/src/main/res/layout/adp_midong_item.xml
  26. 2 0
      app/src/main/res/layout/common_tab_vp.xml
  27. 94 0
      app/src/main/res/layout/item_midong_wechat.xml
  28. 1 1
      app/src/main/res/layout/net_empty_fresh_list_more.xml

+ 3 - 3
app/build.gradle

@@ -153,7 +153,7 @@ dependencies {
 
     //其中latest.release指代最
 
-    //    compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
+    compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
     debugCompile('com.readystatesoftware.chuck:library:1.1.0') {
         exclude group: 'com.android.support', module: 'design'
     }
@@ -212,7 +212,7 @@ dependencies {
     compile 'com.alibaba:fastjson:1.2.47'
 
     //添加半袋米相关
-    compile(name: 'appstoreutils', ext: 'aar')
+    compile(name: 'appstoreutils-201810101432', ext: 'aar')
     compile project(':view')
 
     //    compile(name: 'view-release', ext: 'aar')
@@ -268,7 +268,7 @@ dependencies {
     compile files('libs/BaiduLBS_Android.jar')
 
     //幂动科技
-    compile files('libs/mdsdk.jar')
+    compile files('libs/mdsdk-201810101155.jar')
     //轮播图
     compile 'com.youth.banner:banner:1.4.10'  //最新版本
     //loading

app/libs/appstoreutils.aar → app/libs/appstoreutils-201810101432.aar


BIN
app/libs/mdsdk-201810101155.jar


BIN
app/libs/mdsdk.jar


+ 3 - 3
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -21,19 +21,19 @@ public class DaoMaster extends AbstractDaoMaster {
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
+        AcceptTaskRecordDao.createTable(db, ifNotExists);
         AppdownloadBeanDao.createTable(db, ifNotExists);
         DownLoadInfoDao.createTable(db, ifNotExists);
         ProcessRecordDao.createTable(db, ifNotExists);
-        AcceptTaskRecordDao.createTable(db, ifNotExists);
         ScreenShotRecordDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
     public static void dropAllTables(Database db, boolean ifExists) {
+        AcceptTaskRecordDao.dropTable(db, ifExists);
         AppdownloadBeanDao.dropTable(db, ifExists);
         DownLoadInfoDao.dropTable(db, ifExists);
         ProcessRecordDao.dropTable(db, ifExists);
-        AcceptTaskRecordDao.dropTable(db, ifExists);
         ScreenShotRecordDao.dropTable(db, ifExists);
     }
 
@@ -53,10 +53,10 @@ public class DaoMaster extends AbstractDaoMaster {
 
     public DaoMaster(Database db) {
         super(db, SCHEMA_VERSION);
+        registerDaoClass(AcceptTaskRecordDao.class);
         registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(DownLoadInfoDao.class);
         registerDaoClass(ProcessRecordDao.class);
-        registerDaoClass(AcceptTaskRecordDao.class);
         registerDaoClass(ScreenShotRecordDao.class);
     }
 

+ 14 - 14
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -8,16 +8,16 @@ import org.greenrobot.greendao.database.Database;
 import org.greenrobot.greendao.identityscope.IdentityScopeType;
 import org.greenrobot.greendao.internal.DaoConfig;
 
+import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
 import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.greendao.download.ProcessRecord;
-import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
 
+import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
 import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
 import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
-import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
@@ -29,22 +29,25 @@ import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
  */
 public class DaoSession extends AbstractDaoSession {
 
+    private final DaoConfig acceptTaskRecordDaoConfig;
     private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig downLoadInfoDaoConfig;
     private final DaoConfig processRecordDaoConfig;
-    private final DaoConfig acceptTaskRecordDaoConfig;
     private final DaoConfig screenShotRecordDaoConfig;
 
+    private final AcceptTaskRecordDao acceptTaskRecordDao;
     private final AppdownloadBeanDao appdownloadBeanDao;
     private final DownLoadInfoDao downLoadInfoDao;
     private final ProcessRecordDao processRecordDao;
-    private final AcceptTaskRecordDao acceptTaskRecordDao;
     private final ScreenShotRecordDao screenShotRecordDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
         super(db);
 
+        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
+        acceptTaskRecordDaoConfig.initIdentityScope(type);
+
         appdownloadBeanDaoConfig = daoConfigMap.get(AppdownloadBeanDao.class).clone();
         appdownloadBeanDaoConfig.initIdentityScope(type);
 
@@ -54,33 +57,34 @@ public class DaoSession extends AbstractDaoSession {
         processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
         processRecordDaoConfig.initIdentityScope(type);
 
-        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
-        acceptTaskRecordDaoConfig.initIdentityScope(type);
-
         screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
         screenShotRecordDaoConfig.initIdentityScope(type);
 
+        acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
         appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
         processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
-        acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
         screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
 
+        registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
         registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(DownLoadInfo.class, downLoadInfoDao);
         registerDao(ProcessRecord.class, processRecordDao);
-        registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
         registerDao(ScreenShotRecord.class, screenShotRecordDao);
     }
     
     public void clear() {
+        acceptTaskRecordDaoConfig.clearIdentityScope();
         appdownloadBeanDaoConfig.clearIdentityScope();
         downLoadInfoDaoConfig.clearIdentityScope();
         processRecordDaoConfig.clearIdentityScope();
-        acceptTaskRecordDaoConfig.clearIdentityScope();
         screenShotRecordDaoConfig.clearIdentityScope();
     }
 
+    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
+        return acceptTaskRecordDao;
+    }
+
     public AppdownloadBeanDao getAppdownloadBeanDao() {
         return appdownloadBeanDao;
     }
@@ -93,10 +97,6 @@ public class DaoSession extends AbstractDaoSession {
         return processRecordDao;
     }
 
-    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
-        return acceptTaskRecordDao;
-    }
-
     public ScreenShotRecordDao getScreenShotRecordDao() {
         return screenShotRecordDao;
     }

+ 4 - 1
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -1909,7 +1909,10 @@ public class CommonUtil {
     public boolean initMiDong(Activity activity, String id) {
         if (!SheepApp.getInstance().isInitMidong() && !TextUtils.isEmpty(id)) {
             SheepApp.getInstance().setInitMidong(true);
-            AdManager.getInstance(activity).init(activity, "40", id + "");
+            String appId = "40";
+            String cUId = String.valueOf(id);
+            String appKey = "ad9a30556666207";
+            AdManager.getInstance(activity).init(activity, appId, cUId, appKey);
             return true;
         }
         return false;

+ 16 - 11
app/src/main/java/com/sheep/gamegroup/view/activity/ActMiDong.java

@@ -1,6 +1,7 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
+import android.app.Fragment;
 import android.os.Bundle;
 import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
@@ -19,8 +20,10 @@ import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter;
 import com.sheep.gamegroup.view.fragment.FgtMiDong;
+import com.sheep.gamegroup.view.fragment.FgtMiDongWeChatTaskList;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import org.afinal.simplecache.ACache;
@@ -48,7 +51,7 @@ public class ActMiDong extends BaseActivity {
 
     @Override
     protected int getLayoutId() {
-        return R.layout.act_midong_layout;
+        return R.layout.common_tab_vp;
     }
 
     @Override
@@ -71,14 +74,16 @@ public class ActMiDong extends BaseActivity {
 
     }
     private int curPosition = 0;
-    private List<FgtMiDong> fgtMiDongList = ListUtil.emptyList();
+    private List<BaseFragment> fgtMiDongList = ListUtil.emptyList();
     @Override
     public void initData() {
         mAdapter = new TitleFragmentListAdapter(getSupportFragmentManager());
         fgtMiDongList.add(FgtMiDong.newInstance(0));
         fgtMiDongList.add(FgtMiDong.newInstance(1));
+        fgtMiDongList.add(new FgtMiDongWeChatTaskList());
         mAdapter.add(fgtMiDongList.get(0), "普通任务");
         mAdapter.add(fgtMiDongList.get(1), "签到任务");
+        mAdapter.add(fgtMiDongList.get(2), "小程序任务");
         pager.setAdapter(mAdapter);
         indicator.setupWithViewPager(pager);
         pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@@ -104,25 +109,25 @@ public class ActMiDong extends BaseActivity {
             .reflex(indicator, activity);
         AdManager.getInstance(activity).setDownloadListener(new AppDownloadListener() {
             @Override
-            public void onDownloadStart(String s) {
+            public void onDownloadStart(int s) {
                 LogUtil.println("AdManager", "onDownloadStart", s);
-                ACache.get(SheepApp.getInstance()).put(String.format(Locale.CHINA, "%s%s", AdManager.class.getSimpleName(), s), "onDownloadStart");
+                ACache.get(SheepApp.getInstance()).put(String.format(Locale.CHINA, "%s%d", AdManager.class.getSimpleName(), s), "onDownloadStart");
                 EventBus.getDefault().post(BigEvent.get().setEventTypes(EventTypes.REFRESH_MING_DONG));
 
             }
 
             @Override
-            public void onDownloadFail(String id) {
+            public void onDownloadFail(int id) {
                 LogUtil.println("AdManager","onDownloadFail", id);
-                ACache.get(SheepApp.getInstance()).put(String.format(Locale.CHINA, "%s%s", AdManager.class.getSimpleName(), id), "onDownloadFail");
+                ACache.get(SheepApp.getInstance()).put(String.format(Locale.CHINA, "%s%d", AdManager.class.getSimpleName(), id), "onDownloadFail");
                 EventBus.getDefault().post(BigEvent.get().setEventTypes(EventTypes.REFRESH_MING_DONG));
 
             }
 
             @Override
-            public void onDownloadSuccess(String id) {//没有收到回调
+            public void onDownloadSuccess(int id) {//没有收到回调
                 LogUtil.println("AdManager","onDownloadSuccess", id);
-                ACache.get(SheepApp.getInstance()).put(String.format(Locale.CHINA, "%s%s", AdManager.class.getSimpleName(), id), "onDownloadSuccess");
+                ACache.get(SheepApp.getInstance()).put(String.format(Locale.CHINA, "%s%d", AdManager.class.getSimpleName(), id), "onDownloadSuccess");
                 EventBus.getDefault().post(BigEvent.get().setEventTypes(EventTypes.REFRESH_MING_DONG));
 
             }
@@ -165,9 +170,9 @@ public class ActMiDong extends BaseActivity {
     public void onEventMainThread(BigEvent event){
         switch (event.getEventTypes()){
             case REFRESH_MING_DONG:
-                FgtMiDong item = ListUtil.getItem(fgtMiDongList, curPosition);
-                if(item != null){
-                    item.refreshData();
+                BaseFragment item = ListUtil.getItem(fgtMiDongList, curPosition);
+                if(item instanceof FgtMiDong){
+                    ((FgtMiDong) item).refreshData();
                 }
                 break;
         }

+ 48 - 97
app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment.java

@@ -1,13 +1,9 @@
 package com.sheep.gamegroup.view.fragment;
 
 import android.app.Activity;
-import android.os.Bundle;
-import android.os.Handler;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.ViewGroup;
 
 import com.jcodecraeer.xrecyclerview.XRecyclerView;
 import com.sheep.gamegroup.model.api.ApiService;
@@ -22,9 +18,6 @@ import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
 
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
-
 import java.util.List;
 
 import butterknife.BindView;
@@ -36,6 +29,7 @@ import rx.schedulers.Schedulers;
 /**
  * Created by realicing on 2018/9/3.
  * realicing@sina.com
+ * 自己可以进行刷新与加载更多,使用com.jcodecraeer.xrecyclerview.XRecyclerView来实现,子类自己实现数据
  */
 public abstract class BaseListFragment<T> extends BaseFragment {
     @Override
@@ -44,21 +38,27 @@ public abstract class BaseListFragment<T> extends BaseFragment {
     }
 
     protected Activity activity;
+
     @Override
     public void onViewCreated() {
         activity = getActivity();
         initView();
         initListener();
         switch (refreshDataType()) {
-            case 0:
+            case REFRESH_ON_CREATE:
                 view_list.refresh();
-            case 1:
+            case REFRESH_ON_RESUME:
                 break;
+            case REFRESH_ON_YOURSELF:
             default:
                 notifyDataSetChanged();
                 break;
         }
     }
+
+    public static final int REFRESH_ON_CREATE = 0;
+    public static final int REFRESH_ON_RESUME = 1;
+    public static final int REFRESH_ON_YOURSELF = -1;
     @BindView(R.id.title)
     protected View title;
     @BindView(R.id.empty_view)
@@ -73,16 +73,12 @@ public abstract class BaseListFragment<T> extends BaseFragment {
     protected int per_page = DataUtil.PER_PAGE;
     private boolean loadMore;
 
-    @Subscribe
     public void initView() {
         title.setVisibility(View.GONE);
-        try {
-            EventBus.getDefault().register(this);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
     }
+
     protected View bottomLine;
+
     public void initListener() {
         view_list.setLoadingListener(new XRecyclerView.LoadingListener() {
             @Override
@@ -93,7 +89,6 @@ public abstract class BaseListFragment<T> extends BaseFragment {
             @Override
             public void onLoadMore() {
                 loadMoreData();
-
             }
         });
         bottomLine = ViewUtil.setBottomLine(view_list, getNoMoreCallBack());
@@ -102,16 +97,16 @@ public abstract class BaseListFragment<T> extends BaseFragment {
     }
 
     protected void loadMoreData() {
-        if(!loadMore){
+        if (!loadMore) {
             loadMore = true;
-            if(ListUtil.size(list) >= per_page*page){
+            if (ListUtil.size(list) >= per_page * page) {
                 page += 1;
-                initData();
-            }else {
+                initNetAndData();
+            } else {
                 view_list.setNoMore(true);
                 setNoMore(true);
             }
-        }else {
+        } else {
             view_list.loadMoreComplete();
         }
     }
@@ -121,58 +116,24 @@ public abstract class BaseListFragment<T> extends BaseFragment {
     }
 
     protected List<T> list = ListUtil.emptyList();
-    protected List<T> lastCacheList = ListUtil.emptyList();
-    //默认先获取缓存
-    protected boolean isFirstGetACache(){
-        return true;
-    }
-    public void setPerpage(int per_page){
-        this.per_page = per_page;
-    }
-    public synchronized void initData() {
-        final String urlKey = getKey(page, per_page);
-        if(isFirstGetACache()) {
-            //先尝试获取缓存数据
-            lastCacheList = DataUtil.getInstance().getCacheList(urlKey, getTClass());
-            loadList(lastCacheList);
-        }
+
+    public void initNetAndData() {
         SysAppUtil.checkNet(new Action1<Integer>() {
             @Override
             public void call(Integer result) {
-                if(result != 0){//无网络
-                    if(check_net_ll != null)
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
                         check_net_ll.setVisibility(View.VISIBLE);
                 } else {
-                    if(check_net_ll != null)
+                    if (check_net_ll != null)
                         check_net_ll.setVisibility(View.GONE);
                 }
             }
         });
-        getApi(SheepApp.getInstance().getNetComponent().getApiService())
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        lastMessage = baseMessage;
-                        boolean isNewData = DataUtil.getInstance().isNewData(urlKey);
-                        if(isNewData || !isFirstGetACache()) {
-                            if(isFirstGetACache())
-                                ListUtil.removeAll(list, lastCacheList);
-                            List<T> newList = baseMessage.getDatas(getTClass());
-                            loadList(newList);
-                        }else {
-                            notifyDataSetChanged();
-                        }
-                    }
-
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        notifyDataSetChanged();
-                    }
-                });
+        initData();
     }
-    public Action1<String> getNoMoreCallBack(){
+
+    public Action1<String> getNoMoreCallBack() {
         return null;
     }
 
@@ -180,54 +141,52 @@ public abstract class BaseListFragment<T> extends BaseFragment {
     @Override
     public void onResume() {
         super.onResume();
-        if(refreshDataType() == 1){
+        if (refreshDataType() == REFRESH_ON_RESUME) {
             view_list.refresh();
         }
     }
 
     /**
      * 在哪里初始化数据:0 onViewCreated后, 1 onResume后, -1 不初始化
+     *
      * @return
      */
     public int refreshDataType() {
-        return 0;
+        return REFRESH_ON_CREATE;
     }
-    public void clear(){
+
+    public void clear() {
         lastMessage = null;
         setNoMore(false);
         empty_view.setVisibility(View.INVISIBLE);
         list.clear();
         page = 1;
     }
-    public void refreshData(){
+
+    public void refreshData() {
         clear();
         view_list.getAdapter().notifyDataSetChanged();
-        initData();
-    }
-    protected List<T> newList;
-    protected void loadList(List<T> addList){
-        ListUtil.addAllItem(list, addList);
-        newList = addList;
-        notifyDataSetChanged();
+        initNetAndData();
     }
-    public void notifyDataSetChanged(){
-        if(view_list == null)
+
+    public void notifyDataSetChanged() {
+        if (view_list == null)
             view_list = findViewById(R.id.view_list);
-        if(empty_view == null)
+        if (empty_view == null)
             empty_view = findViewById(R.id.empty_view);
         loadMore = false;
         updateEmptyView();
-        if(page == 1){
+        if (page == 1) {
             view_list.refreshComplete();
         } else {
             view_list.loadMoreComplete();
         }
         view_list.getAdapter().notifyDataSetChanged();
         notifyData();
-        view_list.getFootView().setVisibility(view_list.getAdapter().getItemCount() == 0?View.GONE : View.VISIBLE);
+        view_list.getFootView().setVisibility(view_list.getAdapter().getItemCount() == 0 ? View.GONE : View.VISIBLE);
     }
 
-    protected void updateEmptyView(){
+    protected void updateEmptyView() {
         CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
     }
 
@@ -235,33 +194,25 @@ public abstract class BaseListFragment<T> extends BaseFragment {
     public void onDestroyView() {
         super.onDestroyView();
         // any time,when you finish your activity or fragment,call this below
-        if(view_list != null){
+        if (view_list != null) {
             view_list.destroy(); // this will totally release XR's memory
             view_list = null;
         }
-        EventBus.getDefault().unregister(this);
-    }
-    public int getDataCount() {
-        return list.size();
     }
 
-    /**
-     *
-     * @return
-     */
-    public void setNoFresh(){
-        if(view_list != null)
-            view_list.setPullRefreshEnabled(false);
-    }
 
     private boolean noMore = false;
+
     public boolean isNoMore() {
         return noMore;
     }
+
     protected abstract RecyclerView.Adapter getAdapter();
-    protected abstract String getKey(int page, int per_page);
-    protected abstract Observable<BaseMessage> getApi(ApiService apiService);
-    protected abstract Class<T> getTClass();
 
-    public abstract void notifyData();
+    //获取数据
+    public abstract void initData();
+    //刷新数据的回调,子类可以实现自己的需求
+    public void notifyData(){
+
+    }
 }

+ 93 - 164
app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment2.java

@@ -1,33 +1,23 @@
 package com.sheep.gamegroup.view.fragment;
 
 import android.app.Activity;
-import android.os.Bundle;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
-import android.util.Log;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.ViewGroup;
 
-import com.scwang.smartrefresh.layout.SmartRefreshLayout;
-import com.scwang.smartrefresh.layout.api.RefreshLayout;
-import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
-import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
+import com.jcodecraeer.xrecyclerview.XRecyclerView;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.RefreshUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
 
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
-
 import java.util.List;
 
 import butterknife.BindView;
@@ -37,139 +27,89 @@ import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 /**
- * Created by ljy on 2018/9/13.
+ * Created by realicing on 2018/9/3.
+ * realicing@sina.com
+ * 自己可以进行刷新与加载更多,使用com.jcodecraeer.xrecyclerview.XRecyclerView来实现,子类提供网络接口相关
  */
-
 public abstract class BaseListFragment2<T> extends BaseFragment {
     @Override
     public int getLayoutId() {
-        return R.layout.fgt_playgame_son_refresh_layout;
+        return R.layout.net_empty_xrecycler;
     }
 
     protected Activity activity;
+
     @Override
     public void onViewCreated() {
         activity = getActivity();
         initView();
         initListener();
         switch (refreshDataType()) {
-            case 0:
-//                view_list.refresh();
-            case 1:
+            case REFRESH_ON_CREATE:
+                view_list.refresh();
+            case REFRESH_ON_RESUME:
                 break;
+            case REFRESH_ON_YOURSELF:
             default:
                 notifyDataSetChanged();
                 break;
         }
     }
+
+    public static final int REFRESH_ON_CREATE = 0;
+    public static final int REFRESH_ON_RESUME = 1;
+    public static final int REFRESH_ON_YOURSELF = -1;
     @BindView(R.id.title)
     protected View title;
     @BindView(R.id.empty_view)
     protected View empty_view;
     @BindView(R.id.check_net_ll)
     protected View check_net_ll;
-    @BindView(R.id.refreshLayout)
-    protected SmartRefreshLayout refreshLayout;
     @BindView(R.id.view_list)
-    protected RecyclerView view_list;
+    protected XRecyclerView view_list;
 
     protected BaseMessage lastMessage;//最后一个网络获取的结果
     protected int page = 1;//页数
     protected int per_page = DataUtil.PER_PAGE;
     private boolean loadMore;
 
-    @Subscribe
     public void initView() {
         title.setVisibility(View.GONE);
-        try {
-            EventBus.getDefault().register(this);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        RefreshUtil.newInstance().publicParameterRefresh(refreshLayout, activity);
-//        refreshLayout.setEnableLoadMoreWhenContentNotFull(true);//内容不满屏幕的时候也开启加载更多
-//        refreshLayout.setFooterTriggerRate(1);
     }
+
     protected View bottomLine;
+
     public void initListener() {
-        refreshLayout.setOnRefreshListener(new OnRefreshListener() {
+        view_list.setLoadingListener(new XRecyclerView.LoadingListener() {
             @Override
-            public void onRefresh(RefreshLayout refreshlayout) {
-                refreshlayout.finishRefresh(100/*,false*/);//传入false表示刷新失败
+            public void onRefresh() {
                 refreshData();
             }
-        });
-        refreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
-            @Override
-            public void onLoadMore(final RefreshLayout refreshlayout) {
-                if(ListUtil.size(list) >= per_page*page){
-                    page += 1;
-                    initData();
-                }else {
-                    refreshlayout.finishLoadMore(100/*,false*/);//传入false表示加载失败
-                    setNoMore(true);
-                }
-
-            }
-        });
-        view_list.addOnScrollListener(new RecyclerView.OnScrollListener() {
-            boolean isSlidingToLast;
-            @Override
-            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
-                super.onScrollStateChanged(recyclerView, newState);
-
-                RecyclerView.LayoutManager layoutManager = view_list.getLayoutManager();
-
-                if(layoutManager instanceof LinearLayoutManager){
-                    LinearLayoutManager linearLayoutManager = (LinearLayoutManager) layoutManager;
-                    //获取最后一个view 位置
-                    int lastItemPosition = linearLayoutManager.findLastVisibleItemPosition();
-
-                    View childView = recyclerView.getChildAt(list.size() - 1);
-                    //底部bottom
-//                    int bottom = childView.getBottom();
-                    //正常来说RecycleView的顶部坐标应该是0,但是严格来考虑,当RecycleView设置了paddingTop时,所有子view的绘制将以paddingTop的位置为起始位置,所以实际的顶部应该是paddingTop的高度的数值.
-                    int topEdge=recyclerView.getPaddingBottom();
-
-                    //获取最后一个完全显示的item的position
-                    int lastVisibleItem = linearLayoutManager.findLastCompletelyVisibleItemPosition();
-                    int totalCount = linearLayoutManager.getItemCount();
-                    Log.e("lastvisi_item_-----", lastVisibleItem+","+totalCount);
-
-                    if(newState == RecyclerView.SCROLL_STATE_IDLE ){//滑动到了底部
-                        if(ListUtil.size(list) >= per_page*page){
-
-                            refreshLayout.autoLoadMore();
-                        }
-
-                    }
-                }
-            }
 
             @Override
-            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
-                super.onScrolled(recyclerView, dx, dy);
-                Log.e("dx-----", dx+","+dy);
-                if (dy > 0) {
-                    //大于0表示正在向下滚动
-                    isSlidingToLast = true;
-                } else {
-                    //小于等于0表示停止或向上滚动
-                    isSlidingToLast = false;
-                }
+            public void onLoadMore() {
+                loadMoreData();
 
             }
         });
-
-//        bottomLine = ViewUtil.setBottomLine(refreshLayout, getNoMoreCallBack());
-
-        LinearLayoutManager hotManager = new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.VERTICAL, false);
-        view_list.setHasFixedSize(true);
-        view_list.setNestedScrollingEnabled(false);
-        view_list.setLayoutManager(hotManager);
+        bottomLine = ViewUtil.setBottomLine(view_list, getNoMoreCallBack());
+        view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
         view_list.setAdapter(getAdapter());
+    }
 
+    protected void loadMoreData() {
+        if (!loadMore) {
+            loadMore = true;
+            if (ListUtil.size(list) >= per_page * page) {
+                page += 1;
+                initData();
+            } else {
+                view_list.setNoMore(true);
+                setNoMore(true);
+            }
+        } else {
+            view_list.loadMoreComplete();
+        }
     }
 
     public void setNoMore(boolean noMore) {
@@ -177,18 +117,16 @@ public abstract class BaseListFragment2<T> extends BaseFragment {
     }
 
     protected List<T> list = ListUtil.emptyList();
-    protected List<T> listCacheOneList = ListUtil.emptyList();
     protected List<T> lastCacheList = ListUtil.emptyList();
+
     //默认先获取缓存
-    protected boolean isFirstGetACache(){
+    protected boolean isFirstGetACache() {
         return true;
     }
-    public void setPerpage(int per_page){
-        this.per_page = per_page;
-    }
-    public synchronized void initData() {
+
+    public void initData() {
         final String urlKey = getKey(page, per_page);
-        if(isFirstGetACache()) {
+        if (isFirstGetACache()) {
             //先尝试获取缓存数据
             lastCacheList = DataUtil.getInstance().getCacheList(urlKey, getTClass());
             loadList(lastCacheList);
@@ -196,24 +134,15 @@ public abstract class BaseListFragment2<T> extends BaseFragment {
         SysAppUtil.checkNet(new Action1<Integer>() {
             @Override
             public void call(Integer result) {
-                if(result != 0){//无网络
-                    if(check_net_ll != null)
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
                         check_net_ll.setVisibility(View.VISIBLE);
                 } else {
-                    if(check_net_ll != null)
+                    if (check_net_ll != null)
                         check_net_ll.setVisibility(View.GONE);
                 }
             }
         });
-        getData(urlKey);
-    }
-
-    /**
-     * 获取数据
-     * @return
-     */
-    public void getData(final String urlKey){
-
         getApi(SheepApp.getInstance().getNetComponent().getApiService())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
@@ -222,11 +151,12 @@ public abstract class BaseListFragment2<T> extends BaseFragment {
                     public void onNext(BaseMessage baseMessage) {
                         lastMessage = baseMessage;
                         boolean isNewData = DataUtil.getInstance().isNewData(urlKey);
-                        if(isNewData || !isFirstGetACache()) {
-                            ListUtil.removeAll(list, lastCacheList);
+                        if (isNewData || !isFirstGetACache()) {
+                            if (isFirstGetACache())
+                                ListUtil.removeAll(list, lastCacheList);
                             List<T> newList = baseMessage.getDatas(getTClass());
                             loadList(newList);
-                        }else {
+                        } else {
                             notifyDataSetChanged();
                         }
                     }
@@ -237,7 +167,8 @@ public abstract class BaseListFragment2<T> extends BaseFragment {
                     }
                 });
     }
-    public Action1<String> getNoMoreCallBack(){
+
+    public Action1<String> getNoMoreCallBack() {
         return null;
     }
 
@@ -245,92 +176,90 @@ public abstract class BaseListFragment2<T> extends BaseFragment {
     @Override
     public void onResume() {
         super.onResume();
-        if(refreshDataType() == 1){
-            refreshData();
+        if (refreshDataType() == REFRESH_ON_RESUME) {
+            view_list.refresh();
         }
     }
 
     /**
      * 在哪里初始化数据:0 onViewCreated后, 1 onResume后, -1 不初始化
+     *
      * @return
      */
     public int refreshDataType() {
-        return 0;
+        return REFRESH_ON_CREATE;
     }
 
-    public void refreshData(){
+    public void clear() {
         lastMessage = null;
         setNoMore(false);
         empty_view.setVisibility(View.INVISIBLE);
         list.clear();
-        view_list.getAdapter().notifyDataSetChanged();
         page = 1;
+    }
+
+    public void refreshData() {
+        clear();
+        view_list.getAdapter().notifyDataSetChanged();
         initData();
     }
-    private void loadList(List<T> newList){
-        if(!isFirstGetACache() && page == 1)
-            list.clear();
-        ListUtil.addAll(list, newList);
+
+    protected List<T> newList;
+
+    protected void loadList(List<T> addList) {
+        ListUtil.addAllItem(list, addList);
+        newList = addList;
         notifyDataSetChanged();
     }
-    public void notifyDataSetChanged(){
-        if(refreshLayout == null || view_list == null || empty_view == null){
-            return;
-        }
-        loadMore = false;
-        if(list.isEmpty()){
-            refreshLayout.setVisibility(View.GONE);
-        }else {
 
-            refreshLayout.setVisibility(View.VISIBLE);
-        }
-        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
-        if(page == 1){
-            refreshLayout.finishRefresh(100/*,false*/);//传入false表示加载失败
+    public void notifyDataSetChanged() {
+        if (view_list == null)
+            view_list = findViewById(R.id.view_list);
+        if (empty_view == null)
+            empty_view = findViewById(R.id.empty_view);
+        loadMore = false;
+        updateEmptyView();
+        if (page == 1) {
+            view_list.refreshComplete();
         } else {
-            refreshLayout.finishLoadMore(100/*,false*/);//传入false表示加载失败
+            view_list.loadMoreComplete();
         }
         view_list.getAdapter().notifyDataSetChanged();
         notifyData();
+        view_list.getFootView().setVisibility(view_list.getAdapter().getItemCount() == 0 ? View.GONE : View.VISIBLE);
     }
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        // TODO: inflate a fragment view
-        View rootView = super.onCreateView(inflater, container, savedInstanceState);
-        return rootView;
+
+    protected void updateEmptyView() {
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
     }
 
     @Override
     public void onDestroyView() {
         super.onDestroyView();
         // any time,when you finish your activity or fragment,call this below
-        if(view_list != null){
-//            view_list.destroy(); // this will totally release XR's memory
+        if (view_list != null) {
+            view_list.destroy(); // this will totally release XR's memory
             view_list = null;
         }
-        EventBus.getDefault().unregister(this);
-    }
-    public int getDataCount() {
-        return list.size();
     }
 
-    /**
-     *
-     * @return
-     */
-    public void setNoFresh(){
-//        if(view_list != null)
-//            view_list.setPullRefreshEnabled(false);
-    }
 
     private boolean noMore = false;
+
     public boolean isNoMore() {
         return noMore;
     }
+
     protected abstract RecyclerView.Adapter getAdapter();
+
     protected abstract String getKey(int page, int per_page);
+
     protected abstract Observable<BaseMessage> getApi(ApiService apiService);
+
     protected abstract Class<T> getTClass();
 
-    public abstract void notifyData();
+    //刷新数据的回调,子类可以实现自己的需求
+    public void notifyData(){
+
+    }
 }

+ 6 - 11
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtDownloadWelfareList.java

@@ -23,12 +23,17 @@ import rx.functions.Action1;
  * Created by realicing on 2018/9/3.
  * realicing@sina.com
  */
-public class FgtDownloadWelfareList extends BaseListFragment<TaskReleaseEty> implements Action1<Integer> {
+public class FgtDownloadWelfareList extends BaseListFragment2<TaskReleaseEty> implements Action1<Integer> {
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         EventBus.getDefault().register(this);
     }
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        EventBus.getDefault().unregister(this);
+    }
 
     @Override
     public void call(Integer integer) {
@@ -43,11 +48,6 @@ public class FgtDownloadWelfareList extends BaseListFragment<TaskReleaseEty> imp
         CommonUtil.getInstance().setEventResultViewStatus(event, view_list);
     }
     @Override
-    public void onDestroy() {
-        super.onDestroy();
-        EventBus.getDefault().unregister(this);
-    }
-    @Override
     protected RecyclerView.Adapter getAdapter() {
         return new WelfareAdapter(activity, list, this);
     }
@@ -66,9 +66,4 @@ public class FgtDownloadWelfareList extends BaseListFragment<TaskReleaseEty> imp
     protected Class<TaskReleaseEty> getTClass() {
         return TaskReleaseEty.class;
     }
-
-    @Override
-    public void notifyData() {
-
-    }
 }

+ 17 - 16
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFindChild.java

@@ -37,6 +37,7 @@ import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
 
 import org.afinal.simplecache.ApiKey;
+import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
 import java.util.HashMap;
@@ -55,7 +56,7 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_ITEM;
  * Created by realicing on 2018/9/7.
  * realicing@sina.com
  */
-public class FgtFindChild extends BaseListFragment<FindItem> {
+public class FgtFindChild extends BaseListFragment2<FindItem> {
     @Override
     protected RecyclerView.Adapter getAdapter() {
         return new AdbCommonRecycler<FindItem>(SheepApp.getInstance(), list){
@@ -151,12 +152,6 @@ public class FgtFindChild extends BaseListFragment<FindItem> {
         return FindItem.class;
     }
 
-    @Override
-    public void notifyData() {
-
-    }
-
-
     private int type;
     public static FgtFindChild newInstance(int type){
         FgtFindChild fgt = new FgtFindChild();
@@ -165,15 +160,6 @@ public class FgtFindChild extends BaseListFragment<FindItem> {
         fgt.setArguments(bundle);
         return fgt;
     }
-    @Override
-    public void onCreate(@Nullable Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        Bundle bundle = getArguments();
-        if(bundle != null){
-            type = bundle.getInt("type", 0);
-        }
-        Aria.download(this).register();
-    }
     /**
      * 点击一个发现元素
      * @param item
@@ -353,6 +339,21 @@ public class FgtFindChild extends BaseListFragment<FindItem> {
         }
     }
 
+    @Override
+    public void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        Bundle bundle = getArguments();
+        if(bundle != null){
+            type = bundle.getInt("type", 0);
+        }
+        Aria.download(this).register();
+        EventBus.getDefault().register(this);
+    }
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        EventBus.getDefault().unregister(this);
+    }
     @Subscribe
     public void onEventMainThread(Intent intent) {
         if(intent != null && intent.getAction() != null && intent.getDataString() != null && intent.getDataString().contains("package:")){

+ 1 - 6
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGiftCenter.java

@@ -24,7 +24,7 @@ import rx.functions.Action1;
  * Created by realicing on 2018/9/3.
  * realicing@sina.com
  */
-public class FgtGiftCenter extends BaseListFragment<GiftBagApp> implements Action1<Integer> {
+public class FgtGiftCenter extends BaseListFragment2<GiftBagApp> implements Action1<Integer> {
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -75,9 +75,4 @@ public class FgtGiftCenter extends BaseListFragment<GiftBagApp> implements Actio
     protected Class<GiftBagApp> getTClass() {
         return GiftBagApp.class;
     }
-
-    @Override
-    public void notifyData() {
-
-    }
 }

+ 0 - 7
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMiDong.java

@@ -72,13 +72,6 @@ public class FgtMiDong extends BaseFragment {
     }
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        // TODO: inflate a fragment view
-        View rootView = super.onCreateView(inflater, container, savedInstanceState);
-        return rootView;
-    }
-
-    @Override
     public int getLayoutId() {
         return R.layout.net_empty_fresh_list_more;
     }

+ 94 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMiDongWeChatTaskList.java

@@ -0,0 +1,94 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
+import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
+import com.mdad.sdk.mdsdk.AdManager;
+import com.mdad.sdk.mdsdk.GetAdListListener;
+import com.mdad.sdk.mdsdk.common.AdData;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/10/10.
+ * realicing@sina.com
+ */
+public class FgtMiDongWeChatTaskList extends BaseListFragment<AdData> {
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new RecyclerViewAdapter<AdData>(activity, R.layout.item_midong_wechat, list) {
+
+            @Override
+            public void convert(ViewHolder holder, final AdData item, int position) {
+                if(item == null){
+                    ViewUtil.setDefaultText((TextView) holder.itemView.findViewById(R.id.item_midong_wechat_name));
+                    ViewUtil.setDefaultText((TextView) holder.itemView.findViewById(R.id.item_midong_wechat_price));
+                    ViewUtil.setDefaultText((TextView) holder.itemView.findViewById(R.id.item_midong_wechat_des));
+                    return;
+                }
+                ViewUtil.setText((TextView) holder.itemView.findViewById(R.id.item_midong_wechat_name), item.getName());
+                ViewUtil.setText((TextView) holder.itemView.findViewById(R.id.item_midong_wechat_price), item.getPrice() + "元");
+                ViewUtil.setText((TextView) holder.itemView.findViewById(R.id.item_midong_wechat_des), item.getDescription());
+                Glide.with(activity).load(item.getLogo()).into((ImageView) holder.itemView.findViewById(R.id.item_midong_wechat_iv));
+                holder.itemView.findViewById(R.id.item_midong_wechat_btn).setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        AdManager.getInstance(activity).openMiniProgram(activity, item);
+                    }
+                });
+            }
+        };
+    }
+
+    @Override
+    public void initData() {
+//        LogUtil.println("FgtMiDongWeChatTaskList", "initData", "start");
+        AdManager.getInstance(activity).getWeChatTaskList(activity, new GetAdListListener() {
+
+            @Override
+            public void onLoadAdSuccess(final List<AdData> newList) {
+//                LogUtil.println("FgtMiDongWeChatTaskList", "initData", "onLoadAdSuccess");
+                activity.runOnUiThread(new Runnable() {
+                    @Override
+                    public void run() {
+                        list.addAll(newList);
+                        setNoMore(true);//一次性全部获取的,所以不需要翻页
+                        notifyDataSetChanged();
+                    }
+                });
+            }
+
+            @Override
+            public void onLoadAdFailure() {
+//                LogUtil.println("FgtMiDongWeChatTaskList", "initData", "onLoadAdFailure");
+                activity.runOnUiThread(new Runnable() {
+                    @Override
+                    public void run() {
+                        setNoMore(true);
+                        notifyDataSetChanged();
+                    }
+                });
+            }
+
+            @Override
+            public void onAdEmpty() {
+//                LogUtil.println("FgtMiDongWeChatTaskList", "initData", "onAdEmpty");
+                activity.runOnUiThread(new Runnable() {
+                    @Override
+                    public void run() {
+                        setNoMore(true);
+                        notifyDataSetChanged();
+                    }
+                });
+            }
+        });
+//        LogUtil.println("FgtMiDongWeChatTaskList", "initData", "end");
+    }
+}

+ 1 - 5
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMsgCenter.java

@@ -4,8 +4,6 @@ package com.sheep.gamegroup.view.fragment;
 import android.support.v7.widget.RecyclerView;
 import android.view.View;
 
-import com.alibaba.fastjson.JSONObject;
-import com.google.gson.reflect.TypeToken;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.api.OnItemClickListener;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -18,9 +16,7 @@ import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.view.activity.ActMain;
 import com.sheep.gamegroup.view.activity.ActMsg;
 import com.sheep.gamegroup.view.adapter.MessageLeftAdapter;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.G;
 
 import java.util.Locale;
 
@@ -32,7 +28,7 @@ import rx.schedulers.Schedulers;
  * Created by realicing on 2018/9/7.
  * realicing@sina.com
  */
-public class FgtMsgCenter extends BaseListFragment<SystemNotification> implements OnItemClickListener<SystemNotification> {
+public class FgtMsgCenter extends BaseListFragment2<SystemNotification> implements OnItemClickListener<SystemNotification> {
 
     @Override
     protected boolean isFirstGetACache() {

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMsgReply.java

@@ -10,7 +10,6 @@ import com.sheep.gamegroup.model.entity.MessageReplyEntity;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.view.activity.ActMsg;
 import com.sheep.gamegroup.view.activity.MessageInteractionDetailActivity;
-import com.sheep.gamegroup.view.adapter.MessageLeftAdapter;
 import com.sheep.gamegroup.view.adapter.MessageRightAdapter;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
@@ -22,7 +21,7 @@ import rx.Observable;
  * Created by realicing on 2018/9/7.
  * realicing@sina.com
  */
-public class FgtMsgReply extends BaseListFragment<MessageReplyEntity> implements MessageRightAdapter.ItemOnClickListener {
+public class FgtMsgReply extends BaseListFragment2<MessageReplyEntity> implements MessageRightAdapter.ItemOnClickListener {
     @Override
     protected boolean isFirstGetACache() {
         return false;

+ 1 - 5
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyDownloadWelfareList.java

@@ -16,7 +16,7 @@ import rx.Observable;
  * Created by realicing on 2018/8/28.
  * realicing@sina.com
  */
-public class FgtMyDownloadWelfareList extends BaseListFragment<DownloadWelfare> {
+public class FgtMyDownloadWelfareList extends BaseListFragment2<DownloadWelfare> {
     @Override
     protected RecyclerView.Adapter getAdapter() {
         return new DownloadWelfareAdapter(activity, list);
@@ -37,8 +37,4 @@ public class FgtMyDownloadWelfareList extends BaseListFragment<DownloadWelfare>
         return DownloadWelfare.class;
     }
 
-    @Override
-    public void notifyData() {
-
-    }
 }

+ 1 - 6
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyGift.java

@@ -18,7 +18,7 @@ import rx.functions.Action1;
  * Created by realicing on 2018/8/28.
  * realicing@sina.com
  */
-public class FgtMyGift extends BaseListFragment<GiftBagApp> implements Action1<Integer> {
+public class FgtMyGift extends BaseListFragment2<GiftBagApp> implements Action1<Integer> {
     @Override
     public void call(Integer integer) {
         switch (integer){
@@ -53,9 +53,4 @@ public class FgtMyGift extends BaseListFragment<GiftBagApp> implements Action1<I
         return GiftBagApp.class;
     }
 
-    @Override
-    public void notifyData() {
-
-    }
-
 }

+ 1 - 4
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSearchApp.java

@@ -15,7 +15,7 @@ import rx.Observable;
  * Created by realicing on 2018/9/13.
  * realicing@sina.com
  */
-public class FgtSearchApp extends BaseListFragment<GameEntity> {
+public class FgtSearchApp extends BaseListFragment2<GameEntity> {
 
     @Override
     public int refreshDataType() {
@@ -50,9 +50,6 @@ public class FgtSearchApp extends BaseListFragment<GameEntity> {
         return GameEntity.class;
     }
 
-    @Override
-    public void notifyData() {
-    }
     public void clear() {
         list.clear();
     }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSignCardRecord.java

@@ -34,7 +34,7 @@ import rx.schedulers.Schedulers;
  * Created by realicing on 2018/9/17.
  * realicing@sina.com
  */
-public class FgtSignCardRecord extends  BaseListFragment<PunchLog>{
+public class FgtSignCardRecord extends BaseListFragment2<PunchLog> {
     CalendarView sign_card_record_cv;
     TextView total_award;
     TextView total_money;

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWatchFocus.java

@@ -44,7 +44,7 @@ import rx.Observable;
  * realicing@sina.com
  * 看点
  */
-public class FgtWatchFocus extends BaseListFragment<RouserArticlesEntity> {
+public class FgtWatchFocus extends BaseListFragment2<RouserArticlesEntity> {
 
     @Override
     protected RecyclerView.Adapter getAdapter() {

+ 1 - 5
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareUseRecord.java

@@ -16,7 +16,7 @@ import rx.Observable;
  * Created by realicing on 2018/8/28.
  * realicing@sina.com
  */
-public class FgtWelfareUseRecord extends BaseListFragment<VoucherUseLog> {
+public class FgtWelfareUseRecord extends BaseListFragment2<VoucherUseLog> {
     @Override
     protected boolean isFirstGetACache() {
         return false;
@@ -41,8 +41,4 @@ public class FgtWelfareUseRecord extends BaseListFragment<VoucherUseLog> {
         return VoucherUseLog.class;
     }
 
-    @Override
-    public void notifyData() {
-
-    }
 }

+ 0 - 24
app/src/main/res/layout/act_midong_layout.xml

@@ -1,24 +0,0 @@
-<?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:background="@color/gray_F5F5F5">
-
-    <include
-        layout="@layout/title"/>
-
-    <android.support.design.widget.TabLayout
-        android:id="@+id/indicator"
-        style="@style/style_tab"/>
-
-    <android.support.v4.view.ViewPager
-        android:id="@+id/pager"
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1"
-        android:paddingRight="@dimen/content_padding_15"
-        android:paddingTop="@dimen/content_padding_15"
-        android:paddingLeft="@dimen/content_padding_15"/>
-
-</LinearLayout>

+ 3 - 5
app/src/main/res/layout/adp_midong_item.xml

@@ -3,6 +3,8 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:paddingStart="16dp"
+    android:paddingEnd="18dp"
     android:orientation="vertical">
 
     <RelativeLayout
@@ -42,9 +44,7 @@
     <android.support.constraint.ConstraintLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginEnd="12dp"
-        android:layout_marginStart="12dp"
-        android:layout_marginTop="@dimen/content_padding_10">
+        android:layout_marginTop="12dp">
 
         <ImageView
             android:id="@+id/item_icon_iv"
@@ -179,7 +179,5 @@
         android:id="@+id/line_tv"
         android:layout_width="match_parent"
         android:layout_height="0.5dp"
-        android:layout_marginEnd="12dp"
-        android:layout_marginStart="12dp"
         android:background="@color/gray_F0F0F0" />
 </LinearLayout>

+ 2 - 0
app/src/main/res/layout/common_tab_vp.xml

@@ -12,6 +12,8 @@
         style="@style/style_tab"
         android:layout_marginTop="7dp" />
 
+    <include layout="@layout/line_1px_hor" />
+
     <android.support.v4.view.ViewPager
         android:id="@+id/pager"
         android:layout_width="match_parent"

+ 94 - 0
app/src/main/res/layout/item_midong_wechat.xml

@@ -0,0 +1,94 @@
+<?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"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:paddingStart="16dp"
+    android:paddingEnd="18dp"
+    android:orientation="vertical">
+
+    <android.support.constraint.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/content_padding_10">
+
+        <ImageView
+            android:id="@+id/item_midong_wechat_iv"
+            android:layout_width="70dp"
+            android:layout_height="70dp"
+            android:src="@drawable/icon_lj"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="70dp"
+            android:layout_marginStart="@dimen/content_padding"
+            android:orientation="vertical"
+            app:layout_constraintEnd_toStartOf="@+id/item_midong_wechat_btn"
+            app:layout_constraintStart_toEndOf="@+id/item_midong_wechat_iv">
+
+            <TextView
+                android:id="@+id/item_midong_wechat_name"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:ellipsize="middle"
+                android:gravity="start"
+                android:maxLines="2"
+                android:text="item_midong_wechat_name"
+                android:textColor="#333333"
+                android:textSize="14sp" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="5" />
+
+            <TextView
+                android:id="@+id/item_midong_wechat_price"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="item_midong_wechat_price"
+                android:textColor="#FF3366"
+                android:textSize="10sp" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="3" />
+
+
+            <TextView
+                android:id="@+id/item_midong_wechat_des"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:lines="1"
+                android:text="item_midong_wechat_des"
+                android:textColor="#8e8e8e"
+                android:textSize="10sp" />
+        </LinearLayout>
+
+
+        <TextView
+            android:id="@+id/item_midong_wechat_btn"
+            style="@style/style_button_find_midong"
+            android:layout_width="wrap_content"
+            android:minWidth="@dimen/find_bt_with"
+            android:text="打开小程序"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+    </android.support.constraint.ConstraintLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/content_padding_10" />
+
+    <View
+        android:id="@+id/line_tv"
+        android:layout_width="match_parent"
+        android:layout_height="0.5dp"
+        android:background="@color/gray_F0F0F0" />
+</LinearLayout>

+ 1 - 1
app/src/main/res/layout/net_empty_fresh_list_more.xml

@@ -2,7 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/bg_gray">
+    android:background="@color/white">
 
     <include
         android:id="@+id/title"