|
|
@@ -51,7 +51,7 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
|
|
|
public static WeakReference<TabLayout> gameRef;
|
|
|
|
|
|
- private Fragment gameMallFgt, gameCenterFgt, welfareCenterFgt;
|
|
|
+ private BaseFragment gameMallFgt, gameCenterFgt, welfareCenterFgt, articleListFgt;
|
|
|
|
|
|
@BindView(R.id.indicator)
|
|
|
TabLayout indicator;
|
|
|
@@ -102,25 +102,13 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
private void initView() {
|
|
|
ViewUtil.setImage(fgt_gc_hb_500_yuan_iv, R.mipmap.bg_hb_500yuan);
|
|
|
TitleFragmentListAdapter mAdapter = new TitleFragmentListAdapter(getChildFragmentManager());
|
|
|
- if (EmulatorDetectUtil.isEmulator()) {
|
|
|
- gameCenterFgt = FgtWeb.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_GAME_HOME)));
|
|
|
- } else {
|
|
|
- gameCenterFgt = FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_GAME_HOME)));
|
|
|
- }
|
|
|
- if (EmulatorDetectUtil.isEmulator()) {
|
|
|
- welfareCenterFgt = FgtWeb.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME)));
|
|
|
- } else {
|
|
|
- welfareCenterFgt = FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME)));
|
|
|
- }
|
|
|
-
|
|
|
- if (EmulatorDetectUtil.isEmulator()) {
|
|
|
- gameMallFgt = FgtWeb.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_GAME_SHOP_HOME)));
|
|
|
- } else {
|
|
|
- gameMallFgt = FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_GAME_SHOP_HOME)));
|
|
|
- }
|
|
|
+ gameCenterFgt = ViewUtil.newWebFragment(new WebParams(Config.getUrlByPath(Config.PATH_GAME_HOME)).hideProgress());
|
|
|
+ welfareCenterFgt = ViewUtil.newWebFragment(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME)).hideProgress());
|
|
|
+ articleListFgt = ViewUtil.newWebFragment(new WebParams(Config.getUrlByPath(Config.PATH_ARTICLE_LIST, "type", -3, "subtype", 0)).hideProgress());
|
|
|
+ gameMallFgt = ViewUtil.newWebFragment(new WebParams(Config.getUrlByPath(Config.PATH_GAME_SHOP_HOME)).hideProgress());
|
|
|
mAdapter.add(gameCenterFgt, "玩转游戏");
|
|
|
mAdapter.add(welfareCenterFgt, "福利中心");
|
|
|
- mAdapter.add(FgtFindChild.newInstance(new ArticleTag(-3, 0)), "游戏资讯");
|
|
|
+ mAdapter.add(articleListFgt, "游戏资讯");
|
|
|
mAdapter.add(gameMallFgt, "游戏商城");
|
|
|
pager.setAdapter(mAdapter);
|
|
|
indicator.setupWithViewPager(pager);
|
|
|
@@ -149,15 +137,16 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
if (pager == null) return;
|
|
|
switch (pager.getCurrentItem()) {
|
|
|
case 0:
|
|
|
- if (gameCenterFgt != null) ((BaseFragment) gameCenterFgt).initDataOnVisibleToUser();
|
|
|
+ if (gameCenterFgt != null) gameCenterFgt.initDataOnVisibleToUser();
|
|
|
break;
|
|
|
case 1:
|
|
|
- if (welfareCenterFgt != null) ((BaseFragment) welfareCenterFgt).initDataOnVisibleToUser();
|
|
|
+ if (welfareCenterFgt != null) welfareCenterFgt.initDataOnVisibleToUser();
|
|
|
break;
|
|
|
case 2:
|
|
|
+ if (articleListFgt != null) gameCenterFgt.initDataOnVisibleToUser();
|
|
|
break;
|
|
|
case 3:
|
|
|
- if (gameMallFgt != null) ((BaseFragment) gameMallFgt).initDataOnVisibleToUser();
|
|
|
+ if (gameMallFgt != null) gameMallFgt.initDataOnVisibleToUser();
|
|
|
break;
|
|
|
}
|
|
|
}
|