|
|
@@ -2,6 +2,7 @@ package com.sheep.gamegroup.module.game.fragment;
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
import android.support.design.widget.TabLayout;
|
|
|
+import android.support.v4.app.Fragment;
|
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.KeyEvent;
|
|
|
@@ -16,6 +17,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.entity.WebParams;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
+import com.sheep.gamegroup.module.webview.fragment.FgtWeb;
|
|
|
import com.sheep.gamegroup.module.webview.fragment.FgtWebX5;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
import com.sheep.gamegroup.util.DataUtil;
|
|
|
@@ -32,6 +34,7 @@ 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.G;
|
|
|
+import com.snail.antifake.jni.EmulatorDetectUtil;
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
@@ -49,7 +52,7 @@ import rx.functions.Action1;
|
|
|
*/
|
|
|
public class FgtGameCenter extends BaseFragment {
|
|
|
|
|
|
- private FgtWebX5 gameMallFgt;
|
|
|
+ private Fragment gameMallFgt;
|
|
|
|
|
|
@Override
|
|
|
public void onCreate(Bundle bundle) {
|
|
|
@@ -95,9 +98,17 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
TitleFragmentListAdapter mAdapter = new TitleFragmentListAdapter(getChildFragmentManager());
|
|
|
mAdapter.add(new FgtPlayGame(), "玩转游戏");
|
|
|
// mAdapter.add(new com.sheep.gamegroup.view.fragment.FgtGiftCenter(), "礼包中心");
|
|
|
- mAdapter.add(FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME))), "福利中心");
|
|
|
+ if (EmulatorDetectUtil.isEmulator()) {
|
|
|
+ mAdapter.add(FgtWeb.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME))), "福利中心");
|
|
|
+ } else {
|
|
|
+ mAdapter.add(FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME))), "福利中心");
|
|
|
+ }
|
|
|
mAdapter.add(FgtFindChild.newInstance(new ArticleTag(-1, 1)), "游戏资讯");
|
|
|
- gameMallFgt = FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_GAME_SHOP_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)));
|
|
|
+ }
|
|
|
mAdapter.add(gameMallFgt, "游戏商城");
|
|
|
pager.setAdapter(mAdapter);
|
|
|
indicator.setupWithViewPager(pager);
|
|
|
@@ -187,7 +198,11 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
@Subscribe
|
|
|
public void WhenWebViewEventComing(WebViewEvent ev) {
|
|
|
if (gameMallFgt != null && ev.action == WebViewEvent.ACTION_REFRESH_GAME_MALL) {
|
|
|
- gameMallFgt.callTransparent(ev.callback, ev.data);
|
|
|
+ if(gameMallFgt instanceof FgtWeb) {
|
|
|
+ ((FgtWeb)gameMallFgt).callTransparent(ev.callback, ev.data);
|
|
|
+ }else{
|
|
|
+ ((FgtWebX5)gameMallFgt).callTransparent(ev.callback, ev.data);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|