|
|
@@ -18,11 +18,9 @@ import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.model.entity.AgentEntity;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
|
-import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
-import com.sheep.gamegroup.util.FastJsonUtils;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.MyDbManager;
|
|
|
import com.sheep.gamegroup.util.SysAppUtil;
|
|
|
@@ -30,7 +28,6 @@ import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
|
|
|
import org.afinal.simplecache.ACache;
|
|
|
|
|
|
@@ -92,34 +89,33 @@ public class FgtPersonalCenter extends BaseCompatFragment {
|
|
|
try{
|
|
|
if (baseMessage != null){
|
|
|
AgentEntity agentEntity = baseMessage.getData(AgentEntity.class);
|
|
|
- if(agentEntity != null){
|
|
|
- SpUtils.saveAgencyState(1);
|
|
|
- }else {
|
|
|
- SpUtils.saveAgencyState(0);
|
|
|
+ if(agentEntity != null && agentEntity.getIs_banned() == 0){
|
|
|
+ //设置是否显示代理服务
|
|
|
+ proxy_service_layout_line.setVisibility(View.VISIBLE);
|
|
|
+ proxy_service_layout.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
- SpUtils.saveAgencyState(0);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService().getInfo()
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(getContext()) {
|
|
|
- @Override
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
- updateData(baseMessage);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().getInfo()
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(getContext()) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ updateData(baseMessage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
String appVersonName = ApkUtils.getCurrentPkgVersionName(SheepApp.getInstance());
|
|
|
version_item_tv.setText("小绵羊V");
|
|
|
version_item_tv.append(appVersonName);
|
|
|
@@ -151,13 +147,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
|
|
|
.load(userEntitys.getAvatar() + "")
|
|
|
.apply(new RequestOptions().circleCrop().placeholder(R.drawable.icon))
|
|
|
.into(iconImgIv);
|
|
|
- //设置是否显示代理服务
|
|
|
- proxy_service_layout_line.setVisibility(
|
|
|
-// BuildConfig.DEBUG ||
|
|
|
- SpUtils.getAgencyState() == 1 ? View.VISIBLE : View.GONE);
|
|
|
- proxy_service_layout.setVisibility(
|
|
|
-// BuildConfig.DEBUG ||
|
|
|
- SpUtils.getAgencyState() == 1 ? View.VISIBLE : View.GONE);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -238,7 +228,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
|
|
|
break;
|
|
|
case R.id.clear_layout://清除缓存
|
|
|
ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("清除缓存").setMsg("所有本地的缓存都会被清理").setBtnRightText("取消")
|
|
|
- .setBtnLeftText("确定").setBtnLeftOnClickListener(new View.OnClickListener() {
|
|
|
+ .setBtnLeftText("确定").setBtnLeftOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
USER_CLEAN_SURE.onEvent();
|