소스 검색

new certification ui

hanjing 6 년 전
부모
커밋
020014ef05

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java

@@ -534,6 +534,7 @@ public class DDProviderHelper {
                 .getSdkLoginUserDao()
                 .queryBuilder()
                 .where(SdkLoginUserDao.Properties.ServiceName.eq(serviceName))
+                .orderDesc(SdkLoginUserDao.Properties.LastLoginTime)
                 .build()
                 .list();
     }

+ 163 - 182
app/src/main/java/com/sheep/gamegroup/view/activity/GameCertificationActivity.java

@@ -1,12 +1,15 @@
 package com.sheep.gamegroup.view.activity;
 
-import android.app.Activity;
-import android.os.Bundle;
+import android.graphics.Color;
 import android.os.Handler;
+import android.support.annotation.NonNull;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -16,18 +19,14 @@ import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.greendao.DDProviderHelper;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
-import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.util.CertificationUtil;
 import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.view.customview.TextProgressBar;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import org.json.JSONException;
@@ -36,6 +35,7 @@ import org.json.JSONObject;
 import java.util.List;
 
 import butterknife.BindView;
+import butterknife.ButterKnife;
 import butterknife.OnClick;
 import rx.functions.Action1;
 
@@ -46,37 +46,20 @@ import rx.functions.Action1;
 
 public class GameCertificationActivity extends BaseActivity {
 
-    @BindView(R.id.sdk_arrow)
-    ImageView sdk_arrow;
     @BindView(R.id.icon_iv)
     ImageView icon_iv;
     @BindView(R.id.app_name_tv)
     TextView app_name_tv;
-    @BindView(R.id.sdk_user_name)
-    TextView sdk_user_name;
-    @BindView(R.id.sdk_login_name)
-    TextView sdk_login_name;
-    @BindView(R.id.sdk_user_code)
-    TextView sdk_user_code;
-    @BindView(R.id.sdk_user_iv)
-    ImageView sdk_user_iv;
-    @BindView(R.id.sdk_change_user_list)
-    RecyclerView sdk_change_user_list;
     @BindView(R.id.loading_view_img)
     View loading_view_img;
     @BindView(R.id.change_account_tv)
     TextView change_account_tv;
-    @BindView(R.id.change_commit)
-    TextView change_commit;
-
-    private Activity activity;
-    private Bundle extras;
-    private UserEntity userEntity;
+    @BindView(R.id.sdk_change_user_list)
+    RecyclerView listView;
+    SdkUserAdapter listAdapter;
+    private List<SdkLoginUser> userList = ListUtil.emptyList();
     private String packageName;
-    private TextProgressBar textProgressBar;
-    private boolean isChangeAccount;
     private String gameToken;
-    private String currentToken;
 
     @Override
     protected int getLayoutId() {
@@ -85,78 +68,43 @@ public class GameCertificationActivity extends BaseActivity {
 
     @Override
     public void initView() {
-        currentToken = SpUtils.getToken(this);
-        activity = this;
-        textProgressBar = new TextProgressBar(activity);
-        textProgressBar.setVisibility(View.VISIBLE);
         TitleBarUtils.getInstance()
-//                .setShowOrHide(this, true)
-                .setTitle(activity, "授权登录")
-                .setTitleListen(activity, 0, null);
-        sdk_change_user_list.setVisibility(View.GONE);
-    }
-
-    private List<SdkLoginUser> userList = ListUtil.emptyList();
-
-    @Override
-    public void initListener() {
-        sdk_change_user_list.setLayoutManager(new LinearLayoutManager(this));
-        sdk_change_user_list.setHasFixedSize(true);
-        sdk_change_user_list.setNestedScrollingEnabled(false);
-        sdk_change_user_list.setAdapter(new RecyclerViewAdapter<SdkLoginUser>(this, R.layout.include_item_sdk_user, userList) {
+                .setTitle(this, "授权登录")
+                .setTitleListen(this, 0, null);
+        listView.setLayoutManager(new LinearLayoutManager(this));
+        listAdapter = new SdkUserAdapter();
+        listView.setAdapter(listAdapter);
+        listView.addOnScrollListener(new RecyclerView.OnScrollListener() {
             @Override
-            public void convert(ViewHolder viewHolder, final SdkLoginUser item, final int position) {
-                ImageView item_sdk_arrow = viewHolder.itemView.findViewById(R.id.item_sdk_arrow);
-                ImageView item_sdk_user_iv = viewHolder.itemView.findViewById(R.id.item_sdk_user_iv);
-                TextView item_sdk_user_name = viewHolder.itemView.findViewById(R.id.item_sdk_user_name);
-                TextView item_sdk_user_code = viewHolder.itemView.findViewById(R.id.item_sdk_user_code);
-                View item_sdk_user_line = viewHolder.itemView.findViewById(R.id.item_sdk_user_line);
-                ViewUtil.setVisibility2(item_sdk_user_line, position != 0);
-                ViewUtil.setText(item_sdk_user_name, item.getNickname());
-                ViewUtil.setText(item_sdk_user_code, item.getInvitation_code());
-                GlideImageLoader.setAvatar(item_sdk_user_iv, item.getAvatar());
-                item_sdk_arrow.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        DDProviderHelper.getInstance().deleteSdkLoginUser(item);
-                        try {
-                            userList.remove(position);
-                            sdk_change_user_list.getAdapter().notifyDataSetChanged();
-                            ViewUtil.setVisibility(sdk_change_user_list, !userList.isEmpty() && isUserListOpen);
-                            ViewUtil.setVisibility2(sdk_arrow, !userList.isEmpty());
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                    }
-                });
-
-                viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        CertificationUtil.newInstance().authCertificationCode(activity, item.getToken());
-                    }
-                });
+            public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
+                int offset = recyclerView.computeVerticalScrollOffset();
+                int distance = getResources().getDimensionPixelSize(R.dimen.game_certification_scroll);
+                if (offset > distance) {
+                    icon_iv.setAlpha(0f);
+                    app_name_tv.setAlpha(0f);
+                } else {
+                    icon_iv.setAlpha((float) (distance - offset) / (float) distance);
+                    app_name_tv.setAlpha((float) (distance - offset) / (float) distance);
+                }
             }
         });
     }
 
     public void initData() {
-        extras = getIntent().getExtras();
-        if (extras.containsKey(getString(R.string.kfzs_duanduan_datashare_package_extras))) {
-            String extraJson = extras.getString(getString(R.string.kfzs_duanduan_datashare_package_extras));
-            try {
-                JSONObject jsonObject = new JSONObject(extraJson);
-                if (jsonObject.has("user_behavior") && "validate_token".equals(jsonObject.getString("user_behavior"))) {
-                    gameToken = jsonObject.getString("game_token");
+        if (getIntent().getExtras() != null) {
+            if (getIntent().hasExtra(getString(R.string.kfzs_duanduan_datashare_package_extras))) {
+                String extraJson = getIntent().getStringExtra(getString(R.string.kfzs_duanduan_datashare_package_extras));
+                try {
+                    JSONObject jsonObject = new JSONObject(extraJson);
+                    if (jsonObject.has("user_behavior") && "validate_token".equals(jsonObject.getString("user_behavior"))) {
+                        gameToken = jsonObject.getString("game_token");
+                    }
+                } catch (JSONException e) {
+                    e.printStackTrace();
                 }
-            } catch (JSONException e) {
-                e.printStackTrace();
             }
-        }
-        userEntity = DataUtil.getInstance().getUserEntity();
-        if (extras != null) {
-            SheepApp.getInstance().setGameCode(extras.getString(getString(R.string.kfzs_duanduan_datashare_game_code), ""));
-            packageName = extras.getString(getString(R.string.kfzs_duanduan_datashare_package_name), "");
+            SheepApp.getInstance().setGameCode(getIntent().getStringExtra(getString(R.string.kfzs_duanduan_datashare_game_code)));
+            packageName = getIntent().getStringExtra(getString(R.string.kfzs_duanduan_datashare_package_name));
             SheepApp.getInstance().setGamePackgeName(packageName);
             if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode()) || TextUtils.isEmpty(packageName)) {
                 CertificationUtil.newInstance().showCertificationErrorAndExitApp(this, "", 2000);
@@ -167,23 +115,22 @@ public class GameCertificationActivity extends BaseActivity {
         }
         //获取登录过的用户列表
         userList.addAll(DDProviderHelper.getInstance().getSdkLoginUserList(SheepApp.getInstance().getConnectAddress().name()));
-        sdk_change_user_list.getAdapter().notifyDataSetChanged();
-        ViewUtil.setVisibility2(sdk_arrow, !userList.isEmpty());
+        listView.getAdapter().notifyDataSetChanged();
         if (!TextUtils.isEmpty(gameToken) && !userList.isEmpty()) {
-            for (SdkLoginUser temp : userList) {
-                if (temp.getToken().startsWith(gameToken)) {
-                    CommonUtil.getInstance().checkAuth(gameToken, new Action1<Boolean>() {
-                        @Override
-                        public void call(Boolean ret) {
-                            if (ret) {
-                                CertificationUtil.newInstance().doCertification(GameCertificationActivity.this, gameToken, packageName, "validate");
-                            } else {
-                                hasToken();
-                            }
+            SdkLoginUser gameUser = DDProviderHelper.getInstance().getSdkLoginUser(gameToken);
+            if (gameUser != null) {
+                gameToken = gameUser.getToken();
+                CommonUtil.getInstance().checkAuth(gameToken, new Action1<Boolean>() {
+                    @Override
+                    public void call(Boolean ret) {
+                        if (ret) {
+                            CertificationUtil.newInstance().doCertification(GameCertificationActivity.this, gameToken, packageName, "validate");
+                        } else {
+                            hasToken();
                         }
-                    });
-                    return;
-                }
+                    }
+                });
+                return;
             }
         }
         hasToken();
@@ -197,98 +144,31 @@ public class GameCertificationActivity extends BaseActivity {
         }
     }
 
-    //是否展开登录用户列表
-    private boolean isUserListOpen = false;
-
-    @OnClick({R.id.icon_iv, R.id.change_account_tv, R.id.change_commit, R.id.sdk_arrow})
-    public void onViewClicked(View view) {
-        switch (view.getId()) {
-            case R.id.sdk_arrow:
-                if (isUserListOpen) {//展开
-                    sdk_arrow.setRotation(0);
-                } else {
-                    sdk_arrow.setRotation(180);
-                }
-                isUserListOpen = !isUserListOpen;
-                ViewUtil.setVisibility(sdk_change_user_list, isUserListOpen);
-                break;
-            case R.id.icon_iv:
-                textProgressBar.setVisibility(View.GONE);
-                break;
-            case R.id.change_account_tv:
-                isChangeAccount = true;
-                Jump2View.getInstance().goLoginViewWithoutFinish(activity, SheepApp.getInstance().getGameCode());
-                break;
-            case R.id.change_commit:
-                commitChange();
-                break;
-        }
+    @OnClick({R.id.change_account_tv})
+    public void onChangeAccount(View view) {
+        Jump2View.getInstance().goLoginViewWithoutFinish(this, SheepApp.getInstance().getGameCode());
     }
 
     private void commitChange() {
-        if (userEntity == null) return;
-        CommonUtil.getInstance().checkAuth(currentToken, (ret) -> {
+        //todo
+        CommonUtil.getInstance().checkAuth("", (ret) -> {
             if (ret) {
                 loading_view_img.setVisibility(View.VISIBLE);
-                change_commit.setText(R.string.change_login_ing);
-                change_commit.setEnabled(false);
                 new Handler().postDelayed(() -> {
-                    if (!isChangeAccount) {
-                        CertificationUtil.newInstance().authCertificationCode(activity, currentToken);
-                    }
+                    //todo
+                    CertificationUtil.newInstance().authCertificationCode(this, "");
                 }, 2000);
             } else {
                 Toast.makeText(this, "授权有效期已过,需要重新登录", Toast.LENGTH_SHORT).show();
-                Jump2View.getInstance().goLoginViewWithoutFinish(activity, SheepApp.getInstance().getGameCode());
+                Jump2View.getInstance().goLoginViewWithoutFinish(this, SheepApp.getInstance().getGameCode());
             }
         });
     }
 
-    /**
-     * 是否登录
-     * 请求授权
-     */
     private void hasToken() {
-        if (TextUtils.isEmpty(SpUtils.getToken(SheepApp.getInstance()))) {
-            if (userList.isEmpty()) {
-                Jump2View.getInstance().goLoginViewWithoutFinish(activity, SheepApp.getInstance().getGameCode());
-            } else {
-                SdkLoginUser user = userList.get(0);
-                currentToken = user.getToken();
-                userEntity = new UserEntity();
-                userEntity.setNickname(user.getNickname());
-                userEntity.setInvitation_code(user.getInvitation_code());
-                userEntity.setAvatar(user.getAvatar());
-                userEntity.setLast_login_time("" + (TextUtils.isEmpty(user.getLastLoginTime()) ? System.currentTimeMillis() : user.getLastLoginTime()));
-                initWidget();
-            }
-        } else {
-            showProgress();
-            CommonUtil.getInstance().updateUserInfo(result -> {
-                hideProgress();
-                if (result == null) {
-                    if (userList.isEmpty()) {
-                        Jump2View.getInstance().goLoginView(activity, SheepApp.getInstance().getGameCode());
-                    }
-                } else {
-                    userEntity = result;
-                    initWidget();
-                }
-            });
-
-        }
-    }
-
-    /**
-     * 赋值
-     */
-    private void initWidget() {
-        ViewUtil.setText(sdk_user_name, userEntity.getNickname());
-        if (!TextUtils.isEmpty(userEntity.getUser_name())) {
-            ViewUtil.setText(sdk_user_name, userEntity.getNickname());
+        if (userList.isEmpty()) {
+            Jump2View.getInstance().goLoginViewWithoutFinish(this, SheepApp.getInstance().getGameCode());
         }
-        ViewUtil.setText(sdk_user_code, userEntity.getInvitation_code());
-        GlideImageLoader.setAvatar(sdk_user_iv, userEntity.getAvatar());
     }
 
     @Override
@@ -298,4 +178,105 @@ public class GameCertificationActivity extends BaseActivity {
             SheepApp.getInstance().setGameFlag(true);
         }
     }
+
+    private class SdkUserAdapter extends RecyclerView.Adapter<SdkUserHolder> {
+
+        @NonNull
+        @Override
+        public SdkUserHolder onCreateViewHolder(ViewGroup viewGroup, int type) {
+            View contentView = LayoutInflater.from(GameCertificationActivity.this).inflate(R.layout.include_item_sdk_user, viewGroup, false);
+            if (type == 0) {
+                RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) contentView.getLayoutParams();
+                layoutParams.topMargin = getResources().getDimensionPixelSize(R.dimen.game_certification_top_margin);
+                layoutParams.bottomMargin = getResources().getDimensionPixelSize(R.dimen.game_certification_bottom_margin);
+                contentView.setBackgroundResource(R.drawable.shape_white_solid_rectangle_5);
+            } else if (type == 1) {
+                contentView.setBackgroundResource(R.drawable.shape_white_solid_rectangle_5);
+            } else if (type == 2) {
+                contentView.setBackgroundResource(R.drawable.shape_white_solid_rectangle_top_5);
+            } else if (type == 3) {
+                contentView.setBackgroundResource(R.drawable.shape_white_solid_rectangle_bottom_5);
+            } else if (type == 4) {
+                contentView.setBackgroundColor(Color.WHITE);
+            }
+            return new SdkUserHolder(contentView);
+        }
+
+        @Override
+        public void onBindViewHolder(SdkUserHolder holder, int position) {
+            holder.bind(position, userList.get(position));
+        }
+
+        @Override
+        public int getItemCount() {
+            return userList.size();
+        }
+
+        @Override
+        public int getItemViewType(int position) {
+            if (position == 0) {
+                return 0;  // last login account
+            }
+            if (userList.size() == 2) {
+                return 1;  // 4 round
+            } else {
+                if (position == 1) {
+                    return 2; // top round
+                } else if (position == userList.size() - 1) {
+                    return 4; // bottom round
+                } else {
+                    return 3; // rect
+                }
+            }
+        }
+    }
+
+    public class SdkUserHolder extends RecyclerView.ViewHolder {
+
+        @BindView(R.id.item_sdk_nick_name)
+        TextView nicknameView;
+        @BindView(R.id.item_sdk_user_name)
+        TextView usernameView;
+        @BindView(R.id.item_sdk_user_code)
+        TextView sheepcodeView;
+        @BindView(R.id.last_login_flag)
+        View lastLoginFlag;
+        @BindView(R.id.item_sdk_user_line)
+        View seperator;
+        @BindView(R.id.item_sdk_user_iv)
+        ImageView iconView;
+
+        private SdkLoginUser user;
+
+        public SdkUserHolder(@NonNull View itemView) {
+            super(itemView);
+            ButterKnife.bind(this, itemView);
+            itemView.setOnClickListener(v -> {
+                user.setLastLoginTime((System.currentTimeMillis() / 1000) + "");
+                DDProviderHelper.getInstance().addOrUpdateSdkLoginUser(user, null);
+                CertificationUtil.newInstance().authCertificationCode(GameCertificationActivity.this, user.getToken());
+            });
+        }
+
+        public void bind(int position, SdkLoginUser user) {
+            this.user = user;
+            ViewUtil.setText(nicknameView, user.getNickname());
+            ViewUtil.setText(usernameView, TextUtils.isEmpty(user.getLoginname()) ? "" : "(" + user.getLoginname() + ")");
+            ViewUtil.setText(sheepcodeView, user.getInvitation_code());
+            GlideImageLoader.setAvatar(iconView, user.getAvatar());
+            ViewUtil.setVisibility(lastLoginFlag, position == 0);
+            ViewUtil.setVisibility(seperator, position > 1);
+        }
+
+        @OnClick(R.id.item_sdk_del_iv)
+        public void onItemDel(View v) {
+            DDProviderHelper.getInstance().deleteSdkLoginUser(user);
+            try {
+                userList.remove(user);
+                listView.getAdapter().notifyDataSetChanged();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
 }

+ 8 - 0
app/src/main/res/drawable/shape_white_solid_rectangle_bottom_5.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners
+        android:bottomLeftRadius="5dp"
+        android:bottomRightRadius="5dp" />
+    <solid android:color="#ffffff" />
+</shape>

+ 6 - 0
app/src/main/res/drawable/shape_white_solid_rectangle_top_5.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:topLeftRadius="5dp" android:topRightRadius="5dp"/>
+    <solid android:color="#ffffff" />
+</shape>

+ 36 - 85
app/src/main/res/layout/act_game_certification.xml

@@ -5,103 +5,54 @@
     android:layout_height="match_parent"
     android:background="#F5F5F5">
 
-    <android.support.v4.widget.NestedScrollView
+    <ImageView
+        android:id="@+id/icon_iv"
+        android:layout_width="@dimen/view_size_90"
+        android:layout_height="@dimen/view_size_90"
+        android:layout_centerHorizontal="true"
+        android:src="@mipmap/icon"
+        android:layout_marginTop="36dp" />
+
+    <TextView
+        android:id="@+id/app_name_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="20dp"
+        android:layout_marginTop="14dp"
+        android:layout_centerHorizontal="true"
+        android:text="小绵羊授权登录"
+        android:textColor="@color/black"
+        android:textSize="@dimen/text_size_16"
+        android:layout_below="@+id/icon_iv" />
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/sdk_change_user_list"
+        android:scrollbars="none"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_marginTop="?attr/actionBarSize"
-        android:layout_marginBottom="94dp"
-        android:scrollbars="none">
-
-        <android.support.constraint.ConstraintLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
-            <ImageView
-                android:id="@+id/icon_iv"
-                android:layout_width="@dimen/view_size_90"
-                android:layout_height="@dimen/view_size_90"
-                android:src="@mipmap/icon"
-                android:layout_marginTop="64dp"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent" />
-
-            <TextView
-                android:id="@+id/app_name_tv"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="14dp"
-                android:text="小绵羊授权登录"
-                android:textColor="@color/black"
-                android:textSize="@dimen/text_size_16"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toBottomOf="@+id/icon_iv" />
-
-            <include
-                android:id="@+id/sdk_change_user"
-                layout="@layout/include_sdk_user"
-                android:layout_width="match_parent"
-                android:layout_height="52dp"
-                android:layout_marginTop="63dp"
-                android:background="@color/white"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toBottomOf="@+id/app_name_tv" />
+        android:layout_marginLeft="12dp"
+        android:layout_marginRight="12dp"
+        android:layout_marginBottom="20dp"
+        android:layout_above="@+id/change_account_tv" />
 
-            <View
-                android:id="@+id/sdk_change_user_line"
-                android:layout_width="match_parent"
-                android:layout_height="1dp"
-                app:layout_constraintTop_toBottomOf="@+id/sdk_change_user" />
-
-            <android.support.v7.widget.RecyclerView
-                android:id="@+id/sdk_change_user_list"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:background="@color/white"
-                app:layout_constraintTop_toBottomOf="@+id/sdk_change_user_line" />
-
-            <TextView
-                android:id="@+id/change_account_tv"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="1dp"
-                android:background="@color/white"
-                android:paddingStart="35dp"
-                android:paddingTop="22dp"
-                android:paddingEnd="35dp"
-                android:paddingBottom="22dp"
-                android:text="添加账号"
-                android:textColor="#36A5ED"
-                android:textSize="14sp"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toBottomOf="@+id/sdk_change_user_list"
-                app:layout_constraintBottom_toBottomOf="parent"/>
-
-        </android.support.constraint.ConstraintLayout>
-
-    </android.support.v4.widget.NestedScrollView>
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="94dp"
-        android:layout_alignParentBottom="true"
-        android:background="#F5F5F5"/>
     <TextView
-        android:id="@+id/change_commit"
+        android:id="@+id/change_account_tv"
         style="@style/style_button_full"
-        android:layout_height="36dp"
+        android:layout_width="wrap_content"
+        android:layout_height="40dp"
         android:layout_alignParentBottom="true"
-        android:layout_marginStart="36dp"
-        android:layout_marginEnd="36dp"
-        android:layout_marginBottom="29dp"
-        android:text="授权登录" />
+        android:paddingLeft="50dp"
+        android:paddingRight="50dp"
+        android:background="@drawable/round_main_r25"
+        android:layout_centerHorizontal="true"
+        android:layout_marginBottom="24dp"
+        android:text="添加账号" />
 
     <com.github.ybq.android.spinkit.SpinKitView
         android:id="@+id/loading_view_img"
         style="@style/SpinKitView.Large.ThreeBounce"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_above="@+id/change_commit"
+        android:layout_above="@+id/change_account_tv"
         android:layout_centerHorizontal="true"
         android:visibility="invisible"
         app:SpinKit_Color="@color/colorAccent" />

+ 35 - 11
app/src/main/res/layout/include_item_sdk_user.xml

@@ -5,7 +5,7 @@
     android:background="@color/white">
 
     <ImageView
-        android:id="@+id/item_sdk_arrow"
+        android:id="@+id/item_sdk_del_iv"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:paddingStart="10dp"
@@ -19,16 +19,27 @@
         android:layout_width="44dp"
         android:layout_height="44dp"
         android:layout_centerVertical="true"
-        android:layout_toStartOf="@+id/item_sdk_arrow"
+        android:layout_toStartOf="@+id/item_sdk_del_iv"
         android:paddingTop="8dp"
         android:paddingBottom="8dp"
         android:src="@drawable/loading_01" />
 
+    <TextView
+        android:id="@+id/last_login_flag"
+        android:text="上次登录"
+        android:textColor="#999999"
+        android:textSize="14sp"
+        android:layout_marginRight="4dp"
+        android:layout_toLeftOf="@+id/item_sdk_user_iv"
+        android:layout_centerVertical="true"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_marginStart="35dp"
-        android:layout_marginEnd="35dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginEnd="16dp"
         android:layout_toStartOf="@+id/item_sdk_user_iv"
         android:gravity="center_vertical"
         android:orientation="vertical">
@@ -38,13 +49,26 @@
             android:layout_height="0dp"
             android:layout_weight="1" />
 
-        <TextView
-            android:id="@+id/item_sdk_user_name"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="账号"
-            android:textColor="#000000"
-            android:textSize="14sp" />
+        <LinearLayout
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content">
+            <TextView
+                android:id="@+id/item_sdk_nick_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="账号"
+                android:textColor="#000000"
+                android:textSize="14sp" />
+            <TextView
+                android:id="@+id/item_sdk_user_name"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:textColor="#000000"
+                android:textSize="12sp" />
+        </LinearLayout>
 
         <View
             android:layout_width="match_parent"

+ 1 - 2
app/src/main/res/layout/include_sdk_user.xml

@@ -23,7 +23,7 @@
         android:layout_toStartOf="@+id/sdk_arrow"
         android:paddingTop="8dp"
         android:paddingBottom="8dp"
-        android:src="@drawable/loading_01" />
+        android:src="@mipmap/share_wx" />
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -55,7 +55,6 @@
                 android:layout_marginLeft="8dp"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:text="(账号)"
                 android:textColor="#000000"
                 android:textSize="12sp" />
         </LinearLayout>

+ 3 - 1
app/src/main/res/values/dimen_app_dimens.xml

@@ -18,7 +18,9 @@
     <!--title-->
 
     <!--spacing-->
-
+    <dimen name="game_certification_scroll">100dp</dimen>
+    <dimen name="game_certification_top_margin">176dp</dimen>
+    <dimen name="game_certification_bottom_margin">16dp</dimen>
     <!--radius-->
 
     <!--item avatar-->