|
@@ -1,5 +1,6 @@
|
|
|
package com.sheep.gamegroup.module.game.fragment;
|
|
package com.sheep.gamegroup.module.game.fragment;
|
|
|
|
|
|
|
|
|
|
+import android.os.Bundle;
|
|
|
import android.support.design.widget.TabLayout;
|
|
import android.support.design.widget.TabLayout;
|
|
|
import android.support.v4.view.ViewPager;
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
@@ -9,6 +10,7 @@ import android.widget.Button;
|
|
|
import android.widget.ImageButton;
|
|
import android.widget.ImageButton;
|
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
|
|
|
|
|
|
|
+import com.sheep.gamegroup.event.WebViewEvent;
|
|
|
import com.sheep.gamegroup.model.entity.ArticleTag;
|
|
import com.sheep.gamegroup.model.entity.ArticleTag;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
@@ -31,6 +33,9 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.base.BaseFragment;
|
|
import com.sheep.jiuyan.samllsheep.base.BaseFragment;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
|
|
|
|
|
|
|
+import org.greenrobot.eventbus.EventBus;
|
|
|
|
|
+import org.greenrobot.eventbus.Subscribe;
|
|
|
|
|
+
|
|
|
import butterknife.BindView;
|
|
import butterknife.BindView;
|
|
|
import butterknife.OnClick;
|
|
import butterknife.OnClick;
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
@@ -44,6 +49,20 @@ import rx.functions.Action1;
|
|
|
*/
|
|
*/
|
|
|
public class FgtGameCenter extends BaseFragment {
|
|
public class FgtGameCenter extends BaseFragment {
|
|
|
|
|
|
|
|
|
|
+ private FgtWebX5 gameMallFgt;
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onCreate(Bundle bundle) {
|
|
|
|
|
+ super.onCreate(bundle);
|
|
|
|
|
+ EventBus.getDefault().register(this);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onDestroy() {
|
|
|
|
|
+ EventBus.getDefault().unregister(this);
|
|
|
|
|
+ super.onDestroy();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public int getLayoutId() {
|
|
public int getLayoutId() {
|
|
|
return R.layout.fgt_game_center;
|
|
return R.layout.fgt_game_center;
|
|
@@ -77,7 +96,8 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
mAdapter.add(new FgtPlayGame(), "玩转游戏");
|
|
mAdapter.add(new FgtPlayGame(), "玩转游戏");
|
|
|
mAdapter.add(FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME))), "福利中心");
|
|
mAdapter.add(FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME))), "福利中心");
|
|
|
mAdapter.add(FgtFindChild.newInstance(new ArticleTag(-1, 1)), "游戏资讯");
|
|
mAdapter.add(FgtFindChild.newInstance(new ArticleTag(-1, 1)), "游戏资讯");
|
|
|
- mAdapter.add(FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_GAME_SHOP_HOME))), "游戏商城");
|
|
|
|
|
|
|
+ gameMallFgt = FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_GAME_SHOP_HOME)));
|
|
|
|
|
+ mAdapter.add(gameMallFgt, "游戏商城");
|
|
|
pager.setAdapter(mAdapter);
|
|
pager.setAdapter(mAdapter);
|
|
|
indicator.setupWithViewPager(pager);
|
|
indicator.setupWithViewPager(pager);
|
|
|
CommonUtil.getInstance().reflex(indicator, getActivity(), false, G.WIDTH - G.getRealPix(144));
|
|
CommonUtil.getInstance().reflex(indicator, getActivity(), false, G.WIDTH - G.getRealPix(144));
|
|
@@ -157,9 +177,17 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
public void doGoMyWalfare(View v) {
|
|
public void doGoMyWalfare(View v) {
|
|
|
Jump2View.getInstance().goMyWelfare(getActivity());
|
|
Jump2View.getInstance().goMyWelfare(getActivity());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@OnClick(R.id.fgt_gc_hb_500_yuan_drl)
|
|
@OnClick(R.id.fgt_gc_hb_500_yuan_drl)
|
|
|
public void goGet500YuanHb(View v) {
|
|
public void goGet500YuanHb(View v) {
|
|
|
Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_MONEY_REWARD_LIST)).setTitle(Config.NAME_WELFARE_MONEY_REWARD_LIST));
|
|
Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_MONEY_REWARD_LIST)).setTitle(Config.NAME_WELFARE_MONEY_REWARD_LIST));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Subscribe
|
|
|
|
|
+ public void WhenWebViewEventComing(WebViewEvent ev) {
|
|
|
|
|
+ if (gameMallFgt != null) {
|
|
|
|
|
+ gameMallFgt.callTransparent(ev.callback, ev.data);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|