From 23d38b1e7374c20698702b6ab3feb1e92e82c4d3 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 04 十二月 2024 19:22:17 +0800
Subject: [PATCH] 2024年12月04日19:22:16
---
app/src/main/java/com/hdl/photovoltaic/ui/me/BindPhoneActivity.java | 61 ++++++++++++++++++++++++------
1 files changed, 48 insertions(+), 13 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/me/BindPhoneActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/me/BindPhoneActivity.java
index 2e3db38..16af677 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/me/BindPhoneActivity.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/me/BindPhoneActivity.java
@@ -1,7 +1,6 @@
package com.hdl.photovoltaic.ui.me;
-import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.TextUtils;
@@ -16,6 +15,9 @@
import com.hdl.photovoltaic.other.HdlAccountLogic;
import com.hdl.photovoltaic.other.HdlLogLogic;
import com.hdl.photovoltaic.other.HdlThreadLogic;
+import com.sahooz.library.countrypicker.Country;
+import com.sahooz.library.countrypicker.CountryPickerFragment;
+import com.sahooz.library.countrypicker.PickCountryCallback;
/**
* 淇敼缁戝畾鎵嬫満鍙风殑鐣岄潰
@@ -32,8 +34,7 @@
@Override
public void onBindView(Bundle savedInstanceState) {
- setNotificationBarBackgroundColor(CustomColor.white);
- setStatusBarTextColor();
+ setStatusBarTranslucent();
//鍒濆鍖�
initView();
//鍒濆鍖栫晫闈㈢洃鍚櫒
@@ -43,11 +44,17 @@
private void initEvent() {
- viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setOnClickListener(new View.OnClickListener() {
+ viewBinding.toolbarTopRl.topBackLl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setResult(20);
finish();
+ }
+ });
+ viewBinding.bindAreaParentRl.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ selectArea();
}
});
@@ -75,7 +82,8 @@
public void onSuccess(Boolean obj) {
UserConfigManage.getInstance().setBingPhone(phoneStr);
UserConfigManage.getInstance().Save();
- HdlThreadLogic.tipFlashingBox(_mActivity, true, getString(R.string.set_bind_phone_succeed), 0);
+ setResult(20);
+ finish();
}
@Override
@@ -90,10 +98,30 @@
}
private void initView() {
- viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.set_change_bind_phone_number);
- viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setTextColor(getResources().getColor(R.color.text_030D1C, null));
- viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setVisibility(View.VISIBLE);
- viewBinding.toolbarTopFragmentHouseListRl.topBarView.setBackgroundColor(getResources().getColor(R.color.text_FFFFFFFF, null));
+ viewBinding.toolbarTopRl.topTitleTv.setText(R.string.set_change_bind_phone_number);
+ viewBinding.toolbarTopRl.topBackLl.setVisibility(View.VISIBLE);
+ try {
+ Country.load(this);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 鍥藉鎵嬫満鍙峰尯鍙峰脊绐�
+ */
+ private void selectArea() {
+ CountryPickerFragment dialog = new CountryPickerFragment(this, new PickCountryCallback() {
+ @Override
+ public void onPick(Country country) {
+ if (country.flag != 0)
+ viewBinding.bindAreaTv.setText(country.name);
+ String code = "+" + country.code;
+ viewBinding.bindAreaNumberTv.setText(code);
+ }
+ });
+ dialog.show();
+ dialog.setDialogSize();
}
/**
@@ -106,7 +134,7 @@
HdlThreadLogic.tipFlashingBox(this, false, getString(R.string.home_login_phone_null), -1);
return;
}
- HdlAccountLogic.getInstance().sendVerifyCode(true, account, "86", 3, new CloudCallBeak<Boolean>() {
+ HdlAccountLogic.getInstance().sendVerifyCode(true, account, viewBinding.bindAreaNumberTv.getText().toString(), 3, new CloudCallBeak<Boolean>() {
@Override
public void onSuccess(Boolean obj) {
countDownTimer.start();
@@ -130,7 +158,6 @@
long time = (millisUntilFinished / 1000);
String str = time + "s" + getString(R.string.home_login_psw_verification_repeater);
viewBinding.bindPhoneVerificationTv.setText(str);
- viewBinding.bindPhoneVerificationTv.setTextColor(getResources().getColor(R.color.text_25000000, null));
viewBinding.bindPhoneVerificationTv.setEnabled(false);
}
@@ -138,7 +165,6 @@
@Override
public void onFinish() {
viewBinding.bindPhoneVerificationTv.setText(getString(R.string.home_login_verification_regain));
- viewBinding.bindPhoneVerificationTv.setTextColor(getResources().getColor(R.color.text_245EC3, null));
viewBinding.bindPhoneVerificationTv.setEnabled(true);
@@ -159,7 +185,6 @@
HdlThreadLogic.tipFlashingBox(this, false, getString(R.string.home_login_null_verification_code), -1);
return false;
}
-
return true;
}
@@ -167,10 +192,20 @@
@Override
protected void onDestroy() {
super.onDestroy();
+ Country.destroy();
if (countDownTimer != null) {
countDownTimer.cancel();
countDownTimer = null;
}
}
+
+ /**
+ * 鐗╃悊鎸夐敭杩斿洖浜嬩欢
+ */
+ @Override
+ public void onBackPressed() {
+ setResult(20);
+ super.onBackPressed();
+ }
}
\ No newline at end of file
--
Gitblit v1.8.0