From b9cc7390e8e8ce64c41c26fb369c98ce669d660c Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 07 五月 2025 15:02:30 +0800
Subject: [PATCH] Merge branch '1.2.0'

---
 app/src/main/java/com/hdl/photovoltaic/ui/me/MeChangePasswordActivity.java |   71 ++++++++++++++++++++---------------
 1 files changed, 41 insertions(+), 30 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 bdffd5b..2798636 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
@@ -20,6 +20,7 @@
 import com.hdl.photovoltaic.databinding.ActivityMeChangePasswordBinding;
 import com.hdl.photovoltaic.listener.CloudCallBeak;
 import com.hdl.photovoltaic.other.HdlAccountLogic;
+import com.hdl.photovoltaic.other.HdlLogLogic;
 import com.hdl.photovoltaic.other.HdlThreadLogic;
 import com.hdl.photovoltaic.widget.ConfirmationCancelDialog;
 
@@ -38,8 +39,8 @@
 
     @Override
     public void onBindView(Bundle savedInstanceState) {
-        setNotificationBarBackgroundColor(CustomColor.white);
-        setStatusBarTextColor();
+        setStatusBarTranslucent();
+        getWindow().setNavigationBarColor(getColor(R.color.text_FF000000));
         //鍒濆鍖�
         initView();
         //鍒濆鍖栫晫闈㈢洃鍚櫒
@@ -51,7 +52,7 @@
      * 鍒濆鍖栫晫闈㈢洃鍚櫒
      */
     private void initEvent() {
-        viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setOnClickListener(new View.OnClickListener() {
+        viewBinding.toolbarTopRl.topBackLl.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 finish();
@@ -88,15 +89,21 @@
         viewBinding.homeAffirmTv.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
+                String oldPsw = viewBinding.meChangePasswordOldIc.mePswEt.getText().toString().replaceAll(" ", "");
+                String newPsw = viewBinding.meChangePasswordNewIc.mePswEt.getText().toString().replaceAll(" ", "");
+                String affirmPsw = viewBinding.meChangePasswordAffirmIc.mePswEt.getText().toString().replaceAll(" ", "");
+                if (!isEditTextPassword(oldPsw, newPsw, affirmPsw)) {
+                    return;
+                }
                 // 浜屾纭鎻愮ず妗�
                 ConfirmationCancelDialog dialog = new ConfirmationCancelDialog(_mActivity);
                 dialog.setTitle(getString(R.string.loading_title_tip));
-                dialog.setContent("瀵嗙爜淇敼鎴愬姛,灏嗛噸鏂扮櫥褰�.");
+                dialog.setContent(_mActivity.getString(R.string.home_password_changed_successfully_log_in));
                 dialog.show();
                 dialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() {
                     @Override
                     public void Confirm() {
-                        sendChangePassword();
+                        sendChangePassword(oldPsw, newPsw);
                     }
                 });
                 dialog.setNoOnclickListener(new ConfirmationCancelDialog.onNoOnclickListener() {
@@ -112,30 +119,18 @@
 
     /**
      * 鍙戦�佹洿鏀逛釜浜哄瘑鐮佹寚浠�
+     *
+     * @param oldPsw 鍘熸潵瀵嗙爜
+     * @param newPsw 鏂板瘑鐮�
      */
-    private void sendChangePassword() {
-        String oldPsw = viewBinding.meChangePasswordOldIc.mePswEt.getText().toString().replaceAll(" +", "");
-        String newPsw = viewBinding.meChangePasswordNewIc.mePswEt.getText().toString().replaceAll(" +", "");
-        String affirmPsw = viewBinding.meChangePasswordAffirmIc.mePswEt.getText().toString().replaceAll(" +", "");
+    private void sendChangePassword(String oldPsw, String newPsw) {
 
-        if (isEditTextPassword(oldPsw, newPsw) || isEditTextPassword(oldPsw, affirmPsw)) {
-            HdlThreadLogic.tipFlashingBox(_mActivity, true, "鍘熷瘑鐮佸拰鏂板瘑鐮佷笉鑳戒竴鏍�.", -1);
-            return;
-        }
-
-        if (newPsw.length() < 6 || affirmPsw.length() < 6) {
-            HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_least6), -1);
-            return;
-        }
-        if (!isEditTextPassword(newPsw, affirmPsw)) {
-            HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_input_unlike_psw), -1);
-            return;
-        }
         if (UserConfigManage.getInstance().isBAccount()) {
             //B绔洿鏀逛釜浜哄瘑鐮�
             HdlAccountLogic.getInstance().updatePassword_B(oldPsw, newPsw, new CloudCallBeak<String>() {
                 @Override
                 public void onSuccess(String str) {
+                    HdlLogLogic.print("B绔洿鏀逛釜浜哄瘑鐮侀��鍑虹櫥褰�--->", true);
 //                    HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.home_login_pws_reset_succeeded), 0);
                     HDLLinkPMUser.getInstance().logout(0);
                 }
@@ -150,7 +145,7 @@
             HdlAccountLogic.getInstance().updatePassword_C(oldPsw, newPsw, new CloudCallBeak<String>() {
                 @Override
                 public void onSuccess(String obj) {
-
+                    HdlLogLogic.print("C绔洿鏀逛釜浜哄瘑鐮侀��鍑虹櫥褰�--->", true);
                     HDLLinkPMUser.getInstance().logout(0);
 
 
@@ -170,10 +165,8 @@
      * 鍒濆鍖�
      */
     private void initView() {
-        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, null));
-        viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setVisibility(View.VISIBLE);
+        viewBinding.toolbarTopRl.topTitleTv.setText(R.string.home_login_change_password);
+        viewBinding.toolbarTopRl.topBackLl.setVisibility(View.VISIBLE);
         viewBinding.meChangePasswordOldIc.mePswTitleTv.setText(R.string.home_login_old_pws);
         viewBinding.meChangePasswordOldIc.mePswEt.setHint(R.string.home_login_input_old_pws);
         viewBinding.meChangePasswordOldIc.lineV.setVisibility(View.GONE);
@@ -196,19 +189,37 @@
         String newPsw = viewBinding.meChangePasswordNewIc.mePswEt.getText().toString();
         String affirmPsw = viewBinding.meChangePasswordAffirmIc.mePswEt.getText().toString();
         boolean isEnabled = oldPsw.length() > 0 && newPsw.length() > 0 && affirmPsw.length() > 0;
+        if (isEnabled) {
+            viewBinding.homeAffirmTv.setTextColor(getColor(R.color.text_FFACACAC));
+        } else {
+            viewBinding.homeAffirmTv.setTextColor(getColor(R.color.text_FF5B5B5B));
+        }
         viewBinding.homeAffirmTv.setEnabled(isEnabled);
     }
 
     /**
      * 鏈湴鏍¢獙瀵嗙爜鏄惁姝g‘
      *
+     * @param oldPsw    鍘熸潵瀵嗙爜
      * @param newPsw    鏂板瘑鐮�
      * @param affirmPsw 鍐嶆纭鏂板瘑鐮�
      * @return 涓�鏍疯繑鍥瀟rue锛屽惁鑰協alse
      */
-    private boolean isEditTextPassword(String newPsw, String affirmPsw) {
-        //鏂板瘑鐮佸拰纭瀵嗙爜涓嶄竴鏍�
-        return newPsw.equals(affirmPsw);
+    private boolean isEditTextPassword(String oldPsw, String newPsw, String affirmPsw) {
+        if (newPsw.length() < 6 || affirmPsw.length() < 6) {
+            HdlThreadLogic.tipFlashingBox(_mActivity, false, getString(R.string.home_login_least6), -1);
+            return false;
+        }
+        if (!newPsw.equals(affirmPsw)) {
+            //鏂板瘑鐮佸拰纭瀵嗙爜涓嶄竴鏍�
+            HdlThreadLogic.tipFlashingBox(_mActivity, false, getString(R.string.home_login_input_unlike_psw), -1);
+            return false;
+        }
+        if (oldPsw.equals(newPsw)) {
+            HdlThreadLogic.tipFlashingBox(_mActivity, false, getString(R.string.home_old_password_not_new_password), -1);
+            return false;
+        }
+        return true;
 
     }
 

--
Gitblit v1.8.0