From 11409771024381e06173490d846bf121e6a19552 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 15 一月 2026 21:29:05 +0800
Subject: [PATCH] 2026年01月15日21:29:00
---
app/src/main/java/com/hdl/photovoltaic/ui/account/ChangePassword.java | 94 ++++++++++++++++++++++++++++++----------------
1 files changed, 61 insertions(+), 33 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/account/ChangePassword.java b/app/src/main/java/com/hdl/photovoltaic/ui/account/ChangePassword.java
index 481a171..c86a48e 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/account/ChangePassword.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/account/ChangePassword.java
@@ -5,18 +5,13 @@
import android.os.CountDownTimer;
import android.text.Editable;
import android.text.InputType;
-import android.text.SpannableStringBuilder;
-import android.text.TextPaint;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
-import android.text.style.ClickableSpan;
import android.view.View;
-import android.widget.TextView;
-import androidx.annotation.NonNull;
import androidx.appcompat.content.res.AppCompatResources;
import com.hdl.linkpm.sdk.core.exception.HDLException;
@@ -27,6 +22,7 @@
import com.hdl.photovoltaic.config.AppConfigManage;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.databinding.ActivityChangePasswordBinding;
+import com.hdl.photovoltaic.enums.Languages;
import com.hdl.photovoltaic.enums.VerifyType;
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.other.HdlAccountLogic;
@@ -77,7 +73,7 @@
* 鍒濆鍖栫晫闈�
*/
private void initView() {
- if (UserConfigManage.getInstance().isZh()) {
+ if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.zh)) {
viewBinding.regionAccountTv.setText(getText(R.string.home_chinese_mainland));
viewBinding.regionAccountNumberTv.setText("+86");
} else {
@@ -85,25 +81,57 @@
viewBinding.regionAccountNumberTv.setText("+964");
}
switchPhoneOrMailView();
- try {
- Country.load(this);
- Country country = null;
- if (TextUtils.isEmpty(GPSManagerUtils.getInstance().getCountryCode(this))) {
- //鍐嶆牴鎹郴缁熻瑷�
- country = Country.getCountryInfo();
- } else {
- //鍏堟牴鎹畾浣�
- country = Country.getLocationCountryInfo(GPSManagerUtils.getInstance().getCountryCode(this));
- }
- if (country != null) {
- viewBinding.regionAccountTv.setText(country.translate);
- viewBinding.regionAccountNumberTv.setText("+" + country.code);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
+// try {
+// Country.load(this);
+// Country country = null;
+// if (TextUtils.isEmpty(GPSManagerUtils.getInstance().getCountryCode(this))) {
+// //鍐嶆牴鎹郴缁熻瑷�
+// country = Country.getCountryInfo();
+// } else {
+// //鍏堟牴鎹畾浣�
+// country = Country.getLocationCountryInfo(GPSManagerUtils.getInstance().getCountryCode(this));
+// }
+// if (country != null) {
+// viewBinding.regionAccountTv.setText(country.translate);
+// viewBinding.regionAccountNumberTv.setText("+" + country.code);
+// }
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+ new Thread(
+ new Runnable() {
+ @Override
+ public void run() {
+ try {
+ final Country[] country = new Country[1];
+ Country.load(_mActivity);
+ if (TextUtils.isEmpty(GPSManagerUtils.getInstance().getCountryCode(_mActivity))) {
+ //鍐嶆牴鎹郴缁熻瑷�
+ country[0] = Country.getCountryInfo();
+ } else {
+ //鍏堟牴鎹畾浣�
+ country[0] = Country.getLocationCountryInfo(GPSManagerUtils.getInstance().getCountryCode(_mActivity));
+ }
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ if (country != null) {
+ viewBinding.regionAccountTv.setText(country[0].translate);
+ viewBinding.regionAccountNumberTv.setText("+" + country[0].code);
+ }
+ }
+ });
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ ).start();
HdlCommonLogic.getInstance().setSpan(viewBinding.changePhoneVerificationTv, viewBinding.changePhoneVerificationTv.getText().toString(), true, null);
HdlCommonLogic.getInstance().setSpan(viewBinding.changeMailVerificationTv, viewBinding.changeMailVerificationTv.getText().toString(), true, null);
+ if (UserConfigManage.getInstance().isArabicLanguage()) {
+ viewBinding.changeBackTv.setRotation(180); // 鏃嬭浆180搴�
+ }
}
@@ -374,7 +402,7 @@
long time = (millisUntilFinished / 1000);
String str = time + "s" + getString(R.string.home_login_psw_verification_repeater);
viewBinding.changePhoneVerificationTv.setText(str);
-// viewBinding.changePhoneVerificationTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF));
+// viewBinding.changePhoneVerificationTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
viewBinding.changePhoneVerificationTv.setEnabled(false);
}
@@ -382,7 +410,7 @@
@Override
public void onFinish() {
viewBinding.changePhoneVerificationTv.setText(getString(R.string.home_login_verification_regain));
-// viewBinding.changePhoneVerificationTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF));
+// viewBinding.changePhoneVerificationTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
viewBinding.changePhoneVerificationTv.setEnabled(true);
@@ -398,7 +426,7 @@
String str = time + "s" + getString(R.string.home_login_psw_verification_repeater);
viewBinding.changeMailVerificationTv.setText(str);
-// viewBinding.changeMailVerificationTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF));
+// viewBinding.changeMailVerificationTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
viewBinding.changeMailVerificationTv.setEnabled(false);
}
@@ -406,7 +434,7 @@
@Override
public void onFinish() {
viewBinding.changeMailVerificationTv.setText(getString(R.string.home_login_verification_regain));
-// viewBinding.changeMailVerificationTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF));
+// viewBinding.changeMailVerificationTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
viewBinding.changeMailVerificationTv.setEnabled(true);
}
@@ -420,12 +448,12 @@
//鎵嬫満鍙�
viewBinding.changePhoneIc.accountTitleTv.setText(R.string.home_login_phone);
viewBinding.changePhoneIc.accountTitleTv.setTextSize(18);
- viewBinding.changePhoneIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF));
+ viewBinding.changePhoneIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
viewBinding.changePhoneIc.lineV.setVisibility(View.VISIBLE);
viewBinding.changeMailRl.accountTitleTv.setText(R.string.home_login_email);
viewBinding.changeMailRl.accountTitleTv.setTextSize(14);
- viewBinding.changeMailRl.accountTitleTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF));
+ viewBinding.changeMailRl.accountTitleTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
viewBinding.changeMailRl.lineV.setVisibility(View.GONE);
@@ -452,12 +480,12 @@
//閭
viewBinding.changePhoneIc.accountTitleTv.setText(R.string.home_login_phone);
viewBinding.changePhoneIc.accountTitleTv.setTextSize(14);
- viewBinding.changePhoneIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF));
+ viewBinding.changePhoneIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
viewBinding.changePhoneIc.lineV.setVisibility(View.GONE);
viewBinding.changeMailRl.accountTitleTv.setText(R.string.home_login_email);
viewBinding.changeMailRl.accountTitleTv.setTextSize(18);
- viewBinding.changeMailRl.accountTitleTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF));
+ viewBinding.changeMailRl.accountTitleTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
viewBinding.changeMailRl.lineV.setVisibility(View.VISIBLE);
viewBinding.regionAccountRl.setVisibility(View.GONE);
@@ -500,9 +528,9 @@
}
boolean isEnabled = account.length() > 0 && psw1.length() > 0 && psw2.length() > 0 && verification_code.length() > 0;
if (isEnabled) {
- viewBinding.confirmTv.setTextColor(getColor(R.color.text_E6FFFFFF));
+ viewBinding.confirmTv.setTextColor(getColor(R.color.text_FFACACAC));
} else {
- viewBinding.confirmTv.setTextColor(getColor(R.color.text_66FFFFFF));
+ viewBinding.confirmTv.setTextColor(getColor(R.color.text_FF5B5B5B));
}
viewBinding.confirmTv.setEnabled(isEnabled);
}
--
Gitblit v1.8.0