Selaa lähdekoodia

修复游戏中心首页中预下载参数错误的bug

zengjiebin 7 vuotta sitten
vanhempi
commit
c62ddc9ddc

+ 4 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameListType.java

@@ -95,4 +95,8 @@ public class GameListType implements Serializable {
         }
         return map;
     }
+
+    //1:非预约下载 2:预约下载
+    public static final int T_DOWNLOAD_TYPE_NO = 1;
+    public static final int T_DOWNLOAD_TYPE_YES = 2;
 }

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

@@ -210,7 +210,7 @@ public class FgtPlayGame extends BaseFragment {
 
     private void initBannerAct() {
         gameActList.clear();
-        play_game_act.getAdapter().notifyDataSetChanged();
+        ViewUtil.notifyDataSetChanged(play_game_act);
         SheepApp.getInstance().getNetComponent().getApiService().gameBannerAct()
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
@@ -221,7 +221,7 @@ public class FgtPlayGame extends BaseFragment {
                         if (!ListUtil.isEmpty(newList)) {
                             gameActList.addAll(newList);
                         }
-                        play_game_act.getAdapter().notifyDataSetChanged();
+                        ViewUtil.notifyDataSetChanged(play_game_act);
                         notifyDataSetChanged();
                     }
 
@@ -235,7 +235,7 @@ public class FgtPlayGame extends BaseFragment {
     //天天更新、重点推荐
     private void initRecommendList() {
         gameListTypeList2List.clear();
-        play_game_list_2_rv.getAdapter().notifyDataSetChanged();
+        ViewUtil.notifyDataSetChanged(play_game_list_2_rv);
         Observable.fromIterable(gameListTypeList2)
                 .subscribe(new AbsObserver<GameListType>() {
                     @Override
@@ -249,7 +249,7 @@ public class FgtPlayGame extends BaseFragment {
                                         List<GameRecommend> newList = baseMessage.getDatas(GameRecommend.class);
                                         if (!ListUtil.isEmpty(newList)) {
                                             gameListTypeList2List.add(new ListTypeList<>(gameListType, newList));
-                                            play_game_list_2_rv.getAdapter().notifyDataSetChanged();
+                                            ViewUtil.notifyDataSetChanged(play_game_list_2_rv);
                                             notifyDataSetChanged();
                                         }
                                     }
@@ -266,11 +266,11 @@ public class FgtPlayGame extends BaseFragment {
     //预下载下面的tagList
     private void initGameTagList() {
         gameEntityListx.clear();
-        play_game_list_x_rv.getAdapter().notifyDataSetChanged();
+        ViewUtil.notifyDataSetChanged(play_game_list_x_rv);
         //预下载
         GameListType gameListType = new GameListType();
         gameListType.setTitle("预下载");
-        gameListType.setDownload_type(1);
+        gameListType.setDownload_type(GameListType.T_DOWNLOAD_TYPE_YES);
         initGameList(play_game_list_x_rv, gameEntityListx, gameListType);
         //其它tag
         SheepApp.getInstance().getNetComponent().getApiService().getGameTagList()
@@ -414,7 +414,7 @@ public class FgtPlayGame extends BaseFragment {
                         List<GameEntity> newList = baseMessage.getDatas(GameEntity.class);
                         if (!ListUtil.isEmpty(newList)) {
                             gameEntityListList.add(new ListTypeList<>(gameListType, newList));
-                            playGameListRv.getAdapter().notifyDataSetChanged();
+                            ViewUtil.notifyDataSetChanged(playGameListRv);
                         }
                         notifyDataSetChanged();
                     }