|
@@ -18,6 +18,7 @@ import com.cooleshow.base.utils.ToastUtils;
|
|
|
import com.cooleshow.base.utils.Utils;
|
|
|
import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
|
|
|
import com.cooleshow.base.widgets.VerifyEditText;
|
|
|
+import com.cooleshow.base.widgets.dialog.ImgVerifyCodeDialog;
|
|
|
import com.cooleshow.usercenter.R;
|
|
|
import com.cooleshow.usercenter.bean.UserInfo;
|
|
|
import com.cooleshow.usercenter.bean.UserLoginInfo;
|
|
@@ -56,6 +57,7 @@ public class VerifyCodeInputActivity extends BaseMVPActivity<ActivityInputCodeLa
|
|
|
switchSendCodeButton(true);
|
|
|
}
|
|
|
};
|
|
|
+ private ImgVerifyCodeDialog mImgVerifyCodeDialog;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -82,7 +84,7 @@ public class VerifyCodeInputActivity extends BaseMVPActivity<ActivityInputCodeLa
|
|
|
}
|
|
|
SpannableString string = Utils.diffColorString(getString(R.string.verify_input_phone_tip), mPhoneNum, getResources().getColor(R.color.black), getResources().getColor(com.cooleshow.base.R.color.color_999999));
|
|
|
viewBinding.tvTipTargetPhone.setText(string);
|
|
|
- switchSendCodeButton(false);
|
|
|
+ switchSendCodeButton(true);
|
|
|
viewBinding.ivBack.setOnClickListener(this);
|
|
|
viewBinding.tvResendCode.setOnClickListener(this);
|
|
|
viewBinding.editCode.addInputCompleteListener(new VerifyEditText.InputCompleteListener() {
|
|
@@ -120,12 +122,32 @@ public class VerifyCodeInputActivity extends BaseMVPActivity<ActivityInputCodeLa
|
|
|
@Override
|
|
|
public void initData() {
|
|
|
super.initData();
|
|
|
- sendVerifyCode();
|
|
|
+ showImgVerifyCodeDialog();
|
|
|
}
|
|
|
|
|
|
- private void sendVerifyCode() {
|
|
|
+
|
|
|
+ private void showImgVerifyCodeDialog() {
|
|
|
+ if (mImgVerifyCodeDialog == null) {
|
|
|
+ mImgVerifyCodeDialog = new ImgVerifyCodeDialog(VerifyCodeInputActivity.this);
|
|
|
+ }
|
|
|
+ if (!mImgVerifyCodeDialog.isShowing()) {
|
|
|
+ mImgVerifyCodeDialog.show();
|
|
|
+ }
|
|
|
+ mImgVerifyCodeDialog.setPhone(mPhoneNum);
|
|
|
+ mImgVerifyCodeDialog.setOnEventListener(new ImgVerifyCodeDialog.OnEventListener() {
|
|
|
+ @Override
|
|
|
+ public void onVerifyImgCode(String phone, String imgCode) {
|
|
|
+ sendVerifyCode(imgCode);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private void sendVerifyCode(String imgCode) {
|
|
|
if (presenter != null && !TextUtils.isEmpty(mPhoneNum)) {
|
|
|
- presenter.sendVerifyCode(mPhoneNum);
|
|
|
+ if (mImgVerifyCodeDialog != null) {
|
|
|
+ mImgVerifyCodeDialog.dismiss();
|
|
|
+ }
|
|
|
+ presenter.sendVerifyCode(mPhoneNum, imgCode);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -164,7 +186,7 @@ public class VerifyCodeInputActivity extends BaseMVPActivity<ActivityInputCodeLa
|
|
|
}
|
|
|
if (v.getId() == R.id.tv_resend_code) {
|
|
|
//重新发送
|
|
|
- sendVerifyCode();
|
|
|
+ showImgVerifyCodeDialog();
|
|
|
}
|
|
|
}
|
|
|
|