Bläddra i källkod

refact bussiness UI bug fixed loop2

billyyoyo 6 år sedan
förälder
incheckning
08263ccf4c

+ 2 - 0
app/src/main/AndroidManifest.xml

@@ -421,6 +421,7 @@
             android:name="com.sheep.gamegroup.view.activity.RealNameAuthenAct"
             android:screenOrientation="portrait"
             android:exported="true"
+            android:launchMode="singleTask"
             android:theme="@style/AppActionTheme" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ChangeWxOrTelAct"
@@ -888,6 +889,7 @@
             android:theme="@style/AppThemeMain" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.GameCertificationActivity"
+            android:configChanges="orientation|screenSize"
             android:exported="true"
             android:screenOrientation="behind"
             android:theme="@style/AppActionTheme" /> <!-- end 小绵羊sdk相关 -->

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -1454,6 +1454,7 @@ public class CommonUtil {
     }
 
     public void checkAuth(Activity activity, String token, String face, final Action1<Boolean> action1) {
+//        new Exception("-------------checkauth---------------").printStackTrace();
         SheepApp.getInstance()
                 .getNetComponent()
                 .getApiService()

+ 9 - 10
app/src/main/java/com/sheep/gamegroup/view/activity/ChangeTelAct.java

@@ -98,7 +98,6 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View {
 
     private String hitStr = "请输入手机号";
     private String noticeStr = "绑定手机号";
-    String mobiles;
     private String foreignToken;
 
     //验证码倒计时
@@ -190,14 +189,15 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View {
             default:
                 break;
         }
-        mobiles = DataUtil.getInstance().getUserMobile();
-        if (!TextUtils.isEmpty(mobiles)) {//提示
-            oldOrNew = 1;
-            showChangeLayout.setVisibility(View.VISIBLE);
-            changePhoneLayout.setVisibility(View.GONE);
-            telTv.setText(mobiles);
-            return;
-        }
+        CommonUtil.getInstance().getUserInfo(TextUtils.isEmpty(foreignToken)?SpUtils.getToken(this): foreignToken, entity->{
+            if (!TextUtils.isEmpty(entity.getMobile())) {//提示
+                oldOrNew = 1;
+                showChangeLayout.setVisibility(View.VISIBLE);
+                changePhoneLayout.setVisibility(View.GONE);
+                telTv.setText(entity.getMobile());
+                return;
+            }
+        });
         refreshData();
     }
 
@@ -272,7 +272,6 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View {
             hitStr = "请输入手机号码";
             noticeStr = "验证原手机";
             phoneEtAccount.setHint(hitStr + "");
-//            phoneEtAccount.setText(mobiles+"");
         } else {
             step = 0;
             hitStr = "请输入手机号码";

+ 13 - 11
app/src/main/java/com/sheep/gamegroup/view/activity/RealNameAuthenAct.java

@@ -88,6 +88,12 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
     }
 
     @Override
+    public void onBackPressed(){
+        setResult(RESULT_CANCELED);
+        super.onBackPressed();
+    }
+
+    @Override
     public void initView() {
         if (getIntent().hasExtra("token")) {
             foreignToken = getIntent().getStringExtra("token");
@@ -127,8 +133,13 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
         if (i != null && i.hasExtra("info")) {
             willGoWhere = i.getIntExtra(KEY_WILL_GO_WHERE, ONLY_FINISH);
         }
-        tvSubmit.setVisibility(View.GONE);
-        userEntity = DataUtil.getInstance().getUserEntity();
+        CommonUtil.getInstance().getUserInfo(TextUtils.isEmpty(foreignToken) ? SpUtils.getToken(this) : foreignToken, entity -> {
+            userEntity = entity;
+            showUserInfo();
+        });
+    }
+
+    public void showUserInfo() {
         if (userEntity != null) {
             if (!TextUtils.isEmpty(RealNameAuthenAct.this.userEntity.getReal_name())) {
                 etName.setText(RealNameAuthenAct.this.userEntity.getReal_name());
@@ -161,8 +172,6 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
             }
 
         }
-
-
     }
 
     @Override
@@ -219,13 +228,6 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
     }
 
     public void trySubmit() {
-        if (userEntity == null) {
-            userEntity = DataUtil.getInstance().getUserEntity();
-        }
-        if (userEntity == null) {
-            G.showToast(R.string.unknown_error);
-            return;
-        }
         map.clear();
         toNext();
     }

+ 1 - 4
app/src/main/res/layout/change_tel_layout.xml

@@ -18,7 +18,6 @@
 
             <include
                 layout="@layout/game_account_layout"
-                android:layout_margin="@dimen/content_padding_10"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content">
 
@@ -120,10 +119,8 @@
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginLeft="12dp"
-                    android:layout_marginRight="12dp"
                     android:layout_marginTop="@dimen/content_padding_13"
-                    android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
+                    android:background="#ffffff"
                     android:orientation="vertical">
 
                     <LinearLayout

+ 47 - 43
app/src/main/res/layout/game_account_layout.xml

@@ -2,59 +2,63 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/game_account_layout"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:background="#F5F5F5">
 
     <TextView
         android:id="@+id/tip_view"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="54dp"
+        android:layout_marginBottom="1dp"
+        android:background="#ffffff"
+        android:gravity="center_vertical"
+        android:paddingLeft="15dp"
         android:text="关联的游戏账号"
-        android:textColor="@color/black_333333"
+        android:textColor="#000000"
         android:textSize="16sp" />
 
-    <ImageView
-        android:id="@+id/face_view"
-        android:layout_width="60dp"
-        android:layout_height="60dp"
-        android:layout_below="@+id/tip_view"
-        android:layout_marginTop="8dp"
-        android:scaleType="centerCrop"
-        android:src="@mipmap/ic_assist" />
-
     <TextView
-        android:id="@+id/nickname_view"
+        android:id="@+id/number_view"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignTop="@+id/face_view"
-        android:layout_marginLeft="8dp"
-        android:layout_marginTop="6dp"
-        android:layout_toRightOf="@+id/face_view"
-        android:text="Kevin"
-        android:textColor="@color/black_333333"
-        android:textSize="16sp" />
+        android:layout_height="54dp"
+        android:layout_alignParentRight="true"
+        android:layout_marginRight="16dp"
+        android:gravity="center_vertical"
+        android:textColor="#000000"
+        android:textSize="15sp" />
 
-    <TextView
-        android:id="@+id/loginname_view"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignBottom="@+id/face_view"
-        android:layout_marginLeft="8dp"
-        android:layout_marginBottom="6dp"
-        android:layout_toRightOf="@+id/face_view"
-        android:text="sfadljf"
-        android:textColor="@color/black_333333"
-        android:textSize="16sp" />
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="54dp"
+        android:orientation="horizontal"
+        android:background="#ffffff"
+        android:gravity="center_vertical"
+        android:layout_below="@+id/tip_view">
 
-    <TextView
-        android:id="@+id/number_view"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignBottom="@+id/nickname_view"
-        android:layout_marginLeft="8dp"
-        android:layout_marginTop="8dp"
-        android:layout_toRightOf="@+id/nickname_view"
-        android:text="(12312312)"
-        android:textColor="@color/black_333333"
-        android:textSize="12sp" />
+        <ImageView
+            android:id="@+id/face_view"
+            android:layout_width="30dp"
+            android:layout_height="30dp"
+            android:layout_marginLeft="16dp"
+            android:scaleType="centerCrop" />
+
+        <TextView
+            android:id="@+id/nickname_view"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:layout_marginLeft="8dp"
+            android:textColor="@color/black_333333"
+            android:textSize="15sp" />
+
+        <TextView
+            android:id="@+id/loginname_view"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="15dp"
+            android:textColor="@color/black_333333"
+            android:textSize="15sp" />
+
+    </LinearLayout>
 
 </RelativeLayout>

+ 9 - 18
app/src/main/res/layout/x_real_name_auther_layout.xml

@@ -9,42 +9,33 @@
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginEnd="@dimen/content_padding_10"
-        android:layout_marginStart="@dimen/content_padding_10"
-        android:layout_marginTop="@dimen/content_padding_10"
-        android:background="@drawable/shape_ash_solid_rectangle"
+        android:background="#f6f6f6"
         android:orientation="horizontal"
-        android:padding="@dimen/content_padding_15">
-
-        <ImageView
-            android:layout_width="20dp"
-            android:layout_height="20dp"
-            android:src="@mipmap/alarm" />
+        android:paddingLeft="@dimen/content_padding_15"
+        android:paddingRight="@dimen/content_padding_15"
+        android:paddingTop="@dimen/content_padding_18"
+        android:paddingBottom="@dimen/content_padding_18">
 
         <TextView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginStart="5dp"
             android:text="请完善个人信息,第一次实名认证免费,再次提交需扣除0.5绵羊币/次!"
-            android:textColor="#918F8F"
-            android:textSize="14sp" />
+            android:textColor="#666666"
+            android:textSize="13sp" />
     </LinearLayout>
 
     <include
         layout="@layout/game_account_layout"
-        android:layout_marginEnd="@dimen/content_padding_10"
-        android:layout_marginStart="@dimen/content_padding_10"
-        android:layout_marginTop="@dimen/content_padding_10"
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
 
     </include>
 
     <LinearLayout
+        android:layout_marginTop="10dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_margin="10dp"
-        android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
+        android:background="#ffffff"
         android:orientation="vertical">
 
         <LinearLayout