From 28880ba7540c523d3e50d35416422396ef802c50 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 25 十月 2023 18:16:45 +0800
Subject: [PATCH] 2023年10月25日18:16:37

---
 app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java |   43 +++++++++++--------------------------------
 1 files changed, 11 insertions(+), 32 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java
index 54be3de..e277935 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java
@@ -2,16 +2,12 @@
 
 import androidx.appcompat.content.res.AppCompatResources;
 
-import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.text.Editable;
-import android.text.Spannable;
-import android.text.SpannableStringBuilder;
 import android.text.TextUtils;
 import android.text.TextWatcher;
 import android.text.method.HideReturnsTransformationMethod;
 import android.text.method.PasswordTransformationMethod;
-import android.text.style.ForegroundColorSpan;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.ImageView;
@@ -24,9 +20,10 @@
 import com.hdl.photovoltaic.listener.CloudCallBeak;
 import com.hdl.photovoltaic.other.HdlAccountLogic;
 import com.hdl.photovoltaic.other.HdlThreadLogic;
-import com.hdl.photovoltaic.widget.FlashingBoxDialog;
 
-
+/**
+ * 鎴戠殑-淇敼瀵嗙爜-鐣岄潰
+ */
 public class MeChangePasswordActivity extends BaseActivity {
 
     private ActivityMeChangePasswordBinding viewBinding;
@@ -43,6 +40,7 @@
         initView();
         //鍒濆鍖栫晫闈㈢洃鍚櫒
         initEvent();
+
     }
 
     /**
@@ -99,7 +97,7 @@
         String newPsw = viewBinding.meChangePasswordNewIc.mePswEt.getText().toString().replaceAll(" +", "");
         String affirmPsw = viewBinding.meChangePasswordAffirmIc.mePswEt.getText().toString().replaceAll(" +", "");
         if (!isEditTextPassword(newPsw, affirmPsw)) {
-            tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_fail), getString(R.string.home_login_input_unlike_psw), -1);
+            HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_input_unlike_psw), -1);
             return;
         }
         if (UserConfigManage.getInstance().isBAccount()) {
@@ -107,12 +105,12 @@
             HdlAccountLogic.getInstance().updateBPassword(oldPsw, newPsw, new CloudCallBeak<String>() {
                 @Override
                 public void onSuccess(String str) {
-                    tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_succeed), getString(R.string.home_login_pws_reset_succeeded), 0);
+                    HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_pws_reset_succeeded), 0);
                 }
 
                 @Override
                 public void onFailure(HDLException e) {
-                    tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_fail), e.getMsg(), e.getCode());
+                    HdlThreadLogic.tipFlashingBox(_mActivity, false, e.getMsg(), e.getCode());
                 }
             });
         } else {
@@ -120,12 +118,12 @@
             HdlAccountLogic.getInstance().updateCPassword(oldPsw, newPsw, new CloudCallBeak<String>() {
                 @Override
                 public void onSuccess(String obj) {
-                    tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_succeed), getString(R.string.home_login_pws_reset_succeeded), 0);
+                    HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_pws_reset_succeeded), 0);
                 }
 
                 @Override
                 public void onFailure(HDLException e) {
-                    tipFlashingBox(AppCompatResources.getDrawable(_mActivity, R.drawable.tip_fail), e.getMsg(), e.getCode());
+                    HdlThreadLogic.tipFlashingBox(_mActivity, false, e.getMsg(), e.getCode());
                 }
             });
 
@@ -134,31 +132,12 @@
 
 
     /**
-     * 鎻愮ず妗�
-     *
-     * @param drawable 鍥炬爣
-     * @param msg      淇℃伅
-     * @param code     鐘舵��
-     */
-    private void tipFlashingBox(Drawable drawable, String msg, int code) {
-        HdlThreadLogic.runMainThread(new Runnable() {
-            @Override
-            public void run() {
-                FlashingBoxDialog flashingBoxDialog = new FlashingBoxDialog(_mActivity);
-                flashingBoxDialog.setImage(drawable);
-                flashingBoxDialog.setContent(msg + "\r\n(" + code + ")");
-                flashingBoxDialog.show();
-            }
-        }, null, null);
-    }
-
-    /**
      * 鍒濆鍖�
      */
     private void initView() {
-        viewBinding.toolbarTopFragmentHouseListRl.topBarView.setBackgroundColor(getResources().getColor(R.color.text_FFFFFFFF));
+        viewBinding.toolbarTopFragmentHouseListRl.topBarView.setBackgroundColor(getResources().getColor(R.color.text_FFFFFFFF,null));
         viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.home_login_change_password);
-        viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setTextColor(getResources().getColor(R.color.text_030D1C));
+        viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setTextColor(getResources().getColor(R.color.text_030D1C,null));
         viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setVisibility(View.VISIBLE);
         viewBinding.meChangePasswordOldIc.mePswTitleTv.setText(R.string.home_login_old_pws);
         viewBinding.meChangePasswordOldIc.mePswEt.setHint(R.string.home_login_input_old_pws);

--
Gitblit v1.8.0