|
|
@@ -1,6 +1,7 @@
|
|
|
package com.sheep.gamegroup.view.activity;
|
|
|
|
|
|
import android.content.Intent;
|
|
|
+import android.support.annotation.IntDef;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.Gravity;
|
|
|
import android.view.View;
|
|
|
@@ -26,6 +27,8 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
+import java.lang.annotation.Retention;
|
|
|
+import java.lang.annotation.RetentionPolicy;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Locale;
|
|
|
|
|
|
@@ -33,7 +36,6 @@ import javax.inject.Inject;
|
|
|
|
|
|
import butterknife.BindView;
|
|
|
import butterknife.OnClick;
|
|
|
-import rx.functions.Action1;
|
|
|
|
|
|
/**
|
|
|
* Created by Administrator on 2018/3/26.
|
|
|
@@ -58,7 +60,7 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
|
|
|
- private int whereFrom;
|
|
|
+ private int willGoWhere;
|
|
|
|
|
|
private int count = 0;
|
|
|
|
|
|
@@ -88,7 +90,7 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
|
|
|
Intent i = getIntent();
|
|
|
if (i != null && i.hasExtra("info")) {
|
|
|
- whereFrom = i.getIntExtra("where_from", 0);
|
|
|
+ willGoWhere = i.getIntExtra(KEY_WILL_GO_WHERE, ONLY_FINISH);
|
|
|
}
|
|
|
tvSubmit.setVisibility(View.GONE);
|
|
|
userEntity = DataUtil.getInstance().getUserEntity();
|
|
|
@@ -132,28 +134,29 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
public void NetSuccess(int code, String msg, String string) {
|
|
|
hideProgress();
|
|
|
G.showToast(msg);
|
|
|
- updateUserInfo(new Action1<UserEntity>() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void call(UserEntity result) {
|
|
|
- if (result != null)
|
|
|
- userEntity = result;
|
|
|
- if (whereFrom == 1) {//从提现过来的
|
|
|
- Jump2View.getInstance().goWithdrawal(RealNameAuthenAct.this);
|
|
|
- }
|
|
|
- finish();
|
|
|
+ CommonUtil.getInstance().updateUserInfo(result -> {
|
|
|
+ if (result == null) {
|
|
|
+ DataUtil.getInstance().setChange(true);
|
|
|
+ } else {
|
|
|
+ userEntity = result;
|
|
|
+ }
|
|
|
+ switch (willGoWhere){
|
|
|
+ case GO_WITHDRAWAL:
|
|
|
+ Jump2View.getInstance().goWithdrawal(RealNameAuthenAct.this);
|
|
|
+ finish();
|
|
|
+ break;
|
|
|
+ case ONLY_FINISH:
|
|
|
+ default:
|
|
|
+ finish();
|
|
|
+ break;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void updateUserInfo(final Action1<UserEntity> action1) {
|
|
|
- CommonUtil.getInstance().updateUserInfo(action1);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void NetError(int code, String errorMsg) {
|
|
|
hideProgress();
|
|
|
- updateUserInfo(null);
|
|
|
+ CommonUtil.getInstance().updateUserInfo(null);
|
|
|
G.showToast(errorMsg);
|
|
|
}
|
|
|
|
|
|
@@ -253,4 +256,11 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
public void showGoProgress() {
|
|
|
showProgress();
|
|
|
}
|
|
|
+ public static final String KEY_WILL_GO_WHERE = "will_go_where";
|
|
|
+ public static final int ONLY_FINISH = 0;//直接finish
|
|
|
+ public static final int GO_WITHDRAWAL = 1;//跳转提现界面
|
|
|
+ @IntDef({ONLY_FINISH, GO_WITHDRAWAL})
|
|
|
+ @Retention(RetentionPolicy.SOURCE)
|
|
|
+ public @interface WILL_GO_WHERE {
|
|
|
+ }
|
|
|
}
|