正在查看: 鲸鱼借条 v4.1.2 应用的 MTM20act.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 鲸鱼借条 v4.1.2 应用的 MTM20act.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.yuxianghua.ui.activitys;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.Editable;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import butterknife.BindView;
import butterknife.OnTextChanged;
import com.base.commonlibrary.base.BaseResult;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.utils.RegexUtil;
import com.base.commonlibrary.utils.TimeUtil;
import com.base.commonlibrary.views.ClearEditText;
import com.base.commonlibrary.views.TitleLayout;
import com.yuxianghua.mjyp.app.api.Api;
import com.yuxianghua.mjyp.app.base.BaseBindActivity;
import com.yuxianghua.mjyp.app.base.RxSubscriber;
import com.yuxianghua.ui.bean.PwdBean;
import com.yuxianghua.ui.views.EditTextChangeListener;
import rx.Subscriber;
import yhgjgdf.ijnhjfyd.ikbujfjfnjkif.R;
public class MTM20act extends BaseBindActivity {
@BindView(R.id.btn_get)
Button btnGet;
@BindView(R.id.get_code)
Button btnSendCode;
@BindView(R.id.code)
EditText code;
private CountDownTimer countDownTimer;
protected boolean isCountDownFinish = true;
@BindView(R.id.line)
View line;
@BindView(R.id.line2)
View line2;
@BindView(R.id.line3)
View line3;
@BindView(R.id.phone)
ClearEditText phone;
@BindView(R.id.pwd)
ClearEditText pwd;
@BindView(R.id.rl)
RelativeLayout rl;
@BindView(R.id.title)
TitleLayout title;
@Override
protected boolean canLoadMore() {
return false;
}
@Override
public int getLayoutId() {
return R.layout.activity_forgot_pwd;
}
@Override
public void initPresenter() {
}
@Override
protected void loadMore() {
}
@Override
protected void refresh() {
}
@Override
public void initView(Bundle bundle) {
new EditTextChangeListener(this.btnGet, R.drawable.xbl_btn_bg_select).setEditText(this.phone, this.code, this.pwd);
this.btnGet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MTM20act.this.pwdBean();
}
});
this.btnSendCode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MTM20act mTM20act = MTM20act.this;
mTM20act.getCode(mTM20act.phone.getText().toString());
}
});
}
private void stopCountDown() {
CountDownTimer countDownTimer = this.countDownTimer;
if (countDownTimer != null) {
countDownTimer.cancel();
this.countDownTimer = null;
}
}
@OnTextChanged(callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED, value = {R.id.phone})
public void editTextDetailChange(Editable editable) {
if (editable != null) {
if (RegexUtil.isPhoneNumber(editable.toString()) && this.isCountDownFinish) {
this.btnSendCode.setEnabled(true);
return;
} else {
this.btnSendCode.setEnabled(false);
return;
}
}
this.btnSendCode.setEnabled(false);
}
protected void startCountDown() {
this.isCountDownFinish = false;
if (this.countDownTimer == null) {
this.countDownTimer = new CountDownTimer(TimeUtil.ONE_MIN_MILLISECONDS, 1000L) {
@Override
public void onTick(long j) {
String string = MTM20act.this.getResources().getString(R.string.retry_get);
MTM20act.this.btnSendCode.setText(string + "(" + (j / 1000) + MTM20act.this.getResources().getString(R.string.seconds));
}
@Override
public void onFinish() {
MTM20act.this.btnSendCode.setEnabled(true);
MTM20act.this.btnSendCode.setText(MTM20act.this.getResources().getString(R.string.get_code));
MTM20act.this.isCountDownFinish = true;
}
};
}
this.countDownTimer.start();
}
protected void getCode(String str) {
String trim = this.pwd.getText().toString().trim();
if (!TextUtils.isEmpty(trim)) {
this.btnSendCode.setEnabled(false);
this.mRxManager.add(Api.getDefault().pdsendCode(str, trim).compose(RxSchedulers.io_main()).subscribe((Subscriber<? super R>) new RxSubscriber<BaseResult>(this.mContext, true) {
@Override
public void _onNext(BaseResult baseResult) {
if (baseResult != null && baseResult.getCode() == 200) {
MTM20act.this.startCountDown();
return;
}
String message = baseResult.getMessage();
MTM20act.this.btnSendCode.setEnabled(true);
MTM20act.this.showShortToast(message);
}
@Override
protected void _onError(String str2) {
MTM20act.this.showShortToast(str2);
MTM20act.this.btnSendCode.setEnabled(true);
}
}));
} else {
showShortToast(getResources().getString(R.string.pwd_no_empty));
}
}
protected void pwdBean() {
this.btnGet.setEnabled(false);
this.mRxManager.add(Api.getDefault().findPassword(new PwdBean(this.pwd.getText().toString(), this.phone.getText().toString(), this.code.getText().toString())).compose(RxSchedulers.io_main()).subscribe((Subscriber<? super R>) new RxSubscriber<BaseResult>(this.mContext, true) {
@Override
public void _onNext(BaseResult baseResult) {
String message = baseResult.getMessage();
if (baseResult.getCode() == 200) {
MTM20act.this.finish();
} else {
MTM20act.this.btnGet.setEnabled(true);
}
MTM20act.this.showShortToast(message);
}
@Override
protected void _onError(String str) {
MTM20act.this.showShortToast(str);
MTM20act.this.btnGet.setEnabled(true);
}
}));
}
@Override
protected void onDestroy() {
stopCountDown();
super.onDestroy();
}
}