正在查看: 大众借. v4.1.2 应用的 MT2ACT.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 大众借. v4.1.2 应用的 MT2ACT.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.shiliuj.ui.activitys;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.core.app.NotificationCompat;
import butterknife.BindView;
import com.base.commonlibrary.base.baseapp.AppActivityManager;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.netstate.ComNetWorkUtil;
import com.base.commonlibrary.views.TitleLayout;
import com.shiliuj.mjyp.BMAG01ACT;
import com.shiliuj.mjyp.app.api.Api;
import com.shiliuj.mjyp.app.base.BaseBindActivity;
import com.shiliuj.mjyp.app.base.RxSubscriber;
import com.shiliuj.ui.bean.PostponeBean;
import com.shiliuj.ui.bean.PostponeStatusBean;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
public class MT2ACT extends BaseBindActivity {
@BindView(2131296381)
Button btnCancle;
@BindView(2131296390)
Button btnOk;
private CountDownTimer countDownTimer;
@BindView(2131296455)
TextView dayNum;
@BindView(2131296507)
TextView failReason;
@BindView(2131296581)
ImageView imgStatus;
@BindView(2131296642)
LinearLayout llContent;
@BindView(2131296643)
LinearLayout llFail;
@BindView(2131296658)
LinearLayout llSuccess;
@BindView(2131296660)
LinearLayout llTop;
private String msg;
private String orderNo;
@BindView(2131296762)
TextView pDate;
@BindView(2131296772)
TextView payMoney;
@BindView(2131296844)
RelativeLayout rl_time;
@BindView(2131296966)
TextView tip;
@BindView(2131296998)
TitleLayout title;
@BindView(2131297040)
TextView tvSTip;
@BindView(2131297071)
TextView xqDay;
protected boolean canLoadMore() {
return false;
}
public int getLayoutId() {
return 2131492920;
}
public void initPresenter() {
}
protected void loadMore() {
}
protected void refresh() {
}
public void initView(Bundle bundle) {
Bundle extras = getIntent().getExtras();
int i = extras.getInt(NotificationCompat.CATEGORY_STATUS);
this.orderNo = extras.getString("ORDERID");
this.msg = extras.getString(NotificationCompat.CATEGORY_MESSAGE);
setView((PostponeBean) extras.getSerializable("postponeBean"), i);
this.btnOk.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MT2ACT.this.lambda$initView$0$MT2ACT(view);
}
});
this.btnCancle.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
}
});
startCountDown();
}
public void lambda$initView$0$MT2ACT(View view) {
String charSequence = ((TextView) view).getText().toString();
if (charSequence.equals(getResources().getString(2131689555))) {
AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
finish();
} else if (getResources().getString(2131689959).equals(charSequence)) {
checkPostponeStatus(true);
} else {
finish();
}
}
public void setView(PostponeBean postponeBean, int i) {
if (i == 1) {
this.llSuccess.setVisibility(0);
this.llFail.setVisibility(8);
this.rl_time.setVisibility(8);
this.btnCancle.setVisibility(8);
this.tvSTip.setText(getResources().getString(2131689634));
this.imgStatus.setImageResource(2131558469);
if (postponeBean != null) {
BigDecimal postponeAmount = postponeBean.getPostponeAmount();
String dueDate = postponeBean.getDueDate();
Integer countDay = postponeBean.getCountDay();
this.payMoney.setText(getString(2131689824) + postponeAmount);
this.xqDay.setText(countDay + getString(2131689633));
this.dayNum.setText(dueDate);
}
this.btnOk.setText(getResources().getString(2131689959));
this.tip.setText(getResources().getString(2131690147));
return;
}
if (i == 2) {
this.llSuccess.setVisibility(0);
this.llFail.setVisibility(8);
this.btnCancle.setVisibility(8);
this.rl_time.setVisibility(0);
this.btnOk.setText(getResources().getString(2131689555));
this.tvSTip.setText(getResources().getString(2131689547));
this.imgStatus.setImageResource(2131558468);
this.tip.setText(getResources().getString(2131689624));
if (postponeBean != null) {
BigDecimal postponeAmount2 = postponeBean.getPostponeAmount();
String dueDate2 = postponeBean.getDueDate();
Integer countDay2 = postponeBean.getCountDay();
this.payMoney.setText(getString(2131689824) + postponeAmount2);
this.xqDay.setText(countDay2 + getString(2131689633));
this.dayNum.setText(dueDate2);
return;
}
return;
}
this.llSuccess.setVisibility(8);
this.llFail.setVisibility(0);
this.btnCancle.setVisibility(0);
this.tvSTip.setText(getResources().getString(2131689541));
this.imgStatus.setImageResource(2131558467);
this.tip.setText(getResources().getString(2131690146));
this.btnOk.setText(getResources().getString(2131689613));
String str = this.msg;
if (str != null) {
this.failReason.setText(str);
}
this.pDate.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis())));
}
protected void checkPostponeStatus(boolean z) {
if (ComNetWorkUtil.isNetworkAvailable(this.mContext)) {
if (this.orderNo != null) {
this.mRxManager.add(Api.getDefault().checkPostponeStatus(this.orderNo).compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<PostponeStatusBean>(this.mContext, z) {
public void _onNext(PostponeStatusBean postponeStatusBean) {
if (postponeStatusBean.getCode() == 2030) {
PostponeStatusBean.ResultBean result = postponeStatusBean.getResult();
PostponeBean postponeBean = new PostponeBean();
postponeBean.setDueDate(result.getDueDate());
postponeBean.setPostponeAmount(result.getPostponeAmount());
postponeBean.setCountDay(Integer.valueOf(result.getCountDay()));
MT2ACT.this.setView(postponeBean, 1);
return;
}
if (postponeStatusBean.getCode() == 2031) {
PostponeStatusBean.ResultBean result2 = postponeStatusBean.getResult();
PostponeBean postponeBean2 = new PostponeBean();
postponeBean2.setDueDate(result2.getDueDate());
postponeBean2.setPostponeAmount(result2.getPostponeAmount());
postponeBean2.setCountDay(Integer.valueOf(result2.getCountDay()));
MT2ACT.this.setView(postponeBean2, 2);
return;
}
if (postponeStatusBean.getCode() != 2029) {
MT2ACT.this.setView(null, 2);
return;
}
MT2ACT.this.msg = postponeStatusBean.getMessage();
MT2ACT.this.setView(null, 0);
}
protected void _onError(String str) {
MT2ACT.this.showShortToast(str);
}
}));
return;
}
return;
}
showShortToast(getResources().getString(2131689868));
}
protected void onDestroy() {
super.onDestroy();
stopCountDown();
}
protected void startCountDown() {
if (this.countDownTimer == null) {
this.countDownTimer = new CountDownTimer(10000L, 1000L) {
@Override
public void onTick(long j) {
if (j == 25000) {
MT2ACT.this.checkPostponeStatus(false);
}
}
@Override
public void onFinish() {
MT2ACT.this.checkPostponeStatus(false);
}
};
}
this.countDownTimer.start();
}
private void stopCountDown() {
CountDownTimer countDownTimer = this.countDownTimer;
if (countDownTimer != null) {
countDownTimer.cancel();
this.countDownTimer = null;
}
}
}