Bladeren bron

1.新增账户安全界面

wsad5123 5 jaren geleden
bovenliggende
commit
9e19eb3be8

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

@@ -49,6 +49,7 @@
         <activity
             android:name=".ui.activity.cclient.CMainActivity"
             android:label="@string/app_name"
+            android:launchMode="singleTask"
             android:screenOrientation="portrait">
 
         </activity>
@@ -250,6 +251,9 @@
             android:name=".ui.activity.cclient.mine.SalaryBackSureDetailActivity"
             android:screenOrientation="portrait" />
         <activity
+            android:name=".ui.activity.cclient.mine.AccountSafeActivity"
+            android:screenOrientation="portrait" />
+        <activity
             android:name=".ui.activity.MsgVerifyActivity"
             android:screenOrientation="portrait" />
         <activity

+ 62 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/mine/AccountSafeActivity.java

@@ -0,0 +1,62 @@
+package com.tongyu.luck.happywork.ui.activity.cclient.mine;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.tongyu.luck.happywork.MyApplication;
+import com.tongyu.luck.happywork.R;
+import com.tongyu.luck.happywork.baselibrary.IntentConstant;
+import com.tongyu.luck.happywork.ui.activity.cclient.CMainActivity;
+import com.tongyu.luck.happywork.ui.base.BaseActivity;
+import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.AccountSafeContacts;
+import com.tongyu.luck.happywork.ui.mvp.cclient.presenter.AccountSafePresenter;
+import com.tongyu.luck.happywork.ui.widget.dialog.SureDialog;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+public class AccountSafeActivity extends BaseActivity<AccountSafePresenter> implements AccountSafeContacts.IAccountSafeView {
+    @BindView(R.id.tv_setting_phone)
+    TextView tvSettingPhone;
+    @BindView(R.id.ll_phone)
+    LinearLayout llPhone;
+    @BindView(R.id.ll_cancellation_account)
+    LinearLayout llCancellationAccount;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_account_safe;
+    }
+
+    @Override
+    public AccountSafePresenter bindPresenter() {
+        return new AccountSafePresenter(this);
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setTitle(R.string.mine_account_safe);
+    }
+
+    @OnClick({R.id.ll_cancellation_account, R.id.ll_phone})
+    public void OnClick(View view) {
+        switch (view.getId()) {
+            case R.id.ll_cancellation_account:
+                new SureDialog(mContext).initData(R.string.dialog_cancellation_account_tips, R.string.sure_cancellation, R.string.cancel, new SureDialog.OnClickSureListener() {
+                    @Override
+                    public void onClick(boolean isSure) {
+                        if (!isSure) {
+                            mvpPresenter.logoutNew();
+                        }
+                    }
+                }).show();
+                break;
+            case R.id.ll_phone:
+                break;
+        }
+    }
+}

+ 6 - 13
app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/mine/SettingActivity.java

@@ -49,8 +49,8 @@ public class SettingActivity extends BaseActivity<SettingPresenter> implements S
     LinearLayout llUserTips;
     @BindView(R.id.ll_privacy_tips)
     LinearLayout llPrivacyTips;
-    @BindView(R.id.ll_cancellation_account)
-    LinearLayout llCancellationAccount;
+    @BindView(R.id.ll_account_safe)
+    LinearLayout llAccountSafe;
     private SureDialog mSureDialog;
     private SureDialog mCacheClearDialog;
 
@@ -64,7 +64,7 @@ public class SettingActivity extends BaseActivity<SettingPresenter> implements S
         return new SettingPresenter(this);
     }
 
-    @OnClick({R.id.ll_clear_cache, R.id.ll_about_us, R.id.ll_version_update, R.id.ll_complaints_suggestions, R.id.ll_user_tips, R.id.ll_privacy_tips, R.id.ll_cancellation_account, R.id.btn_logout})
+    @OnClick({R.id.ll_clear_cache, R.id.ll_about_us, R.id.ll_version_update, R.id.ll_complaints_suggestions, R.id.ll_user_tips, R.id.ll_privacy_tips, R.id.ll_account_safe, R.id.btn_logout})
     public void onClick(View view) {
         switch (view.getId()) {
             case R.id.ll_clear_cache:
@@ -94,15 +94,8 @@ public class SettingActivity extends BaseActivity<SettingPresenter> implements S
             case R.id.ll_privacy_tips:
                 startActivity(new Intent(mContext, PrivacyTipsActivity.class));
                 break;
-            case R.id.ll_cancellation_account:
-                new SureDialog(mContext).initData(R.string.dialog_cancellation_account_tips, R.string.sure_cancellation, R.string.cancel, new SureDialog.OnClickSureListener() {
-                    @Override
-                    public void onClick(boolean isSure) {
-                        if (!isSure) {
-                            mvpPresenter.logoutNew();
-                        }
-                    }
-                }).show();
+            case R.id.ll_account_safe:
+                startActivity(new Intent(mContext, AccountSafeActivity.class));
                 break;
         }
     }
@@ -111,7 +104,7 @@ public class SettingActivity extends BaseActivity<SettingPresenter> implements S
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setTitle(R.string.me_more);
+        setTitle(R.string.me_setting);
         tvVersion.setText("V" + AppUtils.getVersionName(mContext));
     }
 

+ 18 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/contacts/AccountSafeContacts.java

@@ -0,0 +1,18 @@
+package com.tongyu.luck.happywork.ui.mvp.cclient.contacts;
+
+import com.tongyu.luck.happywork.callback.MvpDataCallBack;
+import com.tongyu.luck.happywork.ui.base.IPresenter;
+import com.tongyu.luck.happywork.ui.base.IView;
+
+public class AccountSafeContacts {
+    public interface IAccountSafeView extends IView {
+    }
+
+    public interface IAccountSafePresenter extends IPresenter {
+        void logoutNew();
+    }
+
+    public interface IAccountSafeModel {
+        void httpLogoutNew(MvpDataCallBack<Boolean> callBack);
+    }
+}

+ 0 - 3
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/contacts/SettingContacts.java

@@ -13,13 +13,10 @@ public class SettingContacts {
     public interface ISettingPresenter extends IPresenter {
         void checkUpdate();
 
-        void logoutNew();
     }
 
     public interface ISettingModel {
-
         void httpCheckUpdate(MvpDataCallBack<VersionBean> callBack);
 
-        void httpLogoutNew(MvpDataCallBack<Boolean> callBack);
     }
 }

+ 39 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/model/AccountSafeModel.java

@@ -0,0 +1,39 @@
+package com.tongyu.luck.happywork.ui.mvp.cclient.model;
+
+import android.content.Context;
+
+import com.tongyu.luck.happywork.bean.api.ApiNormalBean;
+import com.tongyu.luck.happywork.callback.MvpDataCallBack;
+import com.tongyu.luck.happywork.http.ApiObserver;
+import com.tongyu.luck.happywork.http.RetrofitHttpParams;
+import com.tongyu.luck.happywork.http.subscribe.LoginSubscribe;
+import com.tongyu.luck.happywork.ui.base.BaseModel;
+import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.AccountSafeContacts;
+
+public class AccountSafeModel extends BaseModel implements AccountSafeContacts.IAccountSafeModel {
+
+    public AccountSafeModel(Context mContext) {
+        super(mContext);
+    }
+
+    /**
+     * 注销
+     *
+     * @param callBack
+     */
+    @Override
+    public void httpLogoutNew(final MvpDataCallBack<Boolean> callBack) {
+        RetrofitHttpParams params = new RetrofitHttpParams(mContext);
+        new LoginSubscribe(mContext).requestLogoutNew(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext, true) {
+            @Override
+            public void onSuccess(ApiNormalBean data) {
+                callBack.onData(true);
+
+            }
+
+            @Override
+            public void onFinish() {
+            }
+        });
+    }
+}

+ 0 - 20
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/model/SettingModel.java

@@ -45,24 +45,4 @@ public class SettingModel extends BaseModel implements SettingContacts.ISettingM
         });
     }
 
-    /**
-     * 注销
-     *
-     * @param callBack
-     */
-    @Override
-    public void httpLogoutNew(final MvpDataCallBack<Boolean> callBack) {
-        RetrofitHttpParams params = new RetrofitHttpParams(mContext);
-        new LoginSubscribe(mContext).requestLogoutNew(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext, true) {
-            @Override
-            public void onSuccess(ApiNormalBean data) {
-                callBack.onData(true);
-
-            }
-
-            @Override
-            public void onFinish() {
-            }
-        });
-    }
 }

+ 41 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/AccountSafePresenter.java

@@ -0,0 +1,41 @@
+package com.tongyu.luck.happywork.ui.mvp.cclient.presenter;
+
+import android.content.Intent;
+
+import com.tongyu.luck.happywork.MyApplication;
+import com.tongyu.luck.happywork.baselibrary.IntentConstant;
+import com.tongyu.luck.happywork.callback.MvpDataCallBack;
+import com.tongyu.luck.happywork.ui.activity.cclient.CMainActivity;
+import com.tongyu.luck.happywork.ui.activity.cclient.mine.AccountSafeActivity;
+import com.tongyu.luck.happywork.ui.base.BasePresenter;
+import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.AccountSafeContacts;
+import com.tongyu.luck.happywork.ui.mvp.cclient.model.AccountSafeModel;
+
+public class AccountSafePresenter extends BasePresenter<AccountSafeActivity> implements AccountSafeContacts.IAccountSafePresenter {
+    private AccountSafeModel mAccountSafeModel;
+
+    public AccountSafePresenter(AccountSafeActivity view) {
+        super(view);
+        this.mAccountSafeModel = new AccountSafeModel(mvpReference.get());
+    }
+
+    /**
+     * 注销登录
+     */
+    @Override
+    public void logoutNew() {
+        if (isViewAttach()) {
+            mAccountSafeModel.httpLogoutNew(new MvpDataCallBack<Boolean>() {
+                @Override
+                public void onData(Boolean data) {
+                    if (isViewAttach()) {
+                        MyApplication.getInstance().logout();
+                        Intent intent = new Intent(mvpReference.get(), CMainActivity.class);
+                        intent.putExtra(IntentConstant.BOOLEAN, true);//表示直接打开登录页面
+                        mvpReference.get().startActivity(intent);
+                    }
+                }
+            });
+        }
+    }
+}

+ 0 - 20
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/SettingPresenter.java

@@ -42,24 +42,4 @@ public class SettingPresenter extends BasePresenter<SettingActivity> implements
         }
     }
 
-    /**
-     * 注销登录
-     */
-    @Override
-    public void logoutNew() {
-        if (isViewAttach()) {
-            mSettingModel.httpLogoutNew(new MvpDataCallBack<Boolean>() {
-                @Override
-                public void onData(Boolean data) {
-                    if (isViewAttach()) {
-                        MyApplication.getInstance().logout();
-                        Intent intent = new Intent(mvpReference.get(), CMainActivity.class);
-                        intent.putExtra(IntentConstant.BOOLEAN, true);//表示直接打开登录页面
-                        mvpReference.get().startActivity(intent);
-                        mvpReference.get().finish();
-                    }
-                }
-            });
-        }
-    }
 }

+ 92 - 0
app/src/main/res/layout/activity_account_safe.xml

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/gray_bg"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@color/white"
+        android:orientation="vertical">
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="10dp"
+            android:background="@color/gray_bg" />
+        <LinearLayout
+            android:id="@+id/ll_phone"
+            android:layout_width="match_parent"
+            android:layout_height="56dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingLeft="24dp"
+            android:paddingRight="15dp">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:gravity="center_vertical"
+                android:text="@string/mine_setting_phone"
+                android:textColor="@color/text_black_33"
+                android:textSize="@dimen/px42_14sp" />
+
+            <TextView
+                android:id="@+id/tv_setting_phone"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="5dp"
+                android:layout_weight="1"
+                android:gravity="right|center_vertical"
+                android:singleLine="true"
+                android:text="181 1769 8872"
+                android:textColor="@color/text_black_66"
+                android:textSize="@dimen/px36_12sp" />
+
+            <View
+                android:layout_width="8dp"
+                android:layout_height="14dp"
+                android:layout_marginLeft="10dp"
+                android:background="@mipmap/ic_gray_right" />
+
+        </LinearLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/view_line_color_gray" />
+
+        <LinearLayout
+            android:id="@+id/ll_cancellation_account"
+            android:layout_width="match_parent"
+            android:layout_height="56dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingLeft="24dp"
+            android:paddingRight="15dp">
+
+            <TextView
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:gravity="center_vertical"
+                android:text="@string/mine_cancellation_account"
+                android:textColor="@color/text_black_33"
+                android:textSize="@dimen/px42_14sp" />
+
+            <View
+                android:layout_width="8dp"
+                android:layout_height="14dp"
+                android:background="@mipmap/ic_gray_right" />
+
+        </LinearLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/view_line_color_gray" />
+
+
+    </LinearLayout>
+</LinearLayout>

+ 2 - 2
app/src/main/res/layout/activity_setting.xml

@@ -218,7 +218,7 @@
             android:background="@color/view_line_color_gray" />
 
         <LinearLayout
-            android:id="@+id/ll_cancellation_account"
+            android:id="@+id/ll_account_safe"
             android:layout_width="match_parent"
             android:layout_height="56dp"
             android:gravity="center_vertical"
@@ -231,7 +231,7 @@
                 android:layout_height="match_parent"
                 android:layout_weight="1"
                 android:gravity="center_vertical"
-                android:text="@string/mine_cancellation_account"
+                android:text="@string/mine_account_safe"
                 android:textColor="@color/text_black_33"
                 android:textSize="@dimen/px42_14sp" />
 

+ 2 - 2
app/src/main/res/layout/fragment_me.xml

@@ -480,13 +480,13 @@
                 android:layout_width="14dp"
                 android:layout_height="14dp"
                 android:layout_marginRight="10dp"
-                android:src="@mipmap/ic_me_more" />
+                android:src="@mipmap/ic_me_setting" />
 
             <TextView
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
-                android:text="@string/me_more"
+                android:text="@string/me_setting"
                 android:textColor="@color/text_black"
                 android:textSize="@dimen/px42_14sp" />
 

BIN
app/src/main/res/mipmap-hdpi/ic_me_setting.png


BIN
app/src/main/res/mipmap-xhdpi/ic_me_setting.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_me_setting.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_me_setting.png


+ 2 - 0
app/src/main/res/values/strings.xml

@@ -597,10 +597,12 @@
     <string name="mine_user_tips">用户协议</string>
     <string name="mine_privacy_tips">隐私协议</string>
     <string name="mine_cancellation_account">注销账户</string>
+    <string name="mine_account_safe">账户与安全</string>
     <string name="mine_business_cooperation">商务合作</string>
     <string name="mine_setting_get_new_msg">接收新消息通知</string>
     <string name="mine_setting_clear_cache">清除缓存</string>
     <string name="mine_setting_about_us">关于我们</string>
+    <string name="mine_setting_phone">手机号</string>
     <string name="mine_setting_msg">消息设置</string>
     <string name="mine_setting_version_update">版本更新</string>
     <string name="mine_setting_change_role">切换身份</string>