| | |
| | | import com.hdl.photovoltaic.config.AppConfigManage; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.databinding.ActivityRegisterAccountBinding; |
| | | import com.hdl.photovoltaic.enums.Languages; |
| | | import com.hdl.photovoltaic.enums.VerifyType; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlAccountLogic; |
| | |
| | | |
| | | private void initView() { |
| | | //根据app语言默认服务器地址 |
| | | if (UserConfigManage.getInstance().isZh()) { |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.zh)) { |
| | | mUrl = "https://china-gateway.hdlcontrol.com"; |
| | | viewBinding.regionTv.setText("HDL China"); |
| | | viewBinding.regionAccountTv.setText(getText(R.string.home_chinese_mainland)); |
| | |
| | | viewBinding.regionAccountNumberTv.setText("+964"); |
| | | } |
| | | switchPhoneOrEmailStyleView(); |
| | | 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(RegisterAccountActivity.this); |
| | | if (TextUtils.isEmpty(GPSManagerUtils.getInstance().getCountryCode(RegisterAccountActivity.this))) { |
| | | //再根据系统语言 |
| | | country[0] = Country.getCountryInfo(); |
| | | } else { |
| | | //先根据定位 |
| | | country[0] = Country.getLocationCountryInfo(GPSManagerUtils.getInstance().getCountryCode(RegisterAccountActivity.this)); |
| | | } |
| | | 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.registerPhoneVerificationTv, viewBinding.registerPhoneVerificationTv.getText().toString(), true, null); |
| | | HdlCommonLogic.getInstance().setSpan(viewBinding.registerMailVerificationTv, viewBinding.registerMailVerificationTv.getText().toString(), true, null); |
| | | |
| | | if (UserConfigManage.getInstance().isArabicLanguage()) { |
| | | viewBinding.registerBackTv.setRotation(180); // 旋转180度 |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextSize(18); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_FFACACAC, null)); |
| | | viewBinding.registerMailTitleIc.lineV.setVisibility(View.VISIBLE); |
| | | |
| | | //隐藏区号 |
| | | viewBinding.registerRegionAccountRl.setVisibility(View.GONE); |
| | | //输入邮箱 |