Bladeren bron

功能开发:注销功能调试

Sora 1 jaar geleden
bovenliggende
commit
5e692af5eb

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -28,7 +28,7 @@ import retrofit2.http.Streaming;
  * Created by ljy on 2018/3/8.
  */
 public interface ApiService {
-    
+
     /**
      * @param jsonObject
      * @return
@@ -321,8 +321,6 @@ public interface ApiService {
     Observable<BaseMessage> LoginByWX(@Body com.alibaba.fastjson.JSONObject jsonObject);
 
 
-
-
     /**
      * qq登录
      *
@@ -2022,4 +2020,6 @@ public interface ApiService {
     @GET("v1/app/auth/refresh_access_token")
     Observable<BaseMessage> refresh_qqgame_wx_token(@Query("access_token") String access_token);
 
+    @POST("/v1/app/user/destroy")
+    Observable<BaseMessage> destroyAccount();
 }

+ 65 - 35
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -1,5 +1,12 @@
 package com.sheep.gamegroup.util;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECEIVE_AWARD_GAME_TASK;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.XIAOMI_GAME_RECEIVE;
+import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST;
+import static com.sheep.gamegroup.view.adapter.WelfareAdapter.TO_REFRESH;
+import static com.sheep.jiuyan.samllsheep.utils.ClassFileHelper.DIR;
+
 import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.content.Context;
@@ -10,10 +17,6 @@ import android.graphics.drawable.GradientDrawable;
 import android.net.Uri;
 import android.os.Handler;
 import android.os.Message;
-import com.google.android.material.tabs.TabLayout;
-import androidx.appcompat.app.AlertDialog;
-import androidx.recyclerview.widget.GridLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
 import android.text.Html;
 import android.text.TextUtils;
 import android.util.Log;
@@ -28,8 +31,14 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
 import com.alibaba.fastjson.JSONObject;
 import com.alipay.sdk.app.PayTask;
+import com.google.android.material.tabs.TabLayout;
 import com.kfzs.duanduan.cardview.ScreenUtil;
 import com.kfzs.duanduan.utils.ApkUtils;
 import com.mdad.sdk.mdsdk.AdManager;
@@ -48,6 +57,7 @@ import com.sheep.gamegroup.greendao.download.SheepAd;
 import com.sheep.gamegroup.helper.TaskHelper;
 import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.CommendTask;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.Ext;
 import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
@@ -57,7 +67,6 @@ import com.sheep.gamegroup.model.entity.GameListTag;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.Release_task;
-import com.sheep.gamegroup.model.entity.CommendTask;
 import com.sheep.gamegroup.model.entity.RouserArticlesEntity;
 import com.sheep.gamegroup.model.entity.SlideshowEty;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
@@ -127,13 +136,6 @@ import okhttp3.Call;
 import rx.functions.Action1;
 import rx.functions.Action2;
 
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECEIVE_AWARD_GAME_TASK;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.XIAOMI_GAME_RECEIVE;
-import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST;
-import static com.sheep.gamegroup.view.adapter.WelfareAdapter.TO_REFRESH;
-import static com.sheep.jiuyan.samllsheep.utils.ClassFileHelper.DIR;
-
 /**
  * 一些公用的class
  * Created by ljy on 2018/3/21.
@@ -753,6 +755,33 @@ public class CommonUtil {
         getUserInfo(true, null);
     }
 
+    /**
+     * 注销账号
+     */
+    public void destroyAccount(Action1<Boolean> callback) {
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .destroyAccount()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if (baseMessage.getCode() == 0) {
+                            callback.call(true);
+                        } else {
+                            callback.call(false);
+                        }
+                    }
+                });
+    }
+
     public void getUserInfo(boolean force, Action1<UserEntity> callback) {
         if (!force && DataUtil.getInstance().getUserEntity() != null) {
             callback.call(DataUtil.getInstance().getUserEntity());
@@ -1061,22 +1090,22 @@ public class CommonUtil {
         }
         final String payParam = payInfo;
         Observable.create(new ObservableOnSubscribe<String>() {
-            @Override
-            public void subscribe(ObservableEmitter<String> emitter) throws Exception {
-                PayTask alipay = new PayTask(activity);
-                // 调用支付接口,获取支付结果
-                Map<String, String> result = alipay.payV2(payParam, b);
-                PayResult payResult = new PayResult(result);
-                /**
-                 * 同步返回的结果必须放置到服务端进行验证(验证的规则请看https://doc.open.alipay.com/doc2/
-                 * detail.htm?spm=0.0.0.0.xdvAU6&treeId=59&articleId=103665&
-                 * docType=1) 建议商户依赖异步通知
-                 */
+                    @Override
+                    public void subscribe(ObservableEmitter<String> emitter) throws Exception {
+                        PayTask alipay = new PayTask(activity);
+                        // 调用支付接口,获取支付结果
+                        Map<String, String> result = alipay.payV2(payParam, b);
+                        PayResult payResult = new PayResult(result);
+                        /**
+                         * 同步返回的结果必须放置到服务端进行验证(验证的规则请看https://doc.open.alipay.com/doc2/
+                         * detail.htm?spm=0.0.0.0.xdvAU6&treeId=59&articleId=103665&
+                         * docType=1) 建议商户依赖异步通知
+                         */
 //						String resultInfo = payResult.getResult();// 同步返回需要验证的信息
-                String resultStatus = payResult.getResultStatus();
-                emitter.onNext(resultStatus);
-            }
-        }).subscribeOn(Schedulers.io())
+                        String resultStatus = payResult.getResultStatus();
+                        emitter.onNext(resultStatus);
+                    }
+                }).subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(observer);
     }
@@ -1359,6 +1388,7 @@ public class CommonUtil {
                             action.call(taskAcceptedEty);
                         }
                     }
+
                     @Override
                     public void onError(BaseMessage baseMessage) {
                         action.call(null);
@@ -2350,19 +2380,19 @@ public class CommonUtil {
                         try {
                             List<SheepAd> ads = baseMessage.getDatas(SheepAd.class);
                             if (ads != null && ads.size() > 0) {
-                                Log.d("!!!!!!","拉到广告,闪屏页不为空");
+                                Log.d("!!!!!!", "拉到广告,闪屏页不为空");
                                 if (action != null) {
                                     action.call(ads.get(0));
                                 }
                             } else {
-                                Log.d("!!!!!!","拉到广告,闪屏页为空");
+                                Log.d("!!!!!!", "拉到广告,闪屏页为空");
                                 if (action != null) {
                                     action.call(null);
                                 }
                             }
 
                         } catch (Exception e) {
-                            Log.d("!!!!!!","拉到广告,报了个错"+e.getMessage());
+                            Log.d("!!!!!!", "拉到广告,报了个错" + e.getMessage());
                             e.printStackTrace();
                             if (action != null)
                                 action.call(null);
@@ -2520,7 +2550,7 @@ public class CommonUtil {
                 });
     }
 
-    public void getNewbieTaskReward(int id, Action1<Boolean> action){
+    public void getNewbieTaskReward(int id, Action1<Boolean> action) {
         SheepApp.getInstance().getNetComponent().getApiService().getNewbieTaskReward(id)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
@@ -2635,7 +2665,7 @@ public class CommonUtil {
                 Jump2View.getInstance().goSimpleGift(activity, null);
                 break;
             case GO_HIGH_TASK:
-                Jump2View.getInstance().goXianWanWeb(activity,null);
+                Jump2View.getInstance().goXianWanWeb(activity, null);
                 break;
             case 2: // 单个任务详情
                 ext = EntityUtils.getExtInfo(extString);
@@ -3168,9 +3198,9 @@ public class CommonUtil {
                     dialogConfig.setMsg("已经复制如下内容:\n" + textString + "\n,是否尝试跳转?")
                             .setBtnLeftText("确定").setBtnLeftOnClickListener(view -> Jump2View.getInstance().tryGotoDeepLink(textString))
                             .setBtnRightText("仅一次").setBtnRightOnClickListener(view -> {
-                        closeListener.onClick(view);
-                        Jump2View.getInstance().tryGotoDeepLink(textString);
-                    });
+                                closeListener.onClick(view);
+                                Jump2View.getInstance().tryGotoDeepLink(textString);
+                            });
                     ViewUtil.showMsgDialog(SheepApp.getInstance().getCurrentActivity(), dialogConfig);
                 }
             } else if (TestUtil.isDev()) {

+ 118 - 89
app/src/main/java/com/sheep/gamegroup/view/activity/ActSetting.java

@@ -4,12 +4,14 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN_SURE;
 
 import android.app.Activity;
+import android.app.AlertDialog;
 import android.content.Intent;
 import android.net.Uri;
 import android.text.TextUtils;
+import android.view.LayoutInflater;
 import android.view.View;
-import android.widget.ImageView;
-import android.widget.TextView;
+
+import androidx.viewbinding.ViewBinding;
 
 import com.kfzs.duanduan.utils.ApkUtils;
 import com.sheep.gamegroup.absBase.AbsObserver;
@@ -28,13 +30,13 @@ import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.Config;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.databinding.ActSettingBinding;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
-import butterknife.BindView;
-import butterknife.OnClick;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
+import rx.functions.Action1;
 
 /**
  * Created by realicing on 2018/04/.
@@ -42,19 +44,21 @@ import io.reactivex.schedulers.Schedulers;
  */
 public class ActSetting extends BaseActivity {
 
-    @BindView(R.id.pay_pwd_flag)
-    TextView payPwdFlag;
     private Activity activity;
-    @BindView(R.id.check_upgrade_view)
-    TextView check_upgrade_view;
-    @BindView(R.id.execute_upgrade_btn)
-    TextView execute_upgrade_btn;
 
     @Override
     protected int getLayoutId() {
         return R.layout.act_setting;
     }
 
+    ActSettingBinding binding;
+
+    @Override
+    protected ViewBinding getViewBinding() {
+        binding = ActSettingBinding.inflate(LayoutInflater.from(this));
+        return binding;
+    }
+
     @Override
     protected boolean showWhiteStatusBar() {
         return true;
@@ -70,24 +74,54 @@ public class ActSetting extends BaseActivity {
 
     }
 
+    //注销账号
+    private void goDestroyAccount(View view) {
+        AlertDialog dialog = new AlertDialog.Builder(this)
+                .setTitle("注销账号")
+                .setMessage("确认要注销当前账号吗?注销后将无法登录游戏。")
+                .setNegativeButton("取消", null).setPositiveButton("确定", (dialogInterface, i) -> {
+                    CommonUtil.getInstance().destroyAccount(new Action1<Boolean>() {
+                        @Override
+                        public void call(Boolean aBoolean) {
+                            if (aBoolean) {
+                                CommonUtil.getInstance().loginOut((BaseActivity) activity);
+                            }
+                        }
+                    });
+                })
+                .show();
+    }
+
     public void onResume() {
         super.onResume();
         CommonUtil.getInstance().getUserInfo(false, (user) -> {
             if (user.hasPayPwd()) {
-                ViewUtil.setText(payPwdFlag, "去关闭");
-                ViewUtil.setOnClickListener(payPwdFlag, v -> {
+                ViewUtil.setText(binding.payPwdFlag, "去关闭");
+                ViewUtil.setOnClickListener(binding.payPwdFlag, v -> {
                     ActPayPassword.clearPwd(activity);
                 });
             } else {
-                ViewUtil.setText(payPwdFlag, "未设置");
-                ViewUtil.setOnClickListener(payPwdFlag, null);
+                ViewUtil.setText(binding.payPwdFlag, "未设置");
+                ViewUtil.setOnClickListener(binding.payPwdFlag, null);
             }
         });
     }
 
     @Override
     public void initListener() {
-
+        binding.changePasswordLayout.setOnClickListener(this::goChangePassword);
+        binding.payPwdLayout.setOnClickListener(this::setPayPassword);
+        binding.abourtUsLayout.setOnClickListener(this::goAboutUs);
+        binding.clearLayout.setOnClickListener(this::clearCache);
+        binding.tvSubmit.setOnClickListener(this::loginOut);
+        binding.copyTextLayout.setOnClickListener(this::toggleCopyText);
+        binding.changeLayout.setOnClickListener(this::goVersionChange);
+        binding.feedbackLayout.setOnClickListener(this::goFeedback);
+        binding.checkUpgradeView.setOnClickListener(this::checkUpgrade);
+        binding.executeUpgradeBtn.setOnClickListener(this::checkUpgrade);
+        binding.privacyPolicy.setOnClickListener(this::openPrivacyPolicy);
+        binding.personAgreement.setOnClickListener(this::openPersonAgreement);
+        binding.destroyAccount.setOnClickListener(this::goDestroyAccount);
     }
 
     @Override
@@ -107,99 +141,94 @@ public class ActSetting extends BaseActivity {
                         Version version = baseMessage.getData(Version.class);
                         int versionCode = ApkUtils.getCurrentPkgVersionCode(ActSetting.this);
                         if (versionCode == version.getVersion_number()) {
-                            ViewUtil.setText(check_upgrade_view, "已经是最新版本: V" + ApkUtils.getCurrentPkgVersionName(ActSetting.this));
-                            ViewUtil.setVisibility(execute_upgrade_btn, false);
+                            ViewUtil.setText(binding.checkUpgradeView, "已经是最新版本: V" + ApkUtils.getCurrentPkgVersionName(ActSetting.this));
+                            ViewUtil.setVisibility(binding.executeUpgradeBtn, false);
                         } else {
-                            ViewUtil.setText(check_upgrade_view, "发现新版本: V" + version.getVersion_name());
-                            ViewUtil.setVisibility(execute_upgrade_btn, true);
+                            ViewUtil.setText(binding.checkUpgradeView, "发现新版本: V" + version.getVersion_name());
+                            ViewUtil.setVisibility(binding.executeUpgradeBtn, true);
                         }
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        ViewUtil.setText(check_upgrade_view, "当前版本: V" + ApkUtils.getCurrentPkgVersionName(ActSetting.this));
-                        ViewUtil.setVisibility(execute_upgrade_btn, false);
+                        ViewUtil.setText(binding.checkUpgradeView, "当前版本: V" + ApkUtils.getCurrentPkgVersionName(ActSetting.this));
+                        ViewUtil.setVisibility(binding.executeUpgradeBtn, false);
                     }
                 });
     }
 
-    @OnClick({R.id.change_password_layout, R.id.pay_pwd_layout, R.id.abourt_us_layout, R.id.clear_layout,
-            R.id.tv_submit, R.id.copy_text_layout, R.id.change_layout, R.id.feedback_layout,
-            R.id.check_upgrade_view, R.id.execute_upgrade_btn, R.id.privacy_policy, R.id.person_agreement})
-    public void onClick(View view) {
-        switch (view.getId()) {
-            case R.id.change_password_layout:
-                Jump2View.getInstance().goChangePassword(activity);
-                break;
-            case R.id.pay_pwd_layout:
-                ActPayPassword.setPwd(activity);
-                break;
-            case R.id.abourt_us_layout://关于我们
-                Jump2View.getInstance().goNewAboutUs(activity);
-                break;
-            case R.id.change_layout://新功能介绍
-                Jump2View.getInstance().goVersionChange(activity, ApkUtils.getCurrentPkgVersionName(SheepApp.getInstance()));
-                break;
-            case R.id.copy_text_layout://粘贴板助手
-                boolean opened = DataUtil.toggleAsBoolean(Config.KEY_ENABLE_CHECK_COPY_TEXT, Config.dvbEnableCheckCopyText());
-                initCopyState();
-                if (opened) {
-                    ViewUtil.showMsgDialog(activity, getString(R.string.copy_assistant_tip));
-                }
-                break;
-            case R.id.clear_layout://清除缓存
-                ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("清除缓存").setMsg("所有本地的缓存都会被清理").setBtnRightText("取消")
-                        .setBtnLeftText("确定").setBtnLeftOnClickListener(view1 -> {
-                            USER_CLEAN_SURE.onEvent();
-                            SysAppUtil.clearCache(new AbsObserver<Object>() {
-                                @Override
-                                public void onNext(Object o) {
-                                    DataUtil.putAsInt(DataKey.KEY_ORDER, 1);
-                                    G.showToast("清理缓存完成");
-                                    initCacheSize();
-                                }
-                            });
-                        }));
-                USER_CLEAN.onEvent();
-                break;
-            case R.id.tv_submit:
-                CommonUtil.getInstance().loginOut((BaseActivity) activity);
-                break;
-            case R.id.feedback_layout:
-                Jump2View.getInstance().goFeedbackAct(activity);
-                break;
-            case R.id.execute_upgrade_btn:
-                SysAppUtil.showVersionInfo(this, null);
-                break;
-            case R.id.check_upgrade_view:
-                SysAppUtil.showVersionInfo(this, null);
-                break;
-            case R.id.privacy_policy:
-                startActivity(new Intent()
-                        .setAction(Intent.ACTION_VIEW)
-                        .setData(Uri.parse("http://ysxy.17xmy.com/yinsizhengce.html")));
-                break;
-            case R.id.person_agreement:
-                startActivity(new Intent()
-                        .setAction(Intent.ACTION_VIEW)
-                        .setData(Uri.parse("http://ysxy.17xmy.com/yonghuxieyi.html")));
-                break;
+
+    private void goChangePassword(View v) {
+        Jump2View.getInstance().goChangePassword(activity);
+    }
+
+    private void setPayPassword(View v) {
+        ActPayPassword.setPwd(activity);
+    }
+
+    private void goAboutUs(View v) {
+        Jump2View.getInstance().goNewAboutUs(activity);
+    }
+
+    private void goVersionChange(View v) {
+        Jump2View.getInstance().goVersionChange(activity, ApkUtils.getCurrentPkgVersionName(SheepApp.getInstance()));
+    }
+
+    private void toggleCopyText(View v) {
+        boolean opened = DataUtil.toggleAsBoolean(Config.KEY_ENABLE_CHECK_COPY_TEXT, Config.dvbEnableCheckCopyText());
+        initCopyState();
+        if (opened) {
+            ViewUtil.showMsgDialog(activity, getString(R.string.copy_assistant_tip));
         }
     }
 
-    @BindView(R.id.clear_item_tv)
-    TextView clear_item_tv;
+    private void clearCache(View v) {
+        ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("清除缓存").setMsg("所有本地的缓存都会被清理").setBtnRightText("取消")
+                .setBtnLeftText("确定").setBtnLeftOnClickListener(view1 -> {
+                    USER_CLEAN_SURE.onEvent();
+                    SysAppUtil.clearCache(new AbsObserver<Object>() {
+                        @Override
+                        public void onNext(Object o) {
+                            DataUtil.putAsInt(DataKey.KEY_ORDER, 1);
+                            G.showToast("清理缓存完成");
+                            initCacheSize();
+                        }
+                    });
+                }));
+        USER_CLEAN.onEvent();
+    }
+
+    private void loginOut(View v) {
+        CommonUtil.getInstance().loginOut((BaseActivity) activity);
+    }
+
+    private void goFeedback(View v) {
+        Jump2View.getInstance().goFeedbackAct(activity);
+    }
+
+    private void checkUpgrade(View v) {
+        SysAppUtil.showVersionInfo(this, null);
+    }
+
+    private void openPrivacyPolicy(View v) {
+        startActivity(new Intent()
+                .setAction(Intent.ACTION_VIEW)
+                .setData(Uri.parse("http://ysxy.17xmy.com/yinsizhengce.html")));
+    }
+
+    private void openPersonAgreement(View v) {
+        startActivity(new Intent()
+                .setAction(Intent.ACTION_VIEW)
+                .setData(Uri.parse("http://ysxy.17xmy.com/yonghuxieyi.html")));
+    }
 
     private void initCacheSize() {
         String size = SysAppUtil.getAppCacheSize();
-        clear_item_tv.setText(TextUtils.isEmpty(size) || TextUtils.equals("0K", size) ? "无需清理" : size);
+        binding.clearItemTv.setText(TextUtils.isEmpty(size) || TextUtils.equals("0K", size) ? "无需清理" : size);
     }
 
-    @BindView(R.id.copy_text_iv)
-    ImageView copy_text_iv;
-
     private void initCopyState() {
-        ViewUtil.setImageRes(copy_text_iv, DataUtil.getAsBoolean(Config.KEY_ENABLE_CHECK_COPY_TEXT, Config.dvbEnableCheckCopyText()) ? R.mipmap.toggle_open : R.mipmap.toggle_close);
+        ViewUtil.setImageRes(binding.copyTextIv, DataUtil.getAsBoolean(Config.KEY_ENABLE_CHECK_COPY_TEXT, Config.dvbEnableCheckCopyText()) ? R.mipmap.toggle_open : R.mipmap.toggle_close);
     }
 
 }

+ 154 - 128
app/src/main/res/layout/act_setting.xml

@@ -6,189 +6,215 @@
     android:fitsSystemWindows="true"
     android:orientation="vertical">
 
-    <LinearLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/content_padding"
-        android:layout_marginBottom="@dimen/content_padding_15"
-        android:background="@color/white"
-        android:orientation="vertical">
+        android:layout_height="match_parent">
 
         <LinearLayout
-            android:id="@+id/change_password_layout"
-            style="@style/style_item_container">
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/content_padding"
+            android:layout_marginBottom="@dimen/content_padding_15"
+            android:background="@color/white"
+            android:orientation="vertical">
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="修改密码" />
+            <LinearLayout
+                android:id="@+id/change_password_layout"
+                style="@style/style_item_container">
 
-            <TextView style="@style/style_item_end_next" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="修改密码" />
 
-        </LinearLayout>
+                <TextView style="@style/style_item_end_next" />
 
-        <View style="@style/style_item_line" />
+            </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/pay_pwd_layout"
-            style="@style/style_item_container">
+            <View style="@style/style_item_line" />
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="支付密码" />
+            <LinearLayout
+                android:id="@+id/pay_pwd_layout"
+                style="@style/style_item_container">
 
-            <TextView
-                android:id="@+id/pay_pwd_flag"
-                style="@style/style_item_label"
-                android:gravity="right"
-                android:text="已设置"
-                android:textColor="@color/black_999999"
-                android:textSize="12sp" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="支付密码" />
 
-            <TextView style="@style/style_item_end_next" />
+                <TextView
+                    android:id="@+id/pay_pwd_flag"
+                    style="@style/style_item_label"
+                    android:gravity="right"
+                    android:text="已设置"
+                    android:textColor="@color/black_999999"
+                    android:textSize="12sp" />
 
-        </LinearLayout>
+                <TextView style="@style/style_item_end_next" />
 
-        <View style="@style/style_item_line" />
+            </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/copy_text_layout"
-            style="@style/style_item_container">
+            <View style="@style/style_item_line" />
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="@string/copy_assistant" />
+            <LinearLayout
+                android:id="@+id/copy_text_layout"
+                style="@style/style_item_container">
 
-            <ImageView
-                android:id="@+id/copy_text_iv"
-                android:layout_width="50dp"
-                android:layout_height="30dp"
-                android:src="@mipmap/toggle_open" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="@string/copy_assistant" />
 
-        </LinearLayout>
+                <ImageView
+                    android:id="@+id/copy_text_iv"
+                    android:layout_width="50dp"
+                    android:layout_height="30dp"
+                    android:src="@mipmap/toggle_open" />
 
+            </LinearLayout>
 
-        <View style="@style/style_item_line" />
 
-        <LinearLayout
-            android:id="@+id/clear_layout"
-            style="@style/style_item_container">
+            <View style="@style/style_item_line" />
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="清除缓存" />
+            <LinearLayout
+                android:id="@+id/clear_layout"
+                style="@style/style_item_container">
 
-            <TextView
-                android:id="@+id/clear_item_tv"
-                style="@style/style_item_end"
-                android:text="128MB" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="清除缓存" />
 
-        </LinearLayout>
+                <TextView
+                    android:id="@+id/clear_item_tv"
+                    style="@style/style_item_end"
+                    android:text="128MB" />
 
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/content_padding"
-            android:background="@color/white_light"
-            android:minHeight="1px" />
+            </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/version_layout"
-            style="@style/style_item_container">
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/content_padding"
+                android:background="@color/white_light"
+                android:minHeight="1px" />
 
-            <TextView
-                android:id="@+id/check_upgrade_view"
-                style="@style/style_item_label"
-                android:text="检查版本更新" />
+            <LinearLayout
+                android:id="@+id/version_layout"
+                style="@style/style_item_container">
 
-            <TextView
-                android:id="@+id/execute_upgrade_btn"
-                android:layout_width="wrap_content"
-                android:layout_height="26dp"
-                android:background="@drawable/round_main_r25"
-                android:gravity="center"
-                android:paddingLeft="10dp"
-                android:paddingRight="10dp"
-                android:text="立即更新"
-                android:textColor="@color/white"
-                android:textSize="14sp"
-                android:visibility="gone" />
+                <TextView
+                    android:id="@+id/check_upgrade_view"
+                    style="@style/style_item_label"
+                    android:text="检查版本更新" />
 
+                <TextView
+                    android:id="@+id/execute_upgrade_btn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="26dp"
+                    android:background="@drawable/round_main_r25"
+                    android:gravity="center"
+                    android:paddingLeft="10dp"
+                    android:paddingRight="10dp"
+                    android:text="立即更新"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
 
-        </LinearLayout>
 
-        <View style="@style/style_item_line" />
+            </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/change_layout"
-            style="@style/style_item_container">
+            <View style="@style/style_item_line" />
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="新功能介绍" />
+            <LinearLayout
+                android:id="@+id/change_layout"
+                style="@style/style_item_container">
 
-            <TextView style="@style/style_item_end_next" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="新功能介绍" />
 
-        </LinearLayout>
+                <TextView style="@style/style_item_end_next" />
 
-        <View style="@style/style_item_line" />
+            </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/abourt_us_layout"
-            style="@style/style_item_container">
+            <View style="@style/style_item_line" />
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="关于我们" />
+            <LinearLayout
+                android:id="@+id/abourt_us_layout"
+                style="@style/style_item_container">
 
-            <TextView style="@style/style_item_end_next" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="关于我们" />
 
-        </LinearLayout>
+                <TextView style="@style/style_item_end_next" />
 
-        <View style="@style/style_item_line" />
+            </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/privacy_policy"
-            style="@style/style_item_container">
+            <View style="@style/style_item_line" />
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="隐私政策" />
+            <LinearLayout
+                android:id="@+id/privacy_policy"
+                style="@style/style_item_container">
 
-            <TextView style="@style/style_item_end_next" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="隐私政策" />
 
-        </LinearLayout>
+                <TextView style="@style/style_item_end_next" />
 
-        <View style="@style/style_item_line" />
+            </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/person_agreement"
-            style="@style/style_item_container">
+            <View style="@style/style_item_line" />
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="用户协议" />
+            <LinearLayout
+                android:id="@+id/person_agreement"
+                style="@style/style_item_container">
 
-            <TextView style="@style/style_item_end_next" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="用户协议" />
 
-        </LinearLayout>
+                <TextView style="@style/style_item_end_next" />
 
-        <View style="@style/style_item_line" />
+            </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/feedback_layout"
-            style="@style/style_item_container">
+            <View style="@style/style_item_line" />
 
-            <TextView
-                style="@style/style_item_label"
-                android:text="意见反馈" />
+            <LinearLayout
+                android:id="@+id/feedback_layout"
+                style="@style/style_item_container">
 
-            <TextView style="@style/style_item_end_next" />
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="意见反馈" />
+
+                <TextView style="@style/style_item_end_next" />
+
+            </LinearLayout>
+
+            <View style="@style/style_item_line" />
+
+            <LinearLayout
+                android:id="@+id/destroy_account"
+                style="@style/style_item_container">
+
+                <TextView
+                    style="@style/style_item_label"
+                    android:text="注销账号" />
+
+                <TextView style="@style/style_item_end_next" />
+
+            </LinearLayout>
+
+            <View style="@style/style_item_line" />
+
+            <TextView
+                android:id="@+id/tv_submit"
+                style="@style/style_button"
+                android:text="退出登录" />
 
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="64dp" />
         </LinearLayout>
+    </ScrollView>
 
-    </LinearLayout>
 
-    <TextView
-        android:id="@+id/tv_submit"
-        style="@style/style_button"
-        android:text="退出登录" />
 </LinearLayout>

+ 145 - 134
app/src/main/res/layout/xpersion_info_act_layout.xml

@@ -1,275 +1,286 @@
 <?xml version="1.0" encoding="utf-8"?>
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-             android:id="@+id/fl_root"
-             android:layout_width="match_parent"
-             android:layout_height="match_parent">
-
-    <ScrollView android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:fitsSystemWindows="true"
-                android:scrollbars="none"
-                android:background="@color/bg">
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/fl_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/bg"
+        android:fitsSystemWindows="true"
+        android:scrollbars="none">
 
         <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:orientation="vertical">
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical">
 
             <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginBottom="@dimen/content_padding_15"
-                    android:layout_marginTop="@dimen/content_padding"
-                    android:background="@color/white"
-                    android:orientation="vertical">
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/content_padding"
+                android:background="@color/white"
+                android:orientation="vertical">
 
                 <LinearLayout
-                        android:id="@+id/personal_info_avatar_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_avatar_container"
+                    style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/header"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/header" />
 
 
                     <ImageView
-                            android:id="@+id/personal_info_avatar"
-                            android:layout_width="33dp"
-                            android:layout_height="33dp"
-                            android:src="@mipmap/icon"/>
+                        android:id="@+id/personal_info_avatar"
+                        android:layout_width="33dp"
+                        android:layout_height="33dp"
+                        android:src="@mipmap/icon" />
 
-                    <TextView style="@style/style_item_end_next"/>
+                    <TextView style="@style/style_item_content_person_info" />
 
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View style="@style/style_item_line_3_0" />
 
                 <LinearLayout
-                        android:id="@+id/personal_info_loginname_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_loginname_container"
+                    style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/loginname"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/loginname" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_loginname"
-                            style="@style/style_item_end_next"/>
+                        android:id="@+id/personal_info_loginname"
+                        style="@style/style_item_content_person_info"
+                        tools:text="占位" />
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View style="@style/style_item_line_3_0" />
 
                 <LinearLayout
-                        android:id="@+id/personal_info_name_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_name_container"
+                    style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/niker"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/niker" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_name"
-                            style="@style/style_item_end_next"/>
+                        android:id="@+id/personal_info_name"
+                        style="@style/style_item_content_person_info"
+                        tools:text="占位" />
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View style="@style/style_item_line_3_0" />
 
                 <LinearLayout style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/sheep_id"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/sheep_id" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_code"
-                            style="@style/style_item_end_next"
-                            android:textIsSelectable="true"/>
+                        android:id="@+id/personal_info_code"
+                        style="@style/style_item_content_person_info"
+                        android:textIsSelectable="true"
+                        tools:text="占位" />
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View style="@style/style_item_line_3_0" />
 
                 <LinearLayout
-                        android:id="@+id/llayout_sex"
-                        style="@style/style_item_container">
+                    android:id="@+id/llayout_sex"
+                    style="@style/style_item_container"
+                    android:visibility="gone">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/sex"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/sex" />
 
 
                     <TextView
-                            android:id="@+id/tv_sex"
-                            style="@style/style_item_end_next"
-                            android:layout_width="150dp"/>
+                        android:id="@+id/tv_sex"
+                        style="@style/style_item_content_person_info"
+                        android:layout_width="150dp"
+                        tools:text="性别" />
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View
+                    style="@style/style_item_line_3_0"
+                    android:visibility="gone" />
 
                 <LinearLayout
-                        android:id="@+id/llayout_birthday"
-                        style="@style/style_item_container">
+                    android:id="@+id/llayout_birthday"
+                    style="@style/style_item_container"
+                    android:visibility="gone">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/birth_day"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/birth_day" />
 
 
                     <TextView
-                            android:id="@+id/tv_birthday"
-                            style="@style/style_item_end_next"/>
+                        android:id="@+id/tv_birthday"
+                        style="@style/style_item_content_person_info"
+                        tools:text="出生年月日" />
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View
+                    style="@style/style_item_line_3_0"
+                    android:visibility="gone" />
 
                 <LinearLayout
-                        android:id="@+id/personal_info_qr_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_qr_container"
+                    style="@style/style_item_container"
+                    android:visibility="gone">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/my_qr"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/my_qr" />
 
                     <RelativeLayout
-                            android:layout_width="30dp"
-                            android:layout_height="30dp">
+                        android:layout_width="30dp"
+                        android:layout_height="30dp">
 
                         <ImageView
-                                android:id="@+id/personal_info_qr"
-                                android:layout_width="25dp"
-                                android:layout_height="25dp"
-                                android:layout_centerInParent="true"
-                                android:background="@null"
-                                android:src="@mipmap/icon"/>
+                            android:id="@+id/personal_info_qr"
+                            android:layout_width="25dp"
+                            android:layout_height="25dp"
+                            android:layout_centerInParent="true"
+                            android:background="@null"
+                            android:src="@mipmap/icon" />
 
                         <ImageView
-                                android:layout_width="5dp"
-                                android:layout_height="5dp"
-                                android:layout_centerInParent="true"
-                                android:background="@null"
-                                android:src="@mipmap/icon"/>
+                            android:layout_width="5dp"
+                            android:layout_height="5dp"
+                            android:layout_centerInParent="true"
+                            android:background="@null"
+                            android:src="@mipmap/icon" />
 
                     </RelativeLayout>
 
-                    <TextView style="@style/style_item_end_next"/>
+                    <TextView style="@style/style_item_content_person_info" />
 
                 </LinearLayout>
             </LinearLayout>
 
-            <View
-                    android:layout_width="match_parent"
-                    android:layout_height="20dp"
-                    android:background="#f5f5f5"/>
-
             <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginBottom="@dimen/content_padding_15"
-                    android:layout_marginTop="@dimen/content_padding"
-                    android:background="@color/white"
-                    android:orientation="vertical">
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="@dimen/content_padding_15"
+                android:background="@color/white"
+                android:orientation="vertical">
 
                 <LinearLayout
-                        android:id="@+id/personal_info_phone_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_phone_container"
+                    style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/phone"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/phone" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_phone"
-                            style="@style/style_item_end_next"/>
+                        android:id="@+id/personal_info_phone"
+                        style="@style/style_item_content_person_info" />
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View style="@style/style_item_line_3_0" />
+
                 <LinearLayout
-                        android:id="@+id/personal_info_addr_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_addr_container"
+                    style="@style/style_item_container"
+                    android:visibility="gone">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/my_addr_info"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/my_addr_info" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_addr"
-                            style="@style/style_item_end_next"/>
+                        android:id="@+id/personal_info_addr"
+                        style="@style/style_item_content_person_info" />
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View
+                    style="@style/style_item_line_3_0"
+                    android:visibility="gone" />
 
                 <LinearLayout
-                        android:id="@+id/personal_info_bind_tx_ali_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_bind_tx_ali_container"
+                    style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/bind_tx_ali"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/bind_tx_ali" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_bind_tx_ali"
-                            style="@style/style_item_end_next"/>
+                        android:id="@+id/personal_info_bind_tx_ali"
+                        style="@style/style_item_content_person_info" />
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View style="@style/style_item_line_3_0" />
 
                 <LinearLayout
-                        android:id="@+id/personal_info_bind_qq_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_bind_qq_container"
+                    style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/bind_qq"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/bind_qq" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_bind_qq"
-                            style="@style/style_item_end_next"/>
+                        android:id="@+id/personal_info_bind_qq"
+                        style="@style/style_item_content_person_info" />
                 </LinearLayout>
 
-                <View style="@style/style_item_line_3_0"/>
+                <View style="@style/style_item_line_3_0" />
 
                 <LinearLayout
-                        android:id="@+id/personal_info_bind_wx_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_bind_wx_container"
+                    style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/bind_wx"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/bind_wx" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_bind_wx"
-                            style="@style/style_item_end_next"/>
+                        android:id="@+id/personal_info_bind_wx"
+                        style="@style/style_item_content_person_info" />
                 </LinearLayout>
 
 
-                <View style="@style/style_item_line_3_0"/>
+                <View style="@style/style_item_line_3_0" />
 
                 <LinearLayout
-                        android:id="@+id/personal_info_authentication_container"
-                        style="@style/style_item_container">
+                    android:id="@+id/personal_info_authentication_container"
+                    style="@style/style_item_container">
 
                     <TextView
-                            style="@style/style_item_label"
-                            android:text="@string/auther"/>
+                        style="@style/style_item_label_person_info"
+                        android:text="@string/auther" />
 
 
                     <TextView
-                            android:id="@+id/personal_info_authentication"
-                            style="@style/style_item_end_next"
-                            android:text="未认证"/>
+                        android:id="@+id/personal_info_authentication"
+                        style="@style/style_item_content_person_info"
+                        android:text="未认证" />
                 </LinearLayout>
 
 

+ 8 - 1
app/src/main/res/values/dd_styles.xml

@@ -353,7 +353,14 @@
         <item name="android:layout_width">0dp</item>
         <item name="android:layout_weight">1</item>
     </style>
-
+    <style name="style_item_label_person_info" parent="style_item_label">
+        <item name="android:textSize">16sp</item>
+        <item name="textColor">@color/text33</item>
+    </style>
+    <style name="style_item_content_person_info" parent="style_item_end_next">
+        <item name="android:textSize">16sp</item>
+        <item name="textColor">@color/text99</item>
+    </style>
     <style name="style_item_line">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">1px</item>