导航菜单

页面标题

页面副标题

Easycash v3.75.13 - ECAuthLoanActivity.java 源代码

正在查看: Easycash v3.75.13 应用的 ECAuthLoanActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.lingyue.easycash.business.loan;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.text.InputFilter;
import android.text.TextUtils;
import android.text.method.DigitsKeyListener;
import android.util.Pair;
import android.view.KeyEvent;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.graphics.ColorUtils;
import androidx.core.widget.NestedScrollView;
import butterknife.BindView;
import butterknife.OnClick;
import com.lingyue.easycash.Constants;
import com.lingyue.easycash.R;
import com.lingyue.easycash.account.u;
import com.lingyue.easycash.business.loan.widget.LoanAgreementView;
import com.lingyue.easycash.commom.EasyCashCommonActivity;
import com.lingyue.easycash.commom.IUserSession;
import com.lingyue.easycash.core.HomeCore;
import com.lingyue.easycash.fragment.EasyCashCaptchaFragment;
import com.lingyue.easycash.models.BankCardInfo;
import com.lingyue.easycash.models.LabelBean;
import com.lingyue.easycash.models.LoanProtocolBean;
import com.lingyue.easycash.models.MobileVerificationPurpose;
import com.lingyue.easycash.models.enums.CreateOrderPopupType;
import com.lingyue.easycash.models.event.CompletedIntentOrderStickyEvent;
import com.lingyue.easycash.models.event.UserConfirmAgreementStickyEvent;
import com.lingyue.easycash.models.home.LoanSignAgreementFormat;
import com.lingyue.easycash.models.intentionorder.CompositeLoanProduct;
import com.lingyue.easycash.models.intentionorder.IntentOrderAgreementBean;
import com.lingyue.easycash.models.intentionorder.IntentOrderDisplayStrategy;
import com.lingyue.easycash.models.intentionorder.IntentionCalculateRequest;
import com.lingyue.easycash.models.intentionorder.IntentionCalculateResponse;
import com.lingyue.easycash.models.intentionorder.IntentionProduct;
import com.lingyue.easycash.models.intentionorder.IntentionProductRequest;
import com.lingyue.easycash.models.intentionorder.LoanPrincipalOption;
import com.lingyue.easycash.models.intentionorder.ManualInputLoanProduct;
import com.lingyue.easycash.models.intentionorder.MultipleProductSubProduct;
import com.lingyue.easycash.models.intentionorder.RepaymentPlan;
import com.lingyue.easycash.models.intentionorder.TotalRepayPrincipalVO;
import com.lingyue.easycash.utils.SensorTrackEvent;
import com.lingyue.easycash.widget.IntentOrderCardExp2;
import com.lingyue.easycash.widget.IntentOrderCardExp3;
import com.lingyue.easycash.widget.IntentOrderCardExp4;
import com.lingyue.easycash.widget.bottomDialog.EasyCashBottomLoanAgreementDialog;
import com.lingyue.easycash.widght.AuthGeneralView;
import com.lingyue.easycash.widght.BaseAuthGeneralView;
import com.lingyue.easycash.widght.bottomDialog.EasyCashBottomAgreementDialog;
import com.lingyue.easycash.widght.selectLabelBeanView.SingleRowSelectCompanion;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.IdnBaseResult;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.model.response.EmptyResponse;
import com.lingyue.idnbaselib.utils.DevUtil;
import com.lingyue.idnbaselib.utils.EcFormatUtil;
import com.lingyue.idnbaselib.widget.OnItemClickListener;
import com.lingyue.supertoolkit.customtools.CollectionUtils;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.yangqianguan.statistics.AutoTrackHelper;
import io.reactivex.Flowable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.processors.BehaviorProcessor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONException;
import org.json.JSONObject;

public class ECAuthLoanActivity extends EasyCashCommonActivity implements EasyCashCaptchaFragment.CallBack, IUserSession.IUserLoginStateChangeListener {
    private EasyCashCaptchaFragment E;
    private SingleRowSelectCompanion G;

    @Nullable
    private IntentionCalculateResponse.IntentionCalculateBody H;
    private boolean I;

    @Nullable
    private SelectTermItemInfo J;
    private String K;
    private IntentOrderDisplayStrategy L;

    @Nullable
    private IntentionProduct M;

    @BindView(R.id.apply_now)
    View applyNow;

    @BindView(R.id.auth_loan_repayment_info)
    RepaymentInfoForAuthView authLoanRepaymentInfo;

    @BindView(R.id.auth_loan_tip_bottom)
    TextView authLoanTipBottom;

    @BindView(R.id.auth_loan_sub_title)
    TextView authLoanTipSubTitle;

    @BindView(R.id.auth_loan_tip_title)
    TextView authLoanTipTitle;

    @BindView(R.id.card_exp2)
    IntentOrderCardExp2 cardExp2;

    @BindView(R.id.card_exp4)
    IntentOrderCardExp4 cardExp4;

    @BindView(R.id.card_exp3)
    IntentOrderCardExp3 cardExpFirst3;

    @BindView(R.id.error_content)
    View errorContent;

    @BindView(R.id.error_root)
    View errorRoot;

    @BindView(R.id.lav_loan_agreement_view)
    LoanAgreementView lavLoanAgreementView;

    @BindView(R.id.loan_amount)
    AuthGeneralView loanAmountView;

    @BindView(R.id.loan_term)
    AuthGeneralView loanTermView;

    @BindView(R.id.nsv_content)
    NestedScrollView nsvContent;

    @BindView(R.id.skip_wait)
    TextView skipWait;
    private final int B = Color.parseColor("#EBFFE6");
    private final int C = -1;
    private final int D = 200;

    @NonNull
    private volatile AmountCheckUtil F = new AmountCheckUtil(new BigDecimal(60000000), new BigDecimal(100000));

    @Nullable
    private ArrayList<IntentionProduct> N = new ArrayList<>();

    @Nullable
    private ArrayList<IntentOrderAgreementBean> O = new ArrayList<>();
    private final BehaviorProcessor<BigDecimal> P = BehaviorProcessor.B0();

    static class AnonymousClass9 {
        static final int[] a;

        static {
            int[] iArr = new int[IntentOrderDisplayStrategy.values().length];
            a = iArr;
            try {
                iArr[IntentOrderDisplayStrategy.A1.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[IntentOrderDisplayStrategy.A3.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[IntentOrderDisplayStrategy.A2.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[IntentOrderDisplayStrategy.A4.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                a[IntentOrderDisplayStrategy.A5.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
        }
    }

    private static class SelectTermItemInfo implements Serializable {
        String matchAmount;
        String selectTerm;
        TotalRepayPrincipalVO selectTermItem;

        public SelectTermItemInfo(String str, TotalRepayPrincipalVO totalRepayPrincipalVO, String str2) {
            this.selectTerm = str;
            this.selectTermItem = totalRepayPrincipalVO;
            this.matchAmount = str2;
        }

        public BigDecimal a() {
            TotalRepayPrincipalVO totalRepayPrincipalVO = this.selectTermItem;
            return totalRepayPrincipalVO != null ? totalRepayPrincipalVO.repayAmount : BigDecimal.ZERO;
        }

        public boolean b() {
            return (TextUtils.isEmpty(this.selectTerm) || this.selectTermItem == null) ? false : true;
        }
    }

    public void A1() {
        C1(this.H);
        B1(this.H.orderPageSignFormat);
        this.cardExpFirst3.setAuthLoanAmountAndTermCardListener(new IntentOrderCardExp3.AuthLoanAmountAndTermCardListener() {
            @Override
            public void a(AuthGeneralView authGeneralView) {
                ECAuthLoanActivity.this.u1(authGeneralView);
            }

            @Override
            public void b(@NonNull RepaymentPlan repaymentPlan) {
                ECAuthLoanActivity eCAuthLoanActivity = ECAuthLoanActivity.this;
                eCAuthLoanActivity.M = eCAuthLoanActivity.cardExpFirst3.getSelectedSingleLoanProduct();
                ECAuthLoanActivity eCAuthLoanActivity2 = ECAuthLoanActivity.this;
                eCAuthLoanActivity2.D0(eCAuthLoanActivity2.M);
                ECAuthLoanActivity eCAuthLoanActivity3 = ECAuthLoanActivity.this;
                eCAuthLoanActivity3.applyNow.setEnabled(eCAuthLoanActivity3.M != null && ECAuthLoanActivity.this.M.isValid(ECAuthLoanActivity.this.F));
            }

            @Override
            public void c(@NonNull LoanPrincipalOption loanPrincipalOption) {
                ECAuthLoanActivity eCAuthLoanActivity = ECAuthLoanActivity.this;
                eCAuthLoanActivity.M = eCAuthLoanActivity.cardExpFirst3.getSelectedSingleLoanProduct();
                ECAuthLoanActivity eCAuthLoanActivity2 = ECAuthLoanActivity.this;
                eCAuthLoanActivity2.D0(eCAuthLoanActivity2.M);
                ECAuthLoanActivity.this.v1(loanPrincipalOption.principal);
                ECAuthLoanActivity eCAuthLoanActivity3 = ECAuthLoanActivity.this;
                eCAuthLoanActivity3.applyNow.setEnabled(eCAuthLoanActivity3.M != null && ECAuthLoanActivity.this.M.isValid(ECAuthLoanActivity.this.F));
            }

            @Override
            public void d(IntentionProduct intentionProduct) {
                ECAuthLoanActivity.this.M = intentionProduct;
                ECAuthLoanActivity eCAuthLoanActivity = ECAuthLoanActivity.this;
                eCAuthLoanActivity.D0(eCAuthLoanActivity.M);
                ECAuthLoanActivity eCAuthLoanActivity2 = ECAuthLoanActivity.this;
                eCAuthLoanActivity2.applyNow.setEnabled(eCAuthLoanActivity2.M != null && ECAuthLoanActivity.this.M.isValid(ECAuthLoanActivity.this.F));
            }
        });
        IntentOrderCardExp3 intentOrderCardExp3 = this.cardExpFirst3;
        IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
        intentOrderCardExp3.v(intentionCalculateBody.singleLoanProduct, intentionCalculateBody.userCreditsInfo, intentionCalculateBody.displayStrategy);
        IntentionProduct selectedSingleLoanProduct = this.cardExpFirst3.getSelectedSingleLoanProduct();
        this.M = selectedSingleLoanProduct;
        this.applyNow.setEnabled(selectedSingleLoanProduct != null && selectedSingleLoanProduct.isValid(this.F));
    }

    private void B1(LoanSignAgreementFormat loanSignAgreementFormat) {
        this.lavLoanAgreementView.n(loanSignAgreementFormat, null, new LoanAgreementView.LoanAgreementViewListener() {
            @Override
            public void b(@NonNull String str, boolean z2) {
                if (BaseUtils.l()) {
                    return;
                }
                ECAuthLoanActivity.this.x1(str, z2);
            }

            @Override
            public void c(CompoundButton compoundButton, boolean z2) {
            }
        });
        this.lavLoanAgreementView.setVisibility(0);
    }

    public void C0(List<IntentionProduct> list) {
        F1();
        if (list == null) {
            return;
        }
        int size = list.size();
        for (int i = 0; i < size; i++) {
            IntentionProduct intentionProduct = list.get(i);
            if (intentionProduct.isValid(this.F)) {
                ArrayList<IntentOrderAgreementBean> arrayList = this.O;
                String loanAgreementUrl = this.H.orderPageSignFormat.getLoanAgreementUrl();
                String bigDecimal = intentionProduct.principal.toString();
                String str = intentionProduct.productId;
                IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
                BankCardInfo bankCardInfo = intentionCalculateBody.loanBankCard;
                arrayList.add(new IntentOrderAgreementBean(loanAgreementUrl, bigDecimal, str, bankCardInfo.paymentMethod, bankCardInfo.credentialId, null, size == 1 ? intentionCalculateBody.agreementPrefix : this.H.agreementPrefix + (i + 1), null, null, false));
            }
        }
    }

    private void C1(IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody) {
        if (TextUtils.isEmpty(intentionCalculateBody.headTitle)) {
            this.authLoanTipTitle.setText(R.string.easycash_auth_loan_title);
        } else {
            this.authLoanTipTitle.setText(intentionCalculateBody.headTitle);
        }
        if (TextUtils.isEmpty(intentionCalculateBody.headContent)) {
            this.authLoanTipSubTitle.setText(R.string.easycash_auth_loan_sub_title);
        } else {
            this.authLoanTipSubTitle.setText(intentionCalculateBody.headContent);
        }
    }

    public void D0(IntentionProduct intentionProduct) {
        F1();
        if (intentionProduct == null || !intentionProduct.isValid(this.F)) {
            return;
        }
        ArrayList<IntentOrderAgreementBean> arrayList = this.O;
        String loanAgreementUrl = this.H.orderPageSignFormat.getLoanAgreementUrl();
        String bigDecimal = intentionProduct.principal.toString();
        String str = intentionProduct.productId;
        IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
        BankCardInfo bankCardInfo = intentionCalculateBody.loanBankCard;
        arrayList.add(new IntentOrderAgreementBean(loanAgreementUrl, bigDecimal, str, bankCardInfo.paymentMethod, bankCardInfo.credentialId, null, intentionCalculateBody.agreementPrefix, null, null, false));
    }

    public void D1(SensorTrackEvent sensorTrackEvent, IdnBaseResult.Status status) {
        JSONObject a = sensorTrackEvent.a();
        try {
            a.put("result", status.code == 0 ? "1" : "0");
            a.put("error_cause", status.detail);
            a.put("error_code", "" + status.code);
        } catch (JSONException e) {
            DevUtil.a(e);
        }
        logSensorEvent(sensorTrackEvent, a);
    }

    private void E0() {
        F1();
        List<MultipleProductSubProduct> selectedProductIds = this.cardExp4.getSelectedProductIds();
        if (CollectionUtils.f(selectedProductIds)) {
            return;
        }
        int size = selectedProductIds.size();
        for (int i = 0; i < size; i++) {
            MultipleProductSubProduct multipleProductSubProduct = selectedProductIds.get(i);
            if (!TextUtils.equals(MultipleProductSubProduct.EMPTY_PRODUCT_ID, multipleProductSubProduct.productId)) {
                ArrayList<IntentOrderAgreementBean> arrayList = this.O;
                String loanAgreementUrl = this.H.orderPageSignFormat.getLoanAgreementUrl();
                String valueOf = String.valueOf(multipleProductSubProduct.principal);
                String str = multipleProductSubProduct.productId;
                IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
                BankCardInfo bankCardInfo = intentionCalculateBody.loanBankCard;
                arrayList.add(new IntentOrderAgreementBean(loanAgreementUrl, valueOf, str, bankCardInfo.paymentMethod, bankCardInfo.credentialId, null, size == 1 ? intentionCalculateBody.agreementPrefix : this.H.agreementPrefix + (i + 1), null, null, false));
            }
        }
    }

    private void E1(SensorTrackEvent sensorTrackEvent) {
        JSONObject a = sensorTrackEvent.a();
        try {
            a.put("test_name", this.L.name());
            logSensorEvent(sensorTrackEvent, a);
        } catch (JSONException e) {
            throw new RuntimeException(e);
        }
    }

    private List<IntentionProduct> F0(String str, String str2) {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new IntentionProduct(H1(str), str2));
        return arrayList;
    }

    private void F1() {
        ArrayList<IntentOrderAgreementBean> arrayList = this.O;
        if (arrayList == null) {
            this.O = new ArrayList<>();
        } else {
            arrayList.clear();
        }
    }

    private Pair<List<IntentionProduct>, Boolean> G0() {
        ArrayList arrayList = new ArrayList();
        boolean z2 = false;
        for (MultipleProductSubProduct multipleProductSubProduct : this.cardExp4.getSelectedProductIds()) {
            if (multipleProductSubProduct.isSelected) {
                if (TextUtils.equals(multipleProductSubProduct.productId, MultipleProductSubProduct.EMPTY_PRODUCT_ID)) {
                    z2 = true;
                } else {
                    arrayList.add(multipleProductSubProduct.convertToProduct());
                }
            }
        }
        return new Pair<>(arrayList, Boolean.valueOf(z2));
    }

    private void G1() {
        r1(null, null, null);
    }

    private IntentionProductRequest H0(List<IntentionProduct> list, @Nullable Boolean bool, @Nullable String str, @Nullable String str2) {
        IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
        if (intentionCalculateBody == null) {
            return null;
        }
        String str3 = intentionCalculateBody.createOrderScene;
        BankCardInfo bankCardInfo = intentionCalculateBody.loanBankCard;
        return new IntentionProductRequest(str3, bankCardInfo.paymentMethod, bankCardInfo.credentialId, intentionCalculateBody.displayStrategy, list, bool, str, str2);
    }

    @NonNull
    private BigDecimal H1(String str) {
        return this.F.g(str);
    }

    private IntentionProductRequest I0(List<IntentionProduct> list, @Nullable Boolean bool, boolean z2, boolean z3, @Nullable String str, @Nullable String str2) {
        IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
        if (intentionCalculateBody == null) {
            return null;
        }
        String str3 = intentionCalculateBody.createOrderScene;
        BankCardInfo bankCardInfo = intentionCalculateBody.loanBankCard;
        return new IntentionProductRequest(str3, bankCardInfo.paymentMethod, bankCardInfo.credentialId, intentionCalculateBody.displayStrategy, list, bool, str, str2, Boolean.valueOf(z2), Boolean.valueOf(z3));
    }

    private void I1(IntentionProductRequest intentionProductRequest) {
        this.apiHelper.a().B1(intentionProductRequest).a(new IdnObserver<EmptyResponse>(this) {
            @Override
            public void onError(Throwable th, EmptyResponse emptyResponse) {
                ECAuthLoanActivity.this.dismissLoadingDialog();
                ECAuthLoanActivity.this.D1(SensorTrackEvent.EC_AUTH_LOAN_ACT_API_RESULT, emptyResponse.status);
                if (ECAuthLoanActivity.this.E == null || !ECAuthLoanActivity.this.a1(emptyResponse.status.code)) {
                    ECAuthLoanActivity.this.finish();
                    return;
                }
                ECAuthLoanActivity.this.E.P0(emptyResponse.status.code);
                if (emptyResponse.status.code == Constants.a) {
                    return;
                }
                super.onError(th, (Throwable) emptyResponse);
            }

            @Override
            public void onSuccess(EmptyResponse emptyResponse) {
                ECAuthLoanActivity.this.dismissLoadingDialog();
                ECAuthLoanActivity.this.D1(SensorTrackEvent.EC_AUTH_LOAN_ACT_API_RESULT, emptyResponse.status);
                ECAuthLoanActivity.this.finish();
            }

            @Override
            protected boolean superShowErrorToast() {
                return ECAuthLoanActivity.this.E != null;
            }
        });
    }

    private void J0(String str) {
        SelectTermItemInfo selectTermItemInfo;
        if (this.H == null || (selectTermItemInfo = this.J) == null || !selectTermItemInfo.b() || TextUtils.isEmpty(str)) {
            DevUtil.a(new NullPointerException());
        } else {
            showLoadingDialog();
            I1(H0(F0(str, String.valueOf(this.J.selectTermItem.terms)), null, null, null));
        }
    }

    private void J1() {
        if (CollectionUtils.f(this.O)) {
            return;
        }
        ArrayList arrayList = new ArrayList();
        Iterator<IntentOrderAgreementBean> it = this.O.iterator();
        while (it.hasNext()) {
            IntentOrderAgreementBean next = it.next();
            arrayList.add(new LoanProtocolBean(next.pageTitle, next.agreementUrl));
        }
        EasyCashBottomLoanAgreementDialog easyCashBottomLoanAgreementDialog = new EasyCashBottomLoanAgreementDialog(this, arrayList, this.O, getString(R.string.easycash_loan_agreement_dialog_dsc));
        easyCashBottomLoanAgreementDialog.f(new EasyCashBottomLoanAgreementDialog.OnItemClickListener() {
            @Override
            public final void a(IntentOrderAgreementBean intentOrderAgreementBean) {
                ECAuthLoanActivity.this.n1(intentOrderAgreementBean);
            }
        });
        easyCashBottomLoanAgreementDialog.show();
    }

    private void K0(String str, String str2) {
        if (CollectionUtils.f(this.N)) {
            return;
        }
        showLoadingDialog();
        I1(I0(this.N, null, this.cardExp2.getAgreeSuggestedAmountChecked(), this.cardExp2.getAgreeSuggestedTermsChecked(), str, str2));
    }

    private void K1() {
        this.G.d();
    }

    private void L0(@Nullable String str, @Nullable String str2) {
        showLoadingDialog();
        Pair<List<IntentionProduct>, Boolean> G0 = G0();
        I1(H0((List) G0.first, (Boolean) G0.second, str, str2));
    }

    private void L1(IntentOrderDisplayStrategy intentOrderDisplayStrategy) {
        IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
        if (intentionCalculateBody == null) {
            return;
        }
        if (CreateOrderPopupType.fromName(intentionCalculateBody.createOrderPopupType) == CreateOrderPopupType.OTP_POPUP) {
            showSmsVerificationDialogFragment();
        } else {
            N0(intentOrderDisplayStrategy, null, null);
        }
    }

    private void M0(String str, String str2) {
        if (this.M == null) {
            return;
        }
        showLoadingDialog();
        ArrayList arrayList = new ArrayList();
        arrayList.add(this.M);
        I1(H0(arrayList, null, str, str2));
    }

    private void M1(IntentionCalculateResponse.UserCreditsInfo userCreditsInfo, boolean z2) {
        if (userCreditsInfo == null || !userCreditsInfo.isValid()) {
            return;
        }
        if (this.F.a.doubleValue() == userCreditsInfo.maxAmount && this.F.b.doubleValue() == userCreditsInfo.minAmount) {
            return;
        }
        this.F = new AmountCheckUtil(new BigDecimal(userCreditsInfo.maxAmount), new BigDecimal(userCreditsInfo.minAmount));
        if (z2) {
            this.loanAmountView.d().setText(this.F.e(this));
            this.loanAmountView.d().setTextColor(-16777216);
        }
    }

    private void N0(IntentOrderDisplayStrategy intentOrderDisplayStrategy, @Nullable String str, @Nullable String str2) {
        int i = AnonymousClass9.a[intentOrderDisplayStrategy.ordinal()];
        if (i == 1 || i == 2) {
            M0(str, str2);
        } else if (i == 3) {
            K0(str, str2);
        } else {
            if (i != 4) {
                return;
            }
            L0(str, str2);
        }
    }

    @SuppressLint({"CheckResult"})
    private void N1(ManualInputLoanProduct manualInputLoanProduct, boolean z2) {
        SelectTermItemInfo selectTermItemInfo = this.J;
        if (selectTermItemInfo != null && !TextUtils.isEmpty(selectTermItemInfo.selectTerm)) {
            int indexOf = manualInputLoanProduct.termList.indexOf(this.J.selectTerm);
            if (indexOf == -1) {
                G1();
            } else if (indexOf < manualInputLoanProduct.totalRepayPrincipalVOList.size()) {
                r1(this.J.selectTerm, manualInputLoanProduct.defaultDayInterestRate, manualInputLoanProduct.totalRepayPrincipalVOList.get(indexOf));
            }
        }
        Flowable.I(manualInputLoanProduct.termList).N(new Function() {
            public final Object apply(Object obj) {
                LabelBean o1;
                o1 = ECAuthLoanActivity.o1((String) obj);
                return o1;
            }
        }).Q(AndroidSchedulers.a()).w0().e(new Consumer() {
            public final void accept(Object obj) {
                ECAuthLoanActivity.this.p1((List) obj);
            }
        }, new u());
    }

    private void O0() {
        R0(this.L);
        q1();
    }

    private void O1(String str, String str2) {
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            this.authLoanRepaymentInfo.b(str, str2);
            this.authLoanRepaymentInfo.setVisibility(8);
        } else {
            this.authLoanRepaymentInfo.b(str, str2);
            this.authLoanRepaymentInfo.setVisibility(Z0());
        }
    }

    private void P0(IntentOrderDisplayStrategy intentOrderDisplayStrategy) {
        int i = AnonymousClass9.a[intentOrderDisplayStrategy.ordinal()];
        if (i == 1) {
            this.cardExpFirst3.m(this);
            this.cardExpFirst3.setVisibility(0);
            return;
        }
        if (i == 2) {
            this.cardExpFirst3.m(this);
            this.cardExpFirst3.setVisibility(0);
            this.skipWait.setVisibility(0);
            return;
        }
        if (i == 3) {
            this.cardExp2.n(this);
            this.cardExp2.setVisibility(0);
            return;
        }
        if (i == 4) {
            this.cardExp4.setVisibility(0);
            return;
        }
        if (i != 5) {
            return;
        }
        this.loanAmountView.setVisibility(0);
        this.loanTermView.setVisibility(0);
        this.authLoanTipBottom.setVisibility(0);
        registerHideInputWhenTouchOutside(this.loanAmountView.getEtContent(), this.loanAmountView);
        T0(this.loanAmountView);
        U0();
        this.errorContent.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ECAuthLoanActivity.b1(view);
            }
        });
        IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
        if (intentionCalculateBody != null) {
            w1(intentionCalculateBody, false);
        }
        SelectTermItemInfo selectTermItemInfo = this.J;
        if (selectTermItemInfo == null) {
            IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody2 = this.H;
            r1(null, intentionCalculateBody2 == null ? null : intentionCalculateBody2.manualInputLoanProduct.defaultDayInterestRate, null);
        } else {
            String str = selectTermItemInfo.selectTerm;
            IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody3 = this.H;
            r1(str, intentionCalculateBody3 != null ? intentionCalculateBody3.manualInputLoanProduct.defaultDayInterestRate : null, selectTermItemInfo.selectTermItem);
        }
        this.applyNow.setEnabled(Y0());
    }

    private void P1(IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody) {
        if (intentionCalculateBody == null) {
            this.authLoanTipTitle.setText(R.string.easycash_auth_loan_title);
            this.authLoanTipSubTitle.setText(R.string.easycash_auth_loan_sub_title);
            this.authLoanTipBottom.setText(R.string.easycash_auth_loan_confirm_tip);
            return;
        }
        if (TextUtils.isEmpty(intentionCalculateBody.headTitle)) {
            this.authLoanTipTitle.setText(R.string.easycash_auth_loan_title);
        } else {
            this.authLoanTipTitle.setText(intentionCalculateBody.headTitle);
        }
        if (TextUtils.isEmpty(intentionCalculateBody.headContent)) {
            this.authLoanTipSubTitle.setText(R.string.easycash_auth_loan_sub_title);
        } else {
            this.authLoanTipSubTitle.setText(intentionCalculateBody.headContent);
        }
        this.authLoanTipBottom.setText(intentionCalculateBody.manualInputLoanProduct.tail);
    }

    private void Q0(@Nullable String str, final boolean z2, final boolean z3) {
        if (z3) {
            showLoadingDialog();
        }
        this.I = false;
        this.apiHelper.a().O0(new IntentionCalculateRequest(str)).a(new IdnObserver<IntentionCalculateResponse>(this) {
            @Override
            public void onError(Throwable th, IntentionCalculateResponse intentionCalculateResponse) {
                super.onError(th, (Throwable) intentionCalculateResponse);
                ECAuthLoanActivity.this.hideSoftInput();
                ECAuthLoanActivity.this.errorContent.setVisibility(0);
                ECAuthLoanActivity.this.applyNow.setVisibility(8);
            }

            @Override
            public void onSuccess(IntentionCalculateResponse intentionCalculateResponse) {
                ECAuthLoanActivity.this.applyNow.setVisibility(0);
                ECAuthLoanActivity.this.errorContent.setVisibility(8);
                ECAuthLoanActivity.this.H = intentionCalculateResponse.body;
                int i = AnonymousClass9.a[ECAuthLoanActivity.this.L.ordinal()];
                if (i == 1 || i == 2) {
                    ECAuthLoanActivity.this.A1();
                } else if (i == 3) {
                    ECAuthLoanActivity.this.y1();
                } else if (i == 4) {
                    ECAuthLoanActivity.this.z1();
                } else if (i == 5) {
                    ECAuthLoanActivity.this.w1(intentionCalculateResponse.body, z2);
                }
                if (z3) {
                    ECAuthLoanActivity.this.dismissLoadingDialog();
                }
            }
        });
    }

    private void R0(IntentOrderDisplayStrategy intentOrderDisplayStrategy) {
        int i = AnonymousClass9.a[intentOrderDisplayStrategy.ordinal()];
        if (i == 1 || i == 2 || i == 3 || i == 4) {
            Q0(null, true, true);
        } else if (i == 5 && this.H == null) {
            Q0("100000", true, true);
        }
    }

    public void S0() {
        String str;
        String str2;
        if (this.H == null) {
            R0(this.L);
            return;
        }
        if (this.L != IntentOrderDisplayStrategy.A5) {
            if (this.lavLoanAgreementView.g()) {
                L1(this.L);
                return;
            } else {
                displayGuidanceDlg();
                return;
            }
        }
        SelectTermItemInfo selectTermItemInfo = this.J;
        if (selectTermItemInfo == null || !selectTermItemInfo.b()) {
            return;
        }
        if (this.I) {
            J0(this.loanAmountView.getAmountText());
            return;
        }
        IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
        BankCardInfo bankCardInfo = intentionCalculateBody.loanBankCard;
        if (bankCardInfo != null) {
            String str3 = bankCardInfo.paymentMethod;
            str2 = bankCardInfo.credentialId;
            str = str3;
        } else {
            str = "";
            str2 = str;
        }
        String str4 = intentionCalculateBody.agreementUrl;
        String amountText = this.loanAmountView.getAmountText();
        TotalRepayPrincipalVO totalRepayPrincipalVO = this.J.selectTermItem;
        s1(new IntentOrderAgreementBean(str4, amountText, totalRepayPrincipalVO.productId, str, str2, null, null, this.H.createOrderScene, String.valueOf(totalRepayPrincipalVO.terms), true));
    }

    private void T0(final AuthGeneralView authGeneralView) {
        authGeneralView.d().setTextSize(2, 10.0f);
        authGeneralView.d().setTextColor(getResources().getColor(2131099807));
        authGeneralView.getEtContent().setKeyListener(DigitsKeyListener.getInstance("0123456789"));
        authGeneralView.getEtContent().setInputType(2);
        authGeneralView.getEtContent().setFilters(new InputFilter[]{new InputFilter.LengthFilter(17)});
        authGeneralView.setFormatter(new BaseAuthGeneralView.Formatter() {
            @Override
            public final String a(String str) {
                String c1;
                c1 = ECAuthLoanActivity.this.c1(str);
                return c1;
            }
        });
        authGeneralView.getEtContent().setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
                boolean d1;
                d1 = ECAuthLoanActivity.this.d1(authGeneralView, textView, i, keyEvent);
                return d1;
            }
        });
        authGeneralView.setOnFocusListener(new BaseAuthGeneralView.OnFocusListener() {
            @Override
            public final void a() {
                ECAuthLoanActivity.this.e1();
            }
        });
        authGeneralView.setOnLoseFocusListener(new BaseAuthGeneralView.OnLoseFocusListener() {
            @Override
            public final void a() {
                ECAuthLoanActivity.this.f1(authGeneralView);
            }
        });
        if (TextUtils.isEmpty(this.K)) {
            return;
        }
        this.loanAmountView.setInputText(this.K);
    }

    private void U0() {
        this.G = new SingleRowSelectCompanion(getString(R.string.easycash_auth_loan_term_hint), this.loanTermView, this);
        this.loanTermView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ECAuthLoanActivity.this.g1(view);
            }
        });
    }

    private void V0() {
        if (this.E == null) {
            EasyCashCaptchaFragment y0 = EasyCashCaptchaFragment.y0(this.userSession.b().mobileNumber, MobileVerificationPurpose.VERIFY_CREATE_ORDER);
            this.E = y0;
            y0.U0(this);
        }
    }

    private void W0() {
        EasyCashCaptchaFragment easyCashCaptchaFragment = this.E;
        if (easyCashCaptchaFragment != null) {
            easyCashCaptchaFragment.U0(this);
        }
    }

    private void X0() {
        if (this.f == null) {
            return;
        }
        setTitle(this.L == IntentOrderDisplayStrategy.A5 ? getString(R.string.easycash_borrow_intent) : getString(R.string.easycash_borrowing_requirements));
        this.f.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ECAuthLoanActivity.this.h1(view);
            }
        });
        this.a.setVisibility(0);
        this.a.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ECAuthLoanActivity.this.i1(view);
            }
        });
    }

    private boolean Y0() {
        SelectTermItemInfo selectTermItemInfo;
        return this.F.b(H1(this.loanAmountView.getAmountText())) && (selectTermItemInfo = this.J) != null && selectTermItemInfo.b();
    }

    private int Z0() {
        return Y0() ? 0 : 8;
    }

    public boolean a1(int i) {
        return i == Constants.a || i == Constants.b;
    }

    public static Intent args(Context context, IntentOrderDisplayStrategy intentOrderDisplayStrategy) {
        Intent intent = new Intent(context, (Class<?>) ECAuthLoanActivity.class);
        intent.putExtra("INTENT_PARAMS_DISPLAY_STRATEGY", intentOrderDisplayStrategy);
        return intent;
    }

    @SensorsDataInstrumented
    public static void b1(View view) {
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    public String c1(String str) {
        if (str.length() == 0) {
            t1("");
            return str;
        }
        String replaceAll = str.replaceAll("[^0-9]", "");
        BigDecimal H1 = H1(replaceAll);
        t1(replaceAll);
        return TextUtils.isEmpty(replaceAll) ? "" : EcFormatUtil.l(H1);
    }

    public boolean d1(AuthGeneralView authGeneralView, TextView textView, int i, KeyEvent keyEvent) {
        if (i != 5 && i != 6) {
            return false;
        }
        hideSoftInput();
        authGeneralView.getEtContent().clearFocus();
        u1(authGeneralView);
        return true;
    }

    public void e1() {
        t1(this.loanAmountView.getAmountText());
    }

    public void f1(AuthGeneralView authGeneralView) {
        hideSoftInput();
        if (TextUtils.isEmpty(this.loanAmountView.getAmountText())) {
            this.loanAmountView.d().setVisibility(4);
        }
        u1(authGeneralView);
    }

    @SensorsDataInstrumented
    public void g1(View view) {
        if (BaseUtils.l() || this.H == null) {
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
        } else {
            K1();
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
        }
    }

    @SensorsDataInstrumented
    public void h1(View view) {
        finish();
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    @SensorsDataInstrumented
    public void i1(View view) {
        if (BaseUtils.l()) {
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
        } else {
            openCustomerService();
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
        }
    }

    public void j1(NestedScrollView nestedScrollView, int i, int i2, int i3, int i4) {
        this.f.setBackgroundColor(ColorUtils.blendARGB(this.B, -1, Math.min(1.0f, i2 / 200.0f)));
    }

    public void k1(boolean z2, BigDecimal bigDecimal) throws Exception {
        Q0(bigDecimal.toString(), false, z2);
    }

    public void l1() {
        J0(this.loanAmountView.getAmountText());
    }

    public void m1(View view, int i, MultipleProductSubProduct multipleProductSubProduct) {
        E0();
        this.applyNow.setEnabled(this.cardExp4.c());
        AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, multipleProductSubProduct);
    }

    public void n1(IntentOrderAgreementBean intentOrderAgreementBean) {
        if (BaseUtils.l()) {
            return;
        }
        s1(intentOrderAgreementBean);
    }

    public static LabelBean o1(String str) throws Exception {
        return new LabelBean(str, str);
    }

    public void p1(final List list) throws Exception {
        this.G.e(list);
        this.G.f(new SingleRowSelectCompanion.SingleRowSelectViewListener() {
            @Override
            public void d(View view, LabelBean labelBean) {
                int indexOf;
                if (ECAuthLoanActivity.this.H != null && (indexOf = list.indexOf(labelBean)) < ECAuthLoanActivity.this.H.manualInputLoanProduct.totalRepayPrincipalVOList.size()) {
                    ECAuthLoanActivity.this.I = false;
                    TotalRepayPrincipalVO totalRepayPrincipalVO = ECAuthLoanActivity.this.H.manualInputLoanProduct.totalRepayPrincipalVOList.get(indexOf);
                    ECAuthLoanActivity eCAuthLoanActivity = ECAuthLoanActivity.this;
                    eCAuthLoanActivity.r1(labelBean.label, eCAuthLoanActivity.H.manualInputLoanProduct.defaultDayInterestRate, totalRepayPrincipalVO);
                }
            }

            @Override
            public void a() {
            }

            @Override
            public void c() {
            }
        });
    }

    private void q1() {
        final boolean z2 = true;
        if (this.L == IntentOrderDisplayStrategy.A5 && this.loanAmountView.getEtContent().hasFocus()) {
            z2 = false;
        }
        duringActive(this.P.q0(600L, TimeUnit.MILLISECONDS)).u().Q(AndroidSchedulers.a()).g0(new Consumer() {
            public final void accept(Object obj) {
                ECAuthLoanActivity.this.k1(z2, (BigDecimal) obj);
            }
        }, new u());
    }

    public void r1(@Nullable String str, @Nullable String str2, @Nullable TotalRepayPrincipalVO totalRepayPrincipalVO) {
        SelectTermItemInfo selectTermItemInfo = new SelectTermItemInfo(str, totalRepayPrincipalVO, this.loanAmountView.getAmountText());
        this.J = selectTermItemInfo;
        if (!selectTermItemInfo.b()) {
            this.applyNow.setEnabled(Y0());
            O1("", "");
        } else {
            this.applyNow.setEnabled(Y0());
            this.loanTermView.setContentText(str);
            O1(str2, EcFormatUtil.l(this.J.a()));
        }
    }

    private void s1(IntentOrderAgreementBean intentOrderAgreementBean) {
        if (TextUtils.isEmpty(intentOrderAgreementBean.agreementUrl)) {
            return;
        }
        HomeCore.v().P(this, intentOrderAgreementBean.agreementUrl, WebAgreementPurpose.LOAN_AGREEMENT, intentOrderAgreementBean.amount, intentOrderAgreementBean.productId, intentOrderAgreementBean.paymentMethod, intentOrderAgreementBean.credentialId, null, intentOrderAgreementBean.scene, intentOrderAgreementBean.terms, intentOrderAgreementBean.pageTitle, intentOrderAgreementBean.loanAgreementNeedConfirm);
    }

    private void t1(String str) {
        this.applyNow.setEnabled(Y0());
        this.authLoanRepaymentInfo.setVisibility(8);
        BigDecimal H1 = H1(str);
        boolean hasFocus = this.loanAmountView.getEtContent().hasFocus();
        if (this.F.b(H1)) {
            this.loanAmountView.p();
            this.authLoanRepaymentInfo.setVisibility(hasFocus ? 8 : Z0());
            this.loanAmountView.d().setVisibility(4);
            if (hasFocus) {
                u1(this.loanAmountView);
                return;
            }
            return;
        }
        String a = this.F.a(this, str);
        if (TextUtils.isEmpty(str)) {
            this.loanAmountView.p();
            this.loanAmountView.d().setTextColor(getResources().getColor(2131099780));
        } else {
            this.loanAmountView.r();
            this.loanAmountView.d().setTextColor(getResources().getColor(2131099807));
        }
        this.loanAmountView.d().setText(a);
        this.loanAmountView.d().setVisibility(0);
        if (hasFocus || !TextUtils.isEmpty(str)) {
            return;
        }
        this.loanAmountView.d().setVisibility(4);
    }

    public void u1(AuthGeneralView authGeneralView) {
        v1(H1(authGeneralView.getAmountText()));
    }

    public void v1(BigDecimal bigDecimal) {
        if (this.F.b(bigDecimal)) {
            if (this.P.D0() == null || bigDecimal.compareTo((BigDecimal) this.P.D0()) != 0 || this.H == null) {
                this.P.onNext(bigDecimal);
                return;
            }
            int i = AnonymousClass9.a[this.L.ordinal()];
            if (i == 1 || i == 2) {
                A1();
                return;
            }
            if (i == 3) {
                y1();
            } else if (i == 4) {
                z1();
            } else {
                if (i != 5) {
                    return;
                }
                w1(this.H, false);
            }
        }
    }

    public void w1(@NonNull IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody, boolean z2) {
        M1(intentionCalculateBody.userCreditsInfo, z2);
        P1(intentionCalculateBody);
        N1(intentionCalculateBody.manualInputLoanProduct, z2);
        if (z2 || this.J != null) {
            return;
        }
        K1();
    }

    public void x1(@NonNull String str, boolean z2) {
        if (z2) {
            clickAgreement();
        } else {
            jumpToWebPage(Uri.parse(str).buildUpon().build().toString());
        }
    }

    public void y1() {
        C1(this.H);
        B1(this.H.orderPageSignFormat);
        this.H.compositeLoanProduct.buildCalculationProductMap();
        this.cardExp2.setAuthLoanAmountAndTermCardListener(new IntentOrderCardExp2.AuthLoanAmountAndTermCardListener() {
            @Override
            public void a(AuthGeneralView authGeneralView) {
                ECAuthLoanActivity.this.u1(authGeneralView);
            }

            @Override
            public void b(@NonNull CompositeLoanProduct.LoanDurationOption loanDurationOption) {
                ECAuthLoanActivity eCAuthLoanActivity = ECAuthLoanActivity.this;
                eCAuthLoanActivity.N = eCAuthLoanActivity.cardExp2.getIntentionProductList();
                ECAuthLoanActivity eCAuthLoanActivity2 = ECAuthLoanActivity.this;
                eCAuthLoanActivity2.C0(eCAuthLoanActivity2.N);
                ECAuthLoanActivity.this.applyNow.setEnabled(!CollectionUtils.f(r2.N));
            }

            @Override
            public void c(@NonNull LoanPrincipalOption loanPrincipalOption, @Nullable BigDecimal bigDecimal) {
                ECAuthLoanActivity eCAuthLoanActivity = ECAuthLoanActivity.this;
                eCAuthLoanActivity.N = eCAuthLoanActivity.cardExp2.getIntentionProductList();
                ECAuthLoanActivity eCAuthLoanActivity2 = ECAuthLoanActivity.this;
                eCAuthLoanActivity2.C0(eCAuthLoanActivity2.N);
                ECAuthLoanActivity.this.v1(loanPrincipalOption.principal);
                ECAuthLoanActivity.this.applyNow.setEnabled(!CollectionUtils.f(r2.N));
            }

            @Override
            public void d(ArrayList<IntentionProduct> arrayList) {
                ECAuthLoanActivity eCAuthLoanActivity = ECAuthLoanActivity.this;
                eCAuthLoanActivity.N = eCAuthLoanActivity.cardExp2.getIntentionProductList();
                ECAuthLoanActivity eCAuthLoanActivity2 = ECAuthLoanActivity.this;
                eCAuthLoanActivity2.C0(eCAuthLoanActivity2.N);
                ECAuthLoanActivity.this.applyNow.setEnabled(!CollectionUtils.f(r2.N));
            }
        });
        IntentOrderCardExp2 intentOrderCardExp2 = this.cardExp2;
        IntentionCalculateResponse.IntentionCalculateBody intentionCalculateBody = this.H;
        intentOrderCardExp2.w(intentionCalculateBody.compositeLoanProduct, intentionCalculateBody.userCreditsInfo);
        this.N = this.cardExp2.getIntentionProductList();
        this.applyNow.setEnabled(!CollectionUtils.f(r0));
    }

    public void z1() {
        C1(this.H);
        B1(this.H.orderPageSignFormat);
        this.cardExp4.b(this, this.H.multipleLoanProduct.productList, new OnItemClickListener() {
            public final void a(View view, int i, Object obj) {
                ECAuthLoanActivity.this.m1(view, i, (MultipleProductSubProduct) obj);
            }
        });
    }

    @Override
    protected void B(@NonNull Bundle bundle) {
        super.B(bundle);
        this.J = (SelectTermItemInfo) bundle.getSerializable("INTENT_PARAMS_SELECT_TERM");
        this.H = (IntentionCalculateResponse.IntentionCalculateBody) bundle.getSerializable("INTENT_PARAMS_WILL_INFO_DATA");
        this.K = bundle.getString("INTENT_PARAMS_LOAN_AMOUNT", null);
        this.L = (IntentOrderDisplayStrategy) bundle.getSerializable("INTENT_PARAMS_DISPLAY_STRATEGY");
        this.E = (EasyCashCaptchaFragment) getSupportFragmentManager().getFragment(bundle, "smsVerificationFragment");
    }

    @Override
    protected void D() {
        super.D();
        this.f.setBackgroundColor(this.B);
        this.errorRoot.setBackgroundColor(0);
        this.nsvContent.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
            public final void onScrollChange(NestedScrollView nestedScrollView, int i, int i2, int i3, int i4) {
                ECAuthLoanActivity.this.j1(nestedScrollView, i, i2, i3, i4);
            }
        });
        X0();
        P0(this.L);
        W0();
    }

    @Override
    protected void N(@NonNull Bundle bundle) {
        super.N(bundle);
        bundle.putSerializable("INTENT_PARAMS_SELECT_TERM", this.J);
        bundle.putSerializable("INTENT_PARAMS_WILL_INFO_DATA", this.H);
        bundle.putSerializable("INTENT_PARAMS_LOAN_AMOUNT", this.loanAmountView.getAmountText());
        bundle.putSerializable("INTENT_PARAMS_DISPLAY_STRATEGY", this.L);
        EasyCashCaptchaFragment easyCashCaptchaFragment = this.E;
        if (easyCashCaptchaFragment == null || !easyCashCaptchaFragment.isAdded()) {
            return;
        }
        getSupportFragmentManager().putFragment(bundle, "smsVerificationFragment", this.E);
    }

    @OnClick({R.id.apply_now})
    public void applyNow() {
        if (BaseUtils.l()) {
            return;
        }
        E1(SensorTrackEvent.EC_AUTH_LOAN_ACT_CLICK_NEXT);
        S0();
    }

    public void clickAgreement() {
        if (BaseUtils.l() || CollectionUtils.f(this.O)) {
            return;
        }
        if (this.O.size() == 1) {
            s1(this.O.get(0));
        } else {
            J1();
        }
    }

    public void displayGuidanceDlg() {
        if (this.H == null) {
            return;
        }
        new EasyCashBottomAgreementDialog(this, this.H.dialogPageSignFormat, new EasyCashBottomAgreementDialog.EasyCashBottomAgreementDialogListener() {
            @Override
            public void a() {
                com.lingyue.easycash.widght.bottomDialog.d.a(this);
            }

            @Override
            public void b(@NonNull String str, boolean z2) {
                if (BaseUtils.l()) {
                    return;
                }
                ECAuthLoanActivity.this.x1(str, z2);
            }

            @Override
            public void c() {
                ECAuthLoanActivity.this.lavLoanAgreementView.setAgreeLoanAgreement(true);
                ECAuthLoanActivity.this.S0();
            }
        }).show();
    }

    @Override
    public int getLayoutID() {
        return R.layout.easycash_activity_auth_loan;
    }

    @Override
    protected boolean m() {
        return true;
    }

    @Override
    public void onCheckPwd(String str) {
        N0(this.L, "", str);
    }

    @Override
    public void onCheckVerification(String str) {
        N0(this.L, str, "");
    }

    @Override
    public void onClose() {
        removeSmsVerificationDialogFragment();
    }

    @Override
    protected void onDestroy() {
        removeSmsVerificationDialogFragment();
        super.onDestroy();
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onEventUserConfirmAgreement(UserConfirmAgreementStickyEvent userConfirmAgreementStickyEvent) {
        if (WebAgreementPurpose.LOAN_AGREEMENT.name().equals(userConfirmAgreementStickyEvent.purpose)) {
            EventBus.c().q(userConfirmAgreementStickyEvent);
            this.I = true;
            this.loanAmountView.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    ECAuthLoanActivity.this.l1();
                }
            }, 200L);
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        E1(SensorTrackEvent.EC_AUTH_LOAN_ACT_EXPOSE);
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onWebCompleteFlow(CompletedIntentOrderStickyEvent completedIntentOrderStickyEvent) {
        EventBus.c().q(completedIntentOrderStickyEvent);
        finish();
    }

    @OnClick({R.id.btn_retry})
    public void reloadView() {
        if (BaseUtils.l()) {
            return;
        }
        if (this.L != IntentOrderDisplayStrategy.A5) {
            O0();
            return;
        }
        String amountText = this.loanAmountView.getAmountText();
        if (this.F.b(H1(amountText))) {
            Q0(amountText, false, true);
        } else {
            Q0("100000", false, true);
        }
    }

    public void removeSmsVerificationDialogFragment() {
        EasyCashCaptchaFragment easyCashCaptchaFragment = this.E;
        if (easyCashCaptchaFragment == null || !easyCashCaptchaFragment.isAdded()) {
            return;
        }
        this.E.Q0();
        getSupportFragmentManager().beginTransaction().remove(this.E).commitAllowingStateLoss();
        this.E = null;
    }

    @Override
    public Disposable runOnActiveEvent(Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.a(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnCreated(@NonNull Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.b(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnDestroy(@NonNull Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.c(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.d(this, lifecycleEvent, runnable);
    }

    @Override
    public Disposable runOnEvents(@NonNull LifecycleEvent[] lifecycleEventArr, @Nullable Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.e(this, lifecycleEventArr, runnable);
    }

    public void showSmsVerificationDialogFragment() {
        V0();
        if (this.E.isAdded()) {
            getSupportFragmentManager().beginTransaction().show(this.E).commitAllowingStateLoss();
        } else {
            getSupportFragmentManager().beginTransaction().add(android.R.id.content, this.E).commitAllowingStateLoss();
        }
    }

    @OnClick({R.id.skip_wait})
    public void skipWait() {
        E1(SensorTrackEvent.EC_AUTH_LOAN_ACT_CLICK_SKIP);
        finish();
    }

    @Override
    public void userLogout() {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                ECAuthLoanActivity.this.removeSmsVerificationDialogFragment();
            }
        });
    }

    @Override
    @SuppressLint({"CheckResult"})
    protected void z() {
        super.z();
        O0();
    }

    @Override
    public void userLogin() {
    }
}