|
@@ -2,13 +2,18 @@ package com.sheep.gamegroup.module.game.fragment;
|
|
|
|
|
|
|
|
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.view.KeyEvent;
|
|
import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.widget.Button;
|
|
import android.widget.Button;
|
|
|
import android.widget.ImageButton;
|
|
import android.widget.ImageButton;
|
|
|
|
|
|
|
|
|
|
+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.entity.WebParams;
|
|
|
|
|
+import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
|
|
+import com.sheep.gamegroup.util.DataUtil;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.KeyEventUtil;
|
|
import com.sheep.gamegroup.util.KeyEventUtil;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
@@ -22,6 +27,10 @@ import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
|
|
|
|
|
import butterknife.BindView;
|
|
import butterknife.BindView;
|
|
|
import butterknife.OnClick;
|
|
import butterknife.OnClick;
|
|
|
|
|
+import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
|
|
+import io.reactivex.schedulers.Schedulers;
|
|
|
|
|
+import rx.functions.Action1;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Created by realicing on 2019/1/18.
|
|
* Created by realicing on 2019/1/18.
|
|
|
* realicing@sina.com
|
|
* realicing@sina.com
|
|
@@ -51,6 +60,8 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
ImageButton searchBtn;
|
|
ImageButton searchBtn;
|
|
|
@BindView(R.id.my_walfare_btn)
|
|
@BindView(R.id.my_walfare_btn)
|
|
|
Button myWalfareBtn;
|
|
Button myWalfareBtn;
|
|
|
|
|
+ @BindView(R.id.fgt_gc_hb_500_yuan_drl)
|
|
|
|
|
+ View fgt_gc_hb_500_yuan_drl;
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initView() {
|
|
private void initView() {
|
|
@@ -80,6 +91,29 @@ public class FgtGameCenter extends BaseFragment {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ ViewUtil.setVisibility(fgt_gc_hb_500_yuan_drl, false);
|
|
|
|
|
+ CommonUtil.getInstance().callActionWithUserInfo(userEntity -> {
|
|
|
|
|
+ String code = userEntity.getParent_code();
|
|
|
|
|
+ if(TextUtils.isEmpty(code)){
|
|
|
|
|
+ code = userEntity.getInvitation_code();
|
|
|
|
|
+ }
|
|
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().getUserIsShouYou(code)
|
|
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
+ boolean result = baseMessage.getData(Boolean.class);
|
|
|
|
|
+ ViewUtil.setVisibility(fgt_gc_hb_500_yuan_drl, result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
|
|
+ ViewUtil.setVisibility(fgt_gc_hb_500_yuan_drl, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void initData() {
|
|
private void initData() {
|