导航菜单

页面标题

页面副标题

大众借. v4.1.2 - MT1ACT.java 源代码

正在查看: 大众借. v4.1.2 应用的 MT1ACT.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.TextView;
import androidx.core.app.NotificationCompat;
import butterknife.BindView;
import com.base.commonlibrary.base.BaseResult;
import com.base.commonlibrary.base.baseapp.AppActivityManager;
import com.base.commonlibrary.base.baserx.RxHelper;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.netstate.ComNetWorkUtil;
import com.base.commonlibrary.utils.RegexUtil;
import com.base.commonlibrary.utils.SPUtils;
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.ConfigBean;
import com.shiliuj.ui.bean.MyBorrowBean;
import java.text.SimpleDateFormat;
import java.util.Date;

public class MT1ACT extends BaseBindActivity {

    @BindView(2131296390)
    Button btnOk;
    private CountDownTimer countDownTimer;

    @BindView(2131296507)
    TextView failReason;

    @BindView(2131296581)
    ImageView imgStatus;

    @BindView(2131296605)
    TextView kefTel;

    @BindView(2131296606)
    TextView kefTime;

    @BindView(2131296604)
    TextView kef_qq;

    @BindView(2131296607)
    TextView kef_wx;
    private String money;
    private String msg;
    private MyBorrowBean myBorrow;

    @BindView(2131296963)
    TextView time;

    @BindView(2131296966)
    TextView tip;

    @BindView(2131296977)
    TextView tipFail;

    @BindView(2131296993)
    TextView tipTime;

    @BindView(2131296998)
    TitleLayout title;

    @BindView(2131297041)
    TextView tvStatus;

    protected boolean canLoadMore() {
        return false;
    }

    public int getLayoutId() {
        return 2131492917;
    }

    protected void loadMore() {
    }

    protected void refresh() {
    }

    protected void startCountDown() {
        if (this.countDownTimer == null) {
            this.countDownTimer = new CountDownTimer(10000L, 1000L) {
                @Override
                public void onTick(long j) {
                    if (j == 25000) {
                        MT1ACT.this.repaymentOrder(false);
                    }
                }

                @Override
                public void onFinish() {
                    MT1ACT.this.repaymentOrder(false);
                }
            };
        }
        this.countDownTimer.start();
    }

    public void initPresenter() {
        this.btnOk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String charSequence = MT1ACT.this.btnOk.getText().toString();
                if (MT1ACT.this.getResources().getString(2131689615).equals(charSequence)) {
                    MT1ACT.this.finish();
                    return;
                }
                if (MT1ACT.this.getResources().getString(2131689959).equals(charSequence)) {
                    MT1ACT.this.repaymentOrder(true);
                    return;
                }
                BMAG01ACT activity = AppActivityManager.getAppManager().getActivity(BMAG01ACT.class);
                MT1ACT.this.mRxManager.post("Status", "登录");
                activity.onCheckPosition(0);
                AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
                MT1ACT.this.finish();
            }
        });
    }

    public void initView(Bundle bundle) {
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            int i = extras.getInt(NotificationCompat.CATEGORY_STATUS, 0);
            String string = extras.getString(NotificationCompat.CATEGORY_MESSAGE, "");
            this.msg = string;
            this.money = string;
            this.myBorrow = extras.getSerializable("myBorrow");
            setDataView(i);
        }
        config();
        repaymentOrder(true);
        startCountDown();
    }

    public void setDataView(int i) {
        this.time.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis())));
        if (i == 1) {
            this.tvStatus.setText(getResources().getString(2131689911));
            this.mRxManager.post("Status", "登录");
            this.imgStatus.setImageResource(2131558464);
            this.tipTime.setText(getResources().getString(2131689912));
            this.tipFail.setText(getResources().getString(2131689963));
            this.failReason.setText(getString(2131689824) + this.money);
            this.btnOk.setText(getResources().getString(2131689614));
            this.tip.setText(getResources().getString(2131689624));
            return;
        }
        if (i == 2) {
            this.tvStatus.setText(getResources().getString(2131689975));
            this.mRxManager.post("Status", "登录");
            this.imgStatus.setImageResource(2131558466);
            this.tipTime.setText(getResources().getString(2131689912));
            this.tipFail.setText(getResources().getString(2131689963));
            this.failReason.setText(getString(2131689824) + this.money);
            this.btnOk.setText(getResources().getString(2131689959));
            this.tip.setText(getResources().getString(2131690147));
            return;
        }
        this.tvStatus.setText(getResources().getString(2131689971));
        this.tipTime.setText(getResources().getString(2131689895));
        this.tipFail.setText(getResources().getString(2131689738));
        this.failReason.setText(this.msg);
        this.btnOk.setText(getResources().getString(2131689615));
        this.tip.setText(getResources().getString(2131690146));
    }

    protected void repaymentOrder(boolean z) {
        if (ComNetWorkUtil.isNetworkAvailable(this.mContext)) {
            MyBorrowBean myBorrowBean = this.myBorrow;
            if (myBorrowBean != null) {
                this.mRxManager.add(Api.getDefault().checkRepaymentStatus(myBorrowBean.getOrderNo()).compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<BaseResult>(this.mContext, z) {
                    public void _onNext(BaseResult baseResult) {
                        if (baseResult.getCode() == 2023) {
                            MT1ACT.this.setDataView(1);
                            return;
                        }
                        if (baseResult.getCode() == 2022) {
                            MT1ACT.this.setDataView(2);
                            return;
                        }
                        if (baseResult.getCode() == 2005) {
                            MT1ACT.this.msg = baseResult.getMessage();
                            MT1ACT.this.setDataView(0);
                        } else {
                            if (baseResult.getCode() == 200) {
                                MT1ACT.this.setDataView(1);
                                return;
                            }
                            MT1ACT.this.msg = baseResult.getMessage();
                            MT1ACT.this.setDataView(0);
                        }
                    }

                    protected void _onError(String str) {
                        MT1ACT.this.showShortToast(str);
                    }
                }));
            } else {
                showShortToast(getResources().getString(2131689868));
            }
        }
    }

    protected void onDestroy() {
        super.onDestroy();
        stopCountDown();
    }

    private void stopCountDown() {
        CountDownTimer countDownTimer = this.countDownTimer;
        if (countDownTimer != null) {
            countDownTimer.cancel();
            this.countDownTimer = null;
        }
    }

    protected void config() {
        this.mRxManager.add(Api.getDefault().getServiceConfig().compose(RxHelper.handleResult()).subscribe(new RxSubscriber<ConfigBean>(this.mContext, false) {
            protected void _onError(String str) {
            }

            public void _onNext(ConfigBean configBean) {
                String tel = configBean.getTel();
                String time = configBean.getTime();
                SPUtils.putData("TEL", tel);
                String qq = configBean.getQq();
                String wx = configBean.getWx();
                if (!RegexUtil.isEmpty(tel)) {
                    MT1ACT.this.kefTel.setText(MT1ACT.this.getResources().getString(2131689629) + tel);
                }
                if (!RegexUtil.isEmpty(time)) {
                    MT1ACT.this.kefTime.setText(MT1ACT.this.getResources().getString(2131690108) + time);
                }
                if (!RegexUtil.isEmpty(wx)) {
                    MT1ACT.this.kef_wx.setText(MT1ACT.this.getResources().getString(2131689630) + wx);
                }
                if (RegexUtil.isEmpty(qq)) {
                    return;
                }
                MT1ACT.this.kef_qq.setText(MT1ACT.this.getResources().getString(2131689632) + qq);
            }
        }));
    }
}