|
|
@@ -12,7 +12,6 @@ import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
|
|
-import com.sheep.gamegroup.absBase.AbsObserver;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.GameEntity;
|
|
|
import com.sheep.gamegroup.model.entity.GameListType;
|
|
|
@@ -24,6 +23,7 @@ import com.sheep.gamegroup.module.game.adapter.AdpGameCenterType;
|
|
|
import com.sheep.gamegroup.module.game.model.GameCenterType;
|
|
|
import com.sheep.gamegroup.module.game.model.GamePortTypes;
|
|
|
import com.sheep.gamegroup.module.game.util.HpRefreshWelfareHelper;
|
|
|
+import com.sheep.gamegroup.module.game.util.OneTaskHelper;
|
|
|
import com.sheep.gamegroup.module.game.util.PromoteGoodsHelper;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
import com.sheep.gamegroup.util.DataUtil;
|
|
|
@@ -48,9 +48,7 @@ import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
|
|
|
import butterknife.BindView;
|
|
|
-import io.reactivex.Observable;
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
-import io.reactivex.functions.Function;
|
|
|
import io.reactivex.schedulers.Schedulers;
|
|
|
|
|
|
/**
|
|
|
@@ -65,6 +63,8 @@ public class FgtPlayGame extends BaseFragment {
|
|
|
RecyclerView play_game_center_type_list;
|
|
|
@BindView(R.id.play_game_list_2_rv)
|
|
|
RecyclerView play_game_list_2_rv;
|
|
|
+ @BindView(R.id.play_game_list_2_rv2)
|
|
|
+ RecyclerView play_game_list_2_rv2;
|
|
|
@BindView(R.id.play_game_list_x_rv)
|
|
|
RecyclerView play_game_list_x_rv;
|
|
|
@BindView(R.id.refresh)
|
|
|
@@ -77,6 +77,7 @@ public class FgtPlayGame extends BaseFragment {
|
|
|
public static final int[] GAME_CENTER_TYPE_ID = {1, 3, 2, -1};//1:绵羊新游 2:绵羊推荐 3:免费道具
|
|
|
//预下载和tag列表的数据
|
|
|
private List<ListTypeList<GameEntity, GameListType>> gameEntityList2 = new ArrayList<>();
|
|
|
+ private List<ListTypeList<GameEntity, GameListType>> gameEntityList22 = new ArrayList<>();
|
|
|
private List<ListTypeList<GameEntity, GameListType>> gameEntityListx = new ArrayList<>();
|
|
|
private List<SlideshowEty> slideshowEtyLists = new ArrayList<>();
|
|
|
private List<String> slideshowTitleList = new ArrayList<>();
|
|
|
@@ -91,6 +92,10 @@ public class FgtPlayGame extends BaseFragment {
|
|
|
@BindView(R.id.hp_refresh_welfare_box)
|
|
|
View hp_refresh_welfare_box;
|
|
|
private HpRefreshWelfareHelper mHpRefreshWelfareHelper;//刷新福利的帮助类
|
|
|
+ //单个任务的入口与刷新任务
|
|
|
+ @BindView(R.id.play_game_task)
|
|
|
+ View play_game_task;
|
|
|
+ private OneTaskHelper mOneTaskHelper;//的帮助类
|
|
|
//商品限时抢购入口与刷新商品
|
|
|
@BindView(R.id.play_game_promote_goods)
|
|
|
View play_game_promote_goods;
|
|
|
@@ -105,6 +110,8 @@ public class FgtPlayGame extends BaseFragment {
|
|
|
//玩转游戏 游戏福利专区入口
|
|
|
mHpRefreshWelfareHelper = new HpRefreshWelfareHelper(hp_refresh_welfare_box);
|
|
|
//玩转游戏 商城限时抢购入口
|
|
|
+ mOneTaskHelper = new OneTaskHelper(play_game_task);
|
|
|
+ //玩转游戏 商城限时抢购入口
|
|
|
mPromoteGoodsHelper = new PromoteGoodsHelper(play_game_promote_goods);
|
|
|
|
|
|
|
|
|
@@ -124,12 +131,17 @@ public class FgtPlayGame extends BaseFragment {
|
|
|
BaseQuickAdapter baseQuickAdapter = new AdpGameCenterType(gameCenterList);
|
|
|
baseQuickAdapter.bindToRecyclerView(play_game_center_type_list);
|
|
|
baseQuickAdapter.setOnItemClickListener((adapter, view, position) -> Jump2View.getInstance().goActGameCenterType(getActivity(), ListUtil.getItem(gameCenterList, position)));
|
|
|
- //x列表前2个
|
|
|
+ //前2个
|
|
|
play_game_list_2_rv.setHasFixedSize(true);
|
|
|
play_game_list_2_rv.setNestedScrollingEnabled(false);
|
|
|
play_game_list_2_rv.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
|
|
|
new AdpGameCenter4_3List(gameEntityList2).bindToRecyclerView(play_game_list_2_rv);
|
|
|
- //x列表从第2个开始
|
|
|
+ //前2-4个
|
|
|
+ play_game_list_2_rv2.setHasFixedSize(true);
|
|
|
+ play_game_list_2_rv2.setNestedScrollingEnabled(false);
|
|
|
+ play_game_list_2_rv2.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
|
|
|
+ new AdpGameCenter4_3List(gameEntityList22).bindToRecyclerView(play_game_list_2_rv2);
|
|
|
+ //x列表从第4个开始
|
|
|
play_game_list_x_rv.setHasFixedSize(true);
|
|
|
play_game_list_x_rv.setNestedScrollingEnabled(false);
|
|
|
play_game_list_x_rv.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
|
|
|
@@ -154,6 +166,7 @@ public class FgtPlayGame extends BaseFragment {
|
|
|
//获取出包类型列表 的tagList
|
|
|
private void initGameTagList() {
|
|
|
gameEntityList2.clear();
|
|
|
+ gameEntityList22.clear();
|
|
|
gameEntityListx.clear();
|
|
|
ViewUtil.notifyDataSetChanged(play_game_list_2_rv);
|
|
|
ViewUtil.notifyDataSetChanged(play_game_list_x_rv);
|
|
|
@@ -171,11 +184,13 @@ public class FgtPlayGame extends BaseFragment {
|
|
|
ArrayList<GamePortTypes> gamePortTypeList = baseMessage.getDataList(GamePortTypes.class);
|
|
|
Collections.sort(gamePortTypeList, comparator2);
|
|
|
int size = gamePortTypeList.size();
|
|
|
- int d = size / 2;
|
|
|
+ int d = size / 3;
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
GamePortTypes item = gamePortTypeList.get(i);
|
|
|
if(i < d ){
|
|
|
initGameList(play_game_list_2_rv, gameEntityList2, item);
|
|
|
+ } else if(i < 2d ){
|
|
|
+ initGameList(play_game_list_2_rv2, gameEntityList22, item);
|
|
|
} else {
|
|
|
initGameList(play_game_list_x_rv, gameEntityListx, item);
|
|
|
}
|