| | |
| | | package com.hdl.photovoltaic.ui.me; |
| | | |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.os.CountDownTimer; |
| | | import android.text.TextUtils; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 修改绑定手机号的界面 |
| | |
| | | public void onClick(View v) { |
| | | setResult(20); |
| | | finish(); |
| | | } |
| | | }); |
| | | viewBinding.bindAreaParentRl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | selectArea(); |
| | | } |
| | | }); |
| | | |
| | |
| | | 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)); |
| | | 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); |
| | | viewBinding.bindAreaNumberTv.setText("+" + country.code); |
| | | } |
| | | }); |
| | | dialog.show(); |
| | | dialog.setDialogSize(); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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(); |
| | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | Country.destroy(); |
| | | if (countDownTimer != null) { |
| | | countDownTimer.cancel(); |
| | | countDownTimer = null; |