导航菜单

页面标题

页面副标题

Mabilis Cash v1.19.4 - PHOrderConfirmWithOTPActivity.java 源代码

正在查看: Mabilis Cash v1.19.4 应用的 PHOrderConfirmWithOTPActivity.java JAVA 源代码文件

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


package com.loans.mabiliscash.business.order.confirm;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.CountDownTimer;
import android.text.InputFilter;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.TextUtils;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.viewbinding.ViewBinding;
import com.fintopia.libCommon.widgets.dialog.bottom.BaseBottomSheetDialog;
import com.fintopia.libCommon.widgets.input.BaseContentView;
import com.lingyue.supertoolkit.tools.formattools.SpannableUtils;
import com.lingyue.supertoolkit.widgets.TextTimer;
import com.lingyue.supertoolkit.widgets.TouchSpanInterceptListener;
import com.loans.mabiliscash.R;
import com.loans.mabiliscash.auth.living.preview.PHOrderLiveVerifyPreviewActivity;
import com.loans.mabiliscash.business.order.OTPVerifyWayDialog;
import com.loans.mabiliscash.business.order.confirm.PHOrderConfirmWithOTPActivity;
import com.loans.mabiliscash.common.BindClickCall;
import com.loans.mabiliscash.common.PHViewBindingActivity;
import com.loans.mabiliscash.databinding.ActivityLoanConfirmBinding;
import com.loans.mabiliscash.login.AutoFillOTPManager;
import com.loans.mabiliscash.models.BackFillOTPInfo;
import com.loans.mabiliscash.models.OTPVerificationType;
import com.loans.mabiliscash.models.OnLineServicePageName;
import com.loans.mabiliscash.models.OrderApplyInfo;
import com.loans.mabiliscash.models.response.AgreementInfo;
import com.loans.mabiliscash.models.response.BackFillOTPInfoResponse;
import com.loans.mabiliscash.models.response.OrderApplyInfoResponse;
import com.loans.mabiliscash.models.response.OrderConfirmInfo;
import com.loans.mabiliscash.models.response.PHBooleanResponse;
import com.loans.mabiliscash.models.response.UserResponse;
import com.loans.mabiliscash.net.ECObserver;
import com.loans.mabiliscash.verify.OTPWithOutCaptchaRequestManager;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Action;
import io.reactivex.schedulers.Schedulers;
import java.util.Timer;
import java.util.TimerTask;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata
@SourceDebugExtension
public final class PHOrderConfirmWithOTPActivity extends OrderConfirmBaseActivity<ActivityLoanConfirmBinding> implements BaseContentView.OnContentChangedListener {

    @NotNull
    public static final Companion Companion = new Companion(null);

    @Nullable
    private TextTimer A;

    @Nullable
    private CountDownTimer B;

    @Nullable
    private OTPWithOutCaptchaRequestManager C;

    @Nullable
    private OTPWithOutCaptchaRequestManager D;

    @Nullable
    private OTPVerifyWayDialog E;

    @Nullable
    private BackFillOTPInfo f148x;

    @Nullable
    private AutoFillOTPManager f149y;

    @Nullable
    private TextTimer f150z;

    @Metadata
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public final void a(@NotNull Context context, @NotNull OrderApplyInfo orderApplyInfo, @Nullable String str) {
            Intrinsics.checkNotNullParameter(context, "context");
            Intrinsics.checkNotNullParameter(orderApplyInfo, "orderApplyInfo");
            Intent intent = new Intent(context, (Class<?>) PHOrderConfirmWithOTPActivity.class);
            intent.putExtra("order_apply_info", orderApplyInfo);
            intent.putExtra("order_apply_otp_ab_type", str);
            context.startActivity(intent);
        }

        private Companion() {
        }
    }

    private final void A0() {
        Q0();
        this.f150z = new TextTimer(((ActivityLoanConfirmBinding) this.o).d, 60000L, 1000L, this).b(new TextTimer.EventListener() {
            @Override
            public void onFinish() {
                ViewBinding viewBinding;
                viewBinding = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                ((ActivityLoanConfirmBinding) viewBinding).d.setEnabled(true);
            }

            @Override
            public void onTick(TextView textView, long j) {
                Intrinsics.checkNotNullParameter(textView, "view");
            }
        }).d(getString(R.string.retry)).c("%ss");
    }

    private final void B0() {
        V(((ActivityLoanConfirmBinding) this.o).d, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHOrderConfirmWithOTPActivity.C0(PHOrderConfirmWithOTPActivity.this, view);
            }
        });
        V(((ActivityLoanConfirmBinding) this.o).f166x, new BindClickCall() {
            @Override
            public final void onClick(View view) {
                PHOrderConfirmWithOTPActivity.D0(PHOrderConfirmWithOTPActivity.this, view);
            }
        });
    }

    public static final void C0(PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity, View view) {
        if (Intrinsics.a(pHOrderConfirmWithOTPActivity.Z(), "B") || Intrinsics.a(pHOrderConfirmWithOTPActivity.Z(), "D")) {
            pHOrderConfirmWithOTPActivity.z0();
        }
        OTPWithOutCaptchaRequestManager oTPWithOutCaptchaRequestManager = pHOrderConfirmWithOTPActivity.C;
        if (oTPWithOutCaptchaRequestManager != null) {
            oTPWithOutCaptchaRequestManager.c();
        }
    }

    public static final void D0(PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity, View view) {
        if (pHOrderConfirmWithOTPActivity.f148x == null) {
            return;
        }
        OrderConfirmPageTrackUtil.a.G(pHOrderConfirmWithOTPActivity);
        BackFillOTPInfo backFillOTPInfo = pHOrderConfirmWithOTPActivity.f148x;
        if (Intrinsics.a("IVR_LIVING", backFillOTPInfo != null ? backFillOTPInfo.notifType : null)) {
            pHOrderConfirmWithOTPActivity.X0();
            return;
        }
        BackFillOTPInfo backFillOTPInfo2 = pHOrderConfirmWithOTPActivity.f148x;
        if (Intrinsics.a("IVR", backFillOTPInfo2 != null ? backFillOTPInfo2.notifType : null)) {
            OTPWithOutCaptchaRequestManager oTPWithOutCaptchaRequestManager = pHOrderConfirmWithOTPActivity.D;
            if (oTPWithOutCaptchaRequestManager != null) {
                oTPWithOutCaptchaRequestManager.c();
                return;
            }
            return;
        }
        BackFillOTPInfo backFillOTPInfo3 = pHOrderConfirmWithOTPActivity.f148x;
        if (Intrinsics.a("LIVING", backFillOTPInfo3 != null ? backFillOTPInfo3.notifType : null)) {
            pHOrderConfirmWithOTPActivity.V0();
        }
    }

    public static final String E0(AgreementInfo.HighlightItem highlightItem) {
        return "{{" + highlightItem.key + "}}";
    }

    public static final String F0(AgreementInfo.HighlightItem highlightItem) {
        return highlightItem.value;
    }

    public static final void G0(AgreementInfo.HighlightItem highlightItem, PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity) {
        if (TextUtils.isEmpty(highlightItem.redirectUrl)) {
            return;
        }
        pHOrderConfirmWithOTPActivity.jumpToWebPage(pHOrderConfirmWithOTPActivity.appGlobal.a.a() + highlightItem.redirectUrl);
        OrderConfirmPageTrackUtil.a.o(pHOrderConfirmWithOTPActivity, highlightItem.key);
    }

    private final void H0() {
        this.C = new OTPWithOutCaptchaRequestManager(this, "VERIFY_CREATE_ORDER", new OTPWithOutCaptchaRequestManager.SendOTPRequestListener() {
            @Override
            public void a() {
                PHOrderConfirmWithOTPActivity.this.dismissLoadingDialog();
                PHOrderConfirmWithOTPActivity.this.startCountDown();
                PHOrderConfirmWithOTPActivity.this.Z0();
            }

            @Override
            public String b() {
                return "";
            }

            @Override
            public void c() {
                PHOrderConfirmWithOTPActivity.this.dismissLoadingDialog();
                PHOrderConfirmWithOTPActivity.this.resetRetryText();
            }
        }, OTPVerificationType.SMS);
        this.D = new OTPWithOutCaptchaRequestManager(this, "VERIFY_CREATE_ORDER", new OTPWithOutCaptchaRequestManager.SendOTPRequestListener() {
            @Override
            public void a() {
                throw new UnsupportedOperationException("Method not decompiled: com.loans.mabiliscash.business.order.confirm.PHOrderConfirmWithOTPActivity$initOTPRequestManager$2.a():void");
            }

            @Override
            public String b() {
                return "";
            }

            @Override
            public void c() {
            }
        }, OTPVerificationType.IVR);
    }

    private final void I0() {
        if (TextUtils.isEmpty(this.userSession.c().mobileNumber)) {
            return;
        }
        SpannableUtils.c(getString(R.string.sms_tips) + " " + this.userSession.c().mobileNumber, this.userSession.c().mobileNumber, R.color.c_brand_1, ((ActivityLoanConfirmBinding) this.o).f163u);
    }

    public static final void J0(PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity, View view) {
        pHOrderConfirmWithOTPActivity.M0();
    }

    public static final void K0(PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity, View view) {
        pHOrderConfirmWithOTPActivity.M0();
    }

    private final void L0(String str) {
        if (str.length() != 6) {
            ((ActivityLoanConfirmBinding) this.o).c.setEnabled(false);
            return;
        }
        hideSoftInput();
        ((ActivityLoanConfirmBinding) this.o).f.clearFocus();
        if (Intrinsics.a(Z(), "B") || Intrinsics.a(Z(), "D")) {
            ((ActivityLoanConfirmBinding) this.o).c.setEnabled(true);
        } else if (Intrinsics.a(Z(), "A") || Intrinsics.a(Z(), "C")) {
            R0(str);
        }
    }

    private final void M0() {
        OrderConfirmPageTrackUtil.a.u(this);
        if (d1(((ActivityLoanConfirmBinding) this.o).f.getContent())) {
            String content = ((ActivityLoanConfirmBinding) this.o).f.getContent();
            Intrinsics.checkNotNullExpressionValue(content, "getContent(...)");
            R0(content);
        }
    }

    public final void N0(BackFillOTPInfoResponse backFillOTPInfoResponse) {
        if ((backFillOTPInfoResponse != null ? backFillOTPInfoResponse.body : null) == null) {
            return;
        }
        BackFillOTPInfo backFillOTPInfo = backFillOTPInfoResponse.body;
        this.f148x = backFillOTPInfo;
        c1(backFillOTPInfo);
    }

    private final void O0() {
        TextTimer textTimer = this.A;
        if (textTimer != null) {
            textTimer.cancel();
        }
        this.A = null;
    }

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

    private final void Q0() {
        TextTimer textTimer = this.f150z;
        if (textTimer != null) {
            textTimer.cancel();
        }
        this.f150z = null;
    }

    private final void R0(String str) {
        showLoadingDialog();
        String str2 = str.toString();
        int length = str2.length() - 1;
        int i = 0;
        boolean z2 = false;
        while (i <= length) {
            boolean z3 = Intrinsics.d(str2.charAt(!z2 ? i : length), 32) <= 0;
            if (z2) {
                if (!z3) {
                    break;
                } else {
                    length--;
                }
            } else if (z3) {
                i++;
            } else {
                z2 = true;
            }
        }
        g0(str2.subSequence(i, length + 1).toString(), new Function0() {
            public final Object invoke() {
                Unit S0;
                S0 = PHOrderConfirmWithOTPActivity.S0(PHOrderConfirmWithOTPActivity.this);
                return S0;
            }
        });
    }

    public static final Unit S0(PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity) {
        ((ActivityLoanConfirmBinding) pHOrderConfirmWithOTPActivity.o).f.setContentText("");
        return Unit.a;
    }

    private final void T0() {
        showLoadingDialog();
        this.apiHelper.a().d0().K(Schedulers.b()).w(AndroidSchedulers.a()).j(new Action() {
            public final void run() {
                PHOrderConfirmWithOTPActivity.U0(PHOrderConfirmWithOTPActivity.this);
            }
        }).a(new ECObserver<BackFillOTPInfoResponse>() {
            {
                super(PHOrderConfirmWithOTPActivity.this);
            }

            @Override
            public void c(BackFillOTPInfoResponse backFillOTPInfoResponse) {
                PHOrderConfirmWithOTPActivity.this.N0(backFillOTPInfoResponse);
            }
        });
    }

    public static final void U0(PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity) {
        pHOrderConfirmWithOTPActivity.dismissLoadingDialog();
    }

    public final void V0() {
        showLoadingDialog();
        this.apiHelper.a().K0("ORDER_VERIFY").K(Schedulers.b()).w(AndroidSchedulers.a()).j(new Action() {
            public final void run() {
                PHOrderConfirmWithOTPActivity.W0(PHOrderConfirmWithOTPActivity.this);
            }
        }).a(new ECObserver<PHBooleanResponse>() {
            {
                super(PHOrderConfirmWithOTPActivity.this);
            }

            @Override
            public void c(PHBooleanResponse pHBooleanResponse) {
                if (pHBooleanResponse == null || !pHBooleanResponse.body) {
                    return;
                }
                PHOrderLiveVerifyPreviewActivity.Companion companion = PHOrderLiveVerifyPreviewActivity.Companion;
                BaseContentView.OnContentChangedListener onContentChangedListener = PHOrderConfirmWithOTPActivity.this;
                companion.a(onContentChangedListener, 100350, onContentChangedListener.getOrderApplyInfo());
            }
        });
    }

    public static final void W0(PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity) {
        pHOrderConfirmWithOTPActivity.dismissLoadingDialog();
    }

    private final void X0() {
        if (this.E == null) {
            this.E = new OTPVerifyWayDialog(this);
        }
        OTPVerifyWayDialog oTPVerifyWayDialog = this.E;
        if (oTPVerifyWayDialog != null) {
            oTPVerifyWayDialog.t(new OTPVerifyWayDialog.OnOTPVerifyWaySelectedListener() {
                @Override
                public void a() {
                    OTPVerifyWayDialog oTPVerifyWayDialog2;
                    PHOrderConfirmWithOTPActivity.this.V0();
                    OrderConfirmPageTrackUtil.a.M(PHOrderConfirmWithOTPActivity.this);
                    oTPVerifyWayDialog2 = PHOrderConfirmWithOTPActivity.this.E;
                    if (oTPVerifyWayDialog2 != null) {
                        oTPVerifyWayDialog2.dismiss();
                    }
                }

                @Override
                public void b() {
                    OTPWithOutCaptchaRequestManager oTPWithOutCaptchaRequestManager;
                    oTPWithOutCaptchaRequestManager = PHOrderConfirmWithOTPActivity.this.D;
                    if (oTPWithOutCaptchaRequestManager != null) {
                        oTPWithOutCaptchaRequestManager.c();
                    }
                    OrderConfirmPageTrackUtil.a.K(PHOrderConfirmWithOTPActivity.this);
                }

                @Override
                public void onClose() {
                    OTPVerifyWayDialog oTPVerifyWayDialog2;
                    OrderConfirmPageTrackUtil.a.I(PHOrderConfirmWithOTPActivity.this);
                    oTPVerifyWayDialog2 = PHOrderConfirmWithOTPActivity.this.E;
                    if (oTPVerifyWayDialog2 != null) {
                        oTPVerifyWayDialog2.dismiss();
                    }
                }
            });
        }
        BaseBottomSheetDialog baseBottomSheetDialog = this.E;
        if (baseBottomSheetDialog != null) {
            baseBottomSheetDialog.setOnShowListener(new DialogInterface.OnShowListener() {
                @Override
                public final void onShow(DialogInterface dialogInterface) {
                    PHOrderConfirmWithOTPActivity.Y0(PHOrderConfirmWithOTPActivity.this, dialogInterface);
                }
            });
        }
        BaseBottomSheetDialog baseBottomSheetDialog2 = this.E;
        if (baseBottomSheetDialog2 != null) {
            baseBottomSheetDialog2.show();
        }
    }

    public static final void Y0(PHOrderConfirmWithOTPActivity pHOrderConfirmWithOTPActivity, DialogInterface dialogInterface) {
        OrderConfirmPageTrackUtil.a.O(pHOrderConfirmWithOTPActivity);
    }

    public final void Z0() {
        ((ActivityLoanConfirmBinding) this.o).f.requestFocus();
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                ViewBinding viewBinding;
                ViewBinding viewBinding2;
                viewBinding = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                Object systemService = ((ActivityLoanConfirmBinding) viewBinding).f.getContext().getSystemService("input_method");
                Intrinsics.c(systemService, "null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
                viewBinding2 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                ((InputMethodManager) systemService).showSoftInput(((ActivityLoanConfirmBinding) viewBinding2).f, 0);
            }
        }, 500L);
    }

    private final void a1() {
        ((ActivityLoanConfirmBinding) this.o).f.setOnContentChangedListener(this);
        ((ActivityLoanConfirmBinding) this.o).f.setInputType(524290);
        ((ActivityLoanConfirmBinding) this.o).f.setFilters(new InputFilter[]{new InputFilter.LengthFilter(6)});
    }

    public final void b1(final BackFillOTPInfo backFillOTPInfo) {
        if (backFillOTPInfo == null) {
            return;
        }
        ((ActivityLoanConfirmBinding) this.o).f166x.getPaint().setFlags(0);
        ((ActivityLoanConfirmBinding) this.o).f166x.setVisibility(8);
        O0();
        TextTimer c = new TextTimer(((ActivityLoanConfirmBinding) this.o).n, 60000L, 1000L, this).b(new TextTimer.EventListener() {
            @Override
            public void onFinish() {
                ViewBinding viewBinding;
                ViewBinding viewBinding2;
                ViewBinding viewBinding3;
                ViewBinding viewBinding4;
                ViewBinding viewBinding5;
                viewBinding = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                ((ActivityLoanConfirmBinding) viewBinding).n.setText(backFillOTPInfo.text);
                viewBinding2 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                ((ActivityLoanConfirmBinding) viewBinding2).f166x.setText(backFillOTPInfo.highLightText);
                viewBinding3 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                ((ActivityLoanConfirmBinding) viewBinding3).f166x.setVisibility(0);
                viewBinding4 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                TextPaint paint = ((ActivityLoanConfirmBinding) viewBinding4).f166x.getPaint();
                viewBinding5 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                paint.setFlags(((ActivityLoanConfirmBinding) viewBinding5).f166x.getPaint().getFlags() | 8);
            }

            @Override
            public void onTick(TextView textView, long j) {
                Intrinsics.checkNotNullParameter(textView, "view");
            }
        }).c(getString(R.string.try_voice_call_countdown));
        this.A = c;
        if (c != null) {
            c.start();
        }
    }

    private final void c1(final BackFillOTPInfo backFillOTPInfo) {
        if (backFillOTPInfo == null) {
            return;
        }
        P0();
        final long longValue = backFillOTPInfo.waitMill.longValue() * 1000;
        this.B = new CountDownTimer(longValue) {
            @Override
            public void onFinish() {
                ViewBinding viewBinding;
                ViewBinding viewBinding2;
                ViewBinding viewBinding3;
                ViewBinding viewBinding4;
                ViewBinding viewBinding5;
                viewBinding = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                ((ActivityLoanConfirmBinding) viewBinding).j.setVisibility(0);
                viewBinding2 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                ((ActivityLoanConfirmBinding) viewBinding2).n.setText(backFillOTPInfo.text);
                viewBinding3 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                ((ActivityLoanConfirmBinding) viewBinding3).f166x.setText(backFillOTPInfo.highLightText);
                viewBinding4 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                TextPaint paint = ((ActivityLoanConfirmBinding) viewBinding4).f166x.getPaint();
                viewBinding5 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                paint.setFlags(((ActivityLoanConfirmBinding) viewBinding5).f166x.getPaint().getFlags() | 8);
                OrderConfirmPageTrackUtil.a.w(PHOrderConfirmWithOTPActivity.this, backFillOTPInfo.notifType);
            }

            @Override
            public void onTick(long j) {
            }
        }.start();
    }

    private final boolean d1(String str) {
        return (str == null || str.length() == 0 || str.length() != 6) ? false : true;
    }

    private final void z0() {
        if (this.f149y == null) {
            this.f149y = new AutoFillOTPManager();
        }
        AutoFillOTPManager autoFillOTPManager = this.f149y;
        if (autoFillOTPManager != null) {
            autoFillOTPManager.f(this);
        }
        AutoFillOTPManager autoFillOTPManager2 = this.f149y;
        if (autoFillOTPManager2 != null) {
            autoFillOTPManager2.h(this);
        }
        AutoFillOTPManager autoFillOTPManager3 = this.f149y;
        if (autoFillOTPManager3 != null) {
            autoFillOTPManager3.g(new AutoFillOTPManager.AutoFillOTPListener() {
                @Override
                public void b(String str) {
                    ViewBinding viewBinding;
                    ViewBinding viewBinding2;
                    Intrinsics.checkNotNullParameter(str, "otp");
                    OrderConfirmPageTrackUtil.a.A(PHOrderConfirmWithOTPActivity.this);
                    viewBinding = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                    ((ActivityLoanConfirmBinding) viewBinding).f.setContentText(str);
                    PHOrderConfirmWithOTPActivity.this.hideSoftInput();
                    viewBinding2 = ((PHViewBindingActivity) PHOrderConfirmWithOTPActivity.this).o;
                    ((ActivityLoanConfirmBinding) viewBinding2).f.clearFocus();
                }

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

    @Override
    protected void O(@NotNull UserResponse userResponse) {
        Intrinsics.checkNotNullParameter(userResponse, "response");
        super.O(userResponse);
        I0();
    }

    @Override
    @NotNull
    public TextView getCardNumberTextView() {
        TextView textView = ((ActivityLoanConfirmBinding) this.o).l;
        Intrinsics.checkNotNullExpressionValue(textView, "tvCardNumber");
        return textView;
    }

    @Override
    @NotNull
    public ImageView getHelpImageView() {
        ImageView imageView = ((ActivityLoanConfirmBinding) this.o).h;
        Intrinsics.checkNotNullExpressionValue(imageView, "ivHelp");
        return imageView;
    }

    @Override
    @NotNull
    public TextView getLoanAmountText() {
        TextView textView = ((ActivityLoanConfirmBinding) this.o).p;
        Intrinsics.checkNotNullExpressionValue(textView, "tvLoanAmount");
        return textView;
    }

    @Override
    @NotNull
    public TextView getLoanFirstRepaymentPlanTextView() {
        TextView textView = ((ActivityLoanConfirmBinding) this.o).r;
        Intrinsics.checkNotNullExpressionValue(textView, "tvLoanFirstRepaymentPlan");
        return textView;
    }

    @Override
    @NotNull
    public TextView getLoanTermText() {
        TextView textView = ((ActivityLoanConfirmBinding) this.o).s;
        Intrinsics.checkNotNullExpressionValue(textView, "tvLoanTerm");
        return textView;
    }

    @Override
    @NotNull
    public ImageView getPaymentMethodLogoImageView() {
        ImageView imageView = ((ActivityLoanConfirmBinding) this.o).i;
        Intrinsics.checkNotNullExpressionValue(imageView, "ivPaymentMethodLogo");
        return imageView;
    }

    @Override
    @NotNull
    public TextView getReimbursementAccountTextView() {
        TextView textView = ((ActivityLoanConfirmBinding) this.o).f164v;
        Intrinsics.checkNotNullExpressionValue(textView, "tvReimbursementAccount");
        return textView;
    }

    @Override
    public void initLoanArgument(@NotNull OrderConfirmInfo orderConfirmInfo) {
        Intrinsics.checkNotNullParameter(orderConfirmInfo, "orderConfirmInfo");
        AgreementInfo agreementInfo = orderConfirmInfo.agreement;
        if (agreementInfo == null || agreementInfo == null) {
            return;
        }
        OrderConfirmPageTrackUtil.a.q(this);
        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(agreementInfo.content);
        for (final AgreementInfo.HighlightItem highlightItem : agreementInfo.highlights) {
            SpannableUtils.a(spannableStringBuilder, getResources().getColor(R.color.c_brand_1), new SpannableUtils.GetPlaceHolderCall() {
                @Override
                public final String a() {
                    String E0;
                    E0 = PHOrderConfirmWithOTPActivity.E0(AgreementInfo.HighlightItem.this);
                    return E0;
                }
            }, new SpannableUtils.GetHighLightCall() {
                @Override
                public final String a() {
                    String F0;
                    F0 = PHOrderConfirmWithOTPActivity.F0(AgreementInfo.HighlightItem.this);
                    return F0;
                }
            }, new SpannableUtils.OnSpanClickListener() {
                @Override
                public final void a() {
                    PHOrderConfirmWithOTPActivity.G0(AgreementInfo.HighlightItem.this, this);
                }
            });
        }
        ((ActivityLoanConfirmBinding) this.o).k.setText(spannableStringBuilder);
        ((ActivityLoanConfirmBinding) this.o).k.setOnTouchListener(new TouchSpanInterceptListener());
    }

    @Override
    public boolean isShowConfirmButton() {
        return Intrinsics.a(Z(), "B") || Intrinsics.a(Z(), "D");
    }

    @Override
    protected void j() {
        super.j();
        sendFetchOnLineServiceRequest(OnLineServicePageName.LOAN_CONFIRM_PAGE);
    }

    @Override
    protected void o() {
        super.o();
        A0();
        B0();
        I0();
        a1();
        OrderConfirmPageTrackUtil orderConfirmPageTrackUtil = OrderConfirmPageTrackUtil.a;
        orderConfirmPageTrackUtil.y(this);
        H0();
        String Z = Z();
        if (Z != null) {
            switch (Z.hashCode()) {
                case 65:
                    if (Z.equals("A")) {
                        ((ActivityLoanConfirmBinding) this.o).c.setVisibility(8);
                        ((ActivityLoanConfirmBinding) this.o).f163u.setVisibility(0);
                        break;
                    }
                    break;
                case 66:
                    if (Z.equals("B")) {
                        z0();
                        ((ActivityLoanConfirmBinding) this.o).c.setVisibility(0);
                        orderConfirmPageTrackUtil.s(this);
                        ((ActivityLoanConfirmBinding) this.o).f163u.setVisibility(8);
                        V(((ActivityLoanConfirmBinding) this.o).c, new BindClickCall() {
                            @Override
                            public final void onClick(View view) {
                                PHOrderConfirmWithOTPActivity.J0(PHOrderConfirmWithOTPActivity.this, view);
                            }
                        });
                        break;
                    }
                    break;
                case 67:
                    if (Z.equals("C")) {
                        ((ActivityLoanConfirmBinding) this.o).c.setVisibility(8);
                        ((ActivityLoanConfirmBinding) this.o).f163u.setVisibility(0);
                        T0();
                        break;
                    }
                    break;
                case 68:
                    if (Z.equals("D")) {
                        z0();
                        T0();
                        ((ActivityLoanConfirmBinding) this.o).c.setVisibility(0);
                        ((ActivityLoanConfirmBinding) this.o).f163u.setVisibility(8);
                        V(((ActivityLoanConfirmBinding) this.o).c, new BindClickCall() {
                            @Override
                            public final void onClick(View view) {
                                PHOrderConfirmWithOTPActivity.K0(PHOrderConfirmWithOTPActivity.this, view);
                            }
                        });
                        break;
                    }
                    break;
            }
            orderConfirmPageTrackUtil.E(this);
        }
        ((ActivityLoanConfirmBinding) this.o).c.setVisibility(8);
        ((ActivityLoanConfirmBinding) this.o).f163u.setVisibility(0);
        orderConfirmPageTrackUtil.E(this);
    }

    protected void onActivityResult(int i, int i2, @Nullable Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 100350 && i2 == -1) {
            finish();
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        P0();
        Q0();
        O0();
    }

    public void onEditContentChanged(@Nullable BaseContentView baseContentView) {
        if (baseContentView == null) {
            return;
        }
        String content = baseContentView.getContent();
        Intrinsics.checkNotNullExpressionValue(content, "getContent(...)");
        L0(content);
        OrderConfirmPageTrackUtil.a.C(this);
    }

    @Override
    public void processOrderConfirmInfoResponse(@NotNull OrderApplyInfoResponse orderApplyInfoResponse) {
        Intrinsics.checkNotNullParameter(orderApplyInfoResponse, "result");
        super.processOrderConfirmInfoResponse(orderApplyInfoResponse);
        OTPWithOutCaptchaRequestManager oTPWithOutCaptchaRequestManager = this.C;
        if (oTPWithOutCaptchaRequestManager != null) {
            oTPWithOutCaptchaRequestManager.c();
        }
    }

    public final void resetRetryText() {
        TextTimer textTimer = this.f150z;
        if (textTimer != null) {
            textTimer.onFinish();
            textTimer.cancel();
        }
    }

    public final void startCountDown() {
        TextTimer textTimer = this.f150z;
        if (textTimer != null) {
            textTimer.start();
        }
        ((ActivityLoanConfirmBinding) this.o).d.setEnabled(false);
    }

    @Override
    @NotNull
    public ActivityLoanConfirmBinding bindingInflater() {
        ActivityLoanConfirmBinding c = ActivityLoanConfirmBinding.c(getLayoutInflater());
        Intrinsics.checkNotNullExpressionValue(c, "inflate(...)");
        return c;
    }
}