导航菜单

页面标题

页面副标题

Easycash v3.75.13 - EasyCashRepaymentActivity.java 源代码

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

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


package com.lingyue.easycash.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.OnClick;
import com.lingyue.easycash.R;
import com.lingyue.easycash.activity.EasyCashRepaymentActivity;
import com.lingyue.easycash.adapters.LinearVerticalDecoration;
import com.lingyue.easycash.adapters.RepayBankCardListAdapter;
import com.lingyue.easycash.appconfig.EasycashConfigKey;
import com.lingyue.easycash.appconfig.GeneralConfigManager;
import com.lingyue.easycash.business.quickrepay.ECQuickRepayPayingAct;
import com.lingyue.easycash.business.quickrepay.QuickRepayGuideCardAdapter;
import com.lingyue.easycash.business.quickrepay.QuickRepayListAdapter;
import com.lingyue.easycash.commom.EasyCashCommonActivity;
import com.lingyue.easycash.models.DirectDebitEnableAccount;
import com.lingyue.easycash.models.RepayBankCard;
import com.lingyue.easycash.models.RepayCardDisplayData;
import com.lingyue.easycash.models.enums.DirectDebitGuidePageStrategy;
import com.lingyue.easycash.models.event.QuickRepayNewCardBindEvent;
import com.lingyue.easycash.models.event.QuickRepayResultEvent;
import com.lingyue.easycash.models.marketmessage.MarketResource;
import com.lingyue.easycash.models.marketmessage.details.CommonDialogDetail;
import com.lingyue.easycash.models.marketmessage.requestparams.ResourceV2RequestParams;
import com.lingyue.easycash.models.response.AppResourceInfoResponseV2;
import com.lingyue.easycash.models.response.DirectDebitBankBean;
import com.lingyue.easycash.models.response.DirectDebitBankInfo;
import com.lingyue.easycash.models.response.RepayListBankCardResponse;
import com.lingyue.easycash.models.response.RepaymentAccountResponse;
import com.lingyue.easycash.net.EasyCashResponseCode;
import com.lingyue.easycash.utils.EasycashUmengEvent;
import com.lingyue.easycash.utils.H5DialogUtil;
import com.lingyue.easycash.utils.SensorTrackEvent;
import com.lingyue.easycash.widget.bottomDialog.EasyCashBottomQuickRepayPayingDialog;
import com.lingyue.easycash.widght.EasycashConfirmDialog;
import com.lingyue.easycash.widght.EasycashSingleButtonDialog;
import com.lingyue.easycash.widght.bottomDialog.EasyCashBottomQuickRepayDialog;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.AppResourceReportPageType;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.utils.DevUtil;
import com.lingyue.idnbaselib.utils.EcFormatUtil;
import com.lingyue.idnbaselib.utils.JsonParamsBuilder;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
import com.lingyue.idnbaselib.widget.OnItemClickListener;
import com.lingyue.supertoolkit.customtools.CollectionUtils;
import com.lingyue.supertoolkit.customtools.CrashReporter;
import com.lingyue.supertoolkit.screen.IScreenShotProtectPage;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.veda.android.bananalibrary.net.ICallBack;
import com.yangqianguan.statistics.AutoTrackHelper;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import java.math.BigDecimal;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
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 EasyCashRepaymentActivity extends EasyCashCommonActivity implements IScreenShotProtectPage {
    public static final String INTENT_KEY_PAY_SUCCESS = "pay_success";
    public static final String INTENT_KEY_REPAYMENT_AMOUNT = "repaymentAmount";
    public static final String INTENT_KEY_SELECTED_COUPON_ID = "selectedCouponId";
    public static final String INTENT_KEY_SELECTED_INSTALMENT_ID_LIST = "selectedInstalmentIdList";
    public static final String OVO_CHANNEL = "OVO";
    private BigDecimal B;
    private ArrayList<String> D;
    private RepayBankCardListAdapter F;
    private ViewTreeObserver.OnGlobalLayoutListener G;
    private QuickRepayListAdapter H;
    private QuickRepayGuideCardAdapter I;
    private EasyCashBottomQuickRepayPayingDialog N;
    private String P;
    private String Q;

    @BindView(R.id.iv_top_tip_close)
    ImageView ivTopTipClose;

    @BindView(R.id.ll_expand)
    LinearLayout llExpand;

    @BindView(R.id.ll_quick_repay)
    LinearLayout llQuickRepay;

    @BindView(R.id.rl_top_tip)
    RelativeLayout rlTopTip;

    @BindView(R.id.rcl_bank_list)
    RecyclerView rvBankList;

    @BindView(R.id.rv_guide_add_quick_repay)
    RecyclerView rvGuideAddQuickRepay;

    @BindView(R.id.rv_quick_repay)
    RecyclerView rvQuickRepay;

    @BindView(R.id.tv_add_bank)
    TextView tvAddBank;

    @BindView(R.id.tv_amount_payable)
    TextView tvAmountPayable;

    @BindView(2131363496)
    TextView tvBottomTip;

    @BindView(R.id.tv_top_tip)
    TextView tvTopTip;
    private long C = -1;
    private List<RepayCardDisplayData> E = new ArrayList();
    private List<DirectDebitEnableAccount> J = new ArrayList();
    private List<DirectDebitEnableAccount> K = new ArrayList();
    private List<DirectDebitBankInfo> L = new ArrayList();
    private List<DirectDebitBankInfo> M = new ArrayList();
    private boolean O = false;
    HashMap<String, String> R = new HashMap<>();

    class AnonymousClass1 implements GeneralConfigManager.Callback {
        AnonymousClass1() {
        }

        public void e(View view) {
            Rect rect = new Rect();
            EasyCashRepaymentActivity.this.ivTopTipClose.getHitRect(rect);
            int dimensionPixelSize = EasyCashRepaymentActivity.this.getResources().getDimensionPixelSize(2131165415);
            rect.top -= dimensionPixelSize;
            rect.bottom += dimensionPixelSize;
            rect.left -= dimensionPixelSize;
            rect.right += dimensionPixelSize;
            view.setTouchDelegate(new TouchDelegate(rect, EasyCashRepaymentActivity.this.ivTopTipClose));
        }

        @SensorsDataInstrumented
        public void f(View view) {
            EasyCashRepaymentActivity.this.rlTopTip.setVisibility(8);
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
        }

        @Override
        public void a() {
            EasyCashRepaymentActivity.this.rlTopTip.setVisibility(8);
        }

        @Override
        public void b(@NonNull HashMap<String, String> hashMap) {
            String str = hashMap.get(EasycashConfigKey.APP_CONFIG_REPAYMENT_HINT);
            if (TextUtils.isEmpty(str)) {
                EasyCashRepaymentActivity.this.rlTopTip.setVisibility(8);
                return;
            }
            EasyCashRepaymentActivity.this.rlTopTip.setVisibility(0);
            EasyCashRepaymentActivity.this.tvTopTip.setText(str);
            final View view = (View) EasyCashRepaymentActivity.this.ivTopTipClose.getParent();
            view.post(new Runnable() {
                @Override
                public final void run() {
                    EasyCashRepaymentActivity.AnonymousClass1.this.e(view);
                }
            });
            EasyCashRepaymentActivity.this.ivTopTipClose.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    EasyCashRepaymentActivity.AnonymousClass1.this.f(view2);
                }
            });
        }
    }

    class AnonymousClass4 extends IdnObserver<RepaymentAccountResponse> {
        final RepayCardDisplayData a;
        final int b;

        AnonymousClass4(ICallBack iCallBack, RepayCardDisplayData repayCardDisplayData, int i) {
            super(iCallBack);
            this.a = repayCardDisplayData;
            this.b = i;
        }

        public void b(DialogInterface dialogInterface) {
            EasyCashRepaymentActivity.this.finish();
        }

        @Override
        public void onError(Throwable th, RepaymentAccountResponse repaymentAccountResponse) {
            if (repaymentAccountResponse.status.code != EasyCashResponseCode.HAVE_BILL_PAID_OFF.code) {
                super.onError(th, (Throwable) repaymentAccountResponse);
                return;
            }
            EasycashSingleButtonDialog f = EasycashSingleButtonDialog.d(EasyCashRepaymentActivity.this).h(repaymentAccountResponse.status.detail).f(R.string.ok);
            f.setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public final void onDismiss(DialogInterface dialogInterface) {
                    EasyCashRepaymentActivity.AnonymousClass4.this.b(dialogInterface);
                }
            });
            f.show();
        }

        @Override
        public void onSuccess(RepaymentAccountResponse repaymentAccountResponse) {
            this.a.bindCouponId = EasyCashRepaymentActivity.this.C;
            RepayCardDisplayData repayCardDisplayData = this.a;
            repayCardDisplayData.repayBankCard = repaymentAccountResponse.body;
            if (repayCardDisplayData.isDynamicLinkPay()) {
                EasyCashRepaymentActivity.this.O0(this.a);
            } else {
                this.a.isExpand = true;
                EasyCashRepaymentActivity.this.F.notifyItemChanged(this.b);
            }
            EasyCashRepaymentActivity.this.dismissLoadingDialog();
        }
    }

    static class AnonymousClass5 {
        static final int[] a;

        static {
            int[] iArr = new int[DirectDebitGuidePageStrategy.values().length];
            a = iArr;
            try {
                iArr[DirectDebitGuidePageStrategy.PAGE_A.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[DirectDebitGuidePageStrategy.PAGE_B.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[DirectDebitGuidePageStrategy.ORIGINAL_PAGE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[DirectDebitGuidePageStrategy.UNKNOWN.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
        }
    }

    public void A0(View view) {
        view.getWindowVisibleDisplayFrame(new Rect());
        if (r7 - r0.bottom > view.getRootView().getHeight() * 0.15d) {
            if (this.O) {
                return;
            }
            this.O = true;
            M0(true);
            return;
        }
        if (this.O) {
            this.O = false;
            M0(false);
        }
    }

    @SensorsDataInstrumented
    public void B0(DirectDebitEnableAccount directDebitEnableAccount, DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        Y0(directDebitEnableAccount, directDebitEnableAccount.bankBasicInfo.maxAmount);
        SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
        AutoTrackHelper.trackViewOnClick(dialogInterface, i);
    }

    @SensorsDataInstrumented
    public static void C0(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
        AutoTrackHelper.trackViewOnClick(dialogInterface, i);
    }

    public void D0(DirectDebitEnableAccount directDebitEnableAccount, DialogInterface dialogInterface) {
        ThirdPartEventUtils.D(this, EasycashUmengEvent.M4, new JsonParamsBuilder().d("bankLabel").a(directDebitEnableAccount.bankBasicInfo.bankValue).c());
    }

    public void F0(String str, DialogInterface dialogInterface) {
        ThirdPartEventUtils.D(this, EasycashUmengEvent.L4, new JsonParamsBuilder().d("bankLabel").a(str).c());
    }

    public void G0(DialogInterface dialogInterface) {
        if (this.G != null) {
            findViewById(android.R.id.content).getViewTreeObserver().removeOnGlobalLayoutListener(this.G);
        }
    }

    public void H0(DirectDebitEnableAccount directDebitEnableAccount, DialogInterface dialogInterface) {
        ThirdPartEventUtils.D(this, EasycashUmengEvent.N4, new JsonParamsBuilder().d("bankLabel").a(directDebitEnableAccount.bankBasicInfo.bankLabel).c());
    }

    public void I0(DirectDebitEnableAccount directDebitEnableAccount, BigDecimal bigDecimal) {
        ThirdPartEventUtils.D(this, EasycashUmengEvent.O4, new JsonParamsBuilder().d("bankLabel").a(directDebitEnableAccount.bankBasicInfo.bankLabel).c());
        ECQuickRepayPayingAct.startQuickRepayPaying(this, directDebitEnableAccount, bigDecimal);
    }

    public void J0(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        jumpToMainPage();
        finish();
    }

    private void K0(@NonNull String str) {
        try {
            SensorTrackEvent sensorTrackEvent = SensorTrackEvent.EC_OPEN_QUICK_REPAY_BANK_ENTER_CLICK;
            JSONObject a = sensorTrackEvent.a();
            a.put("entry_page", "还款页面入口");
            a.put("pay_source", str);
            a.put(com.umeng.analytics.pro.d.M, this.P);
            ThirdPartEventUtils.Q(this, sensorTrackEvent, a);
        } catch (JSONException e) {
            DevUtil.a(e);
        }
    }

    private void M0(boolean z2) {
        EasyCashBottomQuickRepayPayingDialog easyCashBottomQuickRepayPayingDialog;
        if (z2 || (easyCashBottomQuickRepayPayingDialog = this.N) == null || !easyCashBottomQuickRepayPayingDialog.isShowing()) {
            return;
        }
        this.N.h();
    }

    private void N0(int i, RepayCardDisplayData repayCardDisplayData) {
        if (TextUtils.equals(OVO_CHANNEL, repayCardDisplayData.repayBankCard.channelType)) {
            o0(repayCardDisplayData.repayBankCard.channelType.toLowerCase());
            return;
        }
        if (!repayCardDisplayData.isExpand && repayCardDisplayData.bindCouponId != this.C) {
            U0(i, repayCardDisplayData);
        } else if (repayCardDisplayData.isDynamicLinkPay()) {
            U0(i, repayCardDisplayData);
        } else {
            repayCardDisplayData.isExpand = !repayCardDisplayData.isExpand;
            this.F.notifyItemChanged(i);
        }
    }

    public void O0(RepayCardDisplayData repayCardDisplayData) {
        if (repayCardDisplayData == null) {
            return;
        }
        String dynamicLinkPayUrl = repayCardDisplayData.getDynamicLinkPayUrl();
        if (TextUtils.isEmpty(dynamicLinkPayUrl)) {
            return;
        }
        if (repayCardDisplayData.getRedirectUsingInternalWebview()) {
            jumpToWebPage(dynamicLinkPayUrl, true);
            return;
        }
        try {
            Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(dynamicLinkPayUrl));
            intent.setFlags(268435456);
            if (intent.resolveActivity(getPackageManager()) != null) {
                startActivity(intent);
            }
        } catch (Exception e) {
            BaseUtils.p(this, getString(R.string.easycash_repayment_channel_error));
            CrashReporter.a(e);
        }
    }

    public void P0(RepayListBankCardResponse repayListBankCardResponse) {
        R0(repayListBankCardResponse.body.directDebitAccount);
        S0(repayListBankCardResponse.body.virtualAccountList);
    }

    private void Q0() {
        final View findViewById = findViewById(android.R.id.content);
        this.G = new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public final void onGlobalLayout() {
                EasyCashRepaymentActivity.this.A0(findViewById);
            }
        };
        findViewById.getViewTreeObserver().addOnGlobalLayoutListener(this.G);
    }

    private void R0(DirectDebitBankBean directDebitBankBean) {
        if (directDebitBankBean == null || !directDebitBankBean.isEnable()) {
            this.llQuickRepay.setVisibility(8);
            return;
        }
        this.P = directDebitBankBean.provider;
        this.Q = directDebitBankBean.guidePageStrategy;
        this.M.clear();
        this.M.addAll(directDebitBankBean.supportBankList);
        this.L.clear();
        this.J.clear();
        this.J.addAll(directDebitBankBean.linkedAccountList);
        this.K.clear();
        if (this.J.size() > 2) {
            this.K.addAll(this.J.subList(0, 2));
            this.tvAddBank.setVisibility(8);
            this.llExpand.setVisibility(0);
            this.H.notifyDataSetChanged();
            this.rvQuickRepay.setVisibility(0);
            this.rvGuideAddQuickRepay.setVisibility(8);
        } else if (this.J.size() > 0) {
            this.K.addAll(this.J);
            this.llExpand.setVisibility(8);
            this.tvAddBank.setVisibility(CollectionUtils.f(this.M) ? 8 : 0);
            this.H.notifyDataSetChanged();
            this.rvQuickRepay.setVisibility(0);
            this.rvGuideAddQuickRepay.setVisibility(8);
        } else if (this.M.size() > 2) {
            this.L.addAll(this.M.subList(0, 2));
            this.I.notifyDataSetChanged();
            this.rvGuideAddQuickRepay.setVisibility(0);
            this.llExpand.setVisibility(0);
            this.rvQuickRepay.setVisibility(8);
            this.tvAddBank.setVisibility(8);
            L0();
        } else if (this.M.size() > 0) {
            this.L.addAll(this.M);
            this.I.notifyDataSetChanged();
            this.rvGuideAddQuickRepay.setVisibility(0);
            this.llExpand.setVisibility(8);
            this.rvQuickRepay.setVisibility(8);
            this.tvAddBank.setVisibility(8);
            L0();
        }
        this.llQuickRepay.setVisibility(0);
        ThirdPartEventUtils.D(this, EasycashUmengEvent.E4, null);
    }

    private void S0(List<RepayBankCard> list) {
        this.E.clear();
        Iterator<RepayBankCard> it = list.iterator();
        while (it.hasNext()) {
            this.E.add(new RepayCardDisplayData(it.next()));
        }
        this.F.notifyDataSetChanged();
        if (this.E.size() > 0) {
            this.tvBottomTip.setVisibility(0);
        }
    }

    private void T0() {
        showLoadingDialog();
        this.apiHelper.a().z1().a0(Schedulers.c()).K(AndroidSchedulers.a()).a(new IdnObserver<RepayListBankCardResponse>(this) {
            @Override
            public void onError(Throwable th, RepayListBankCardResponse repayListBankCardResponse) {
                super.onError(th, (Throwable) repayListBankCardResponse);
                EasyCashRepaymentActivity.this.dismissLoadingDialog();
                EasyCashRepaymentActivity.this.L();
            }

            @Override
            public void onSuccess(RepayListBankCardResponse repayListBankCardResponse) {
                EasyCashRepaymentActivity.this.P0(repayListBankCardResponse);
            }

            @Override
            public void onComplete() {
                super.onComplete();
                EasyCashRepaymentActivity.this.dismissLoadingDialog();
                EasyCashRepaymentActivity.this.L();
            }
        });
    }

    private void U0(int i, RepayCardDisplayData repayCardDisplayData) {
        showLoadingDialog();
        HashMap hashMap = new HashMap();
        hashMap.put("channel", repayCardDisplayData.repayBankCard.channelType);
        hashMap.put("amount", this.B);
        hashMap.put("instalmentIds", this.D);
        long j = this.C;
        if (j != -1) {
            hashMap.put("couponId", Long.valueOf(j));
        }
        this.apiHelper.a().s1(hashMap).a(new AnonymousClass4(this, repayCardDisplayData, i));
    }

    private void V0(List<String> list) {
        this.apiHelper.a().k1(new ResourceV2RequestParams(list)).a(new IdnObserver<AppResourceInfoResponseV2>(this) {
            @Override
            public void onSuccess(AppResourceInfoResponseV2 appResourceInfoResponseV2) {
                CommonDialogDetail asCommonDialogDetail;
                List<MarketResource> list2 = appResourceInfoResponseV2.body.appResourceInfo.get("REPAY_NOTICE_POP_UP");
                if (CollectionUtils.f(list2) || (asCommonDialogDetail = list2.get(0).asCommonDialogDetail()) == null) {
                    return;
                }
                if (asCommonDialogDetail.isH5Dialog()) {
                    H5DialogUtil.s(EasyCashRepaymentActivity.this, AppResourceReportPageType.REPAYMENT_PAGE.name(), asCommonDialogDetail, "repay_notice_pop_up_" + asCommonDialogDetail.resourceId);
                    return;
                }
                DevUtil.a(new RuntimeException("REPAY_NOTICE_POP_UP 下发未识别非H5 dialogType: " + asCommonDialogDetail.dialogType + ",webUrl:" + asCommonDialogDetail.webUrl));
            }

            @Override
            protected boolean superShowErrorToast() {
                return false;
            }
        });
    }

    private void W0(final DirectDebitEnableAccount directDebitEnableAccount) {
        if (directDebitEnableAccount == null || directDebitEnableAccount.bankBasicInfo == null) {
            return;
        }
        EasycashConfirmDialog p = EasycashConfirmDialog.f(this).q("dialog_quick_repay_limit_max").p(getString(R.string.easycash_quick_repay_limit));
        String string = getString(R.string.easycash_quick_repay_limit_max);
        DirectDebitBankInfo directDebitBankInfo = directDebitEnableAccount.bankBasicInfo;
        EasycashConfirmDialog j = p.h(MessageFormat.format(string, directDebitBankInfo.bankLabel, directDebitBankInfo.maxAmountFormat)).n(R.string.easycash_continue_repay).k(2131886764).m(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                EasyCashRepaymentActivity.this.B0(directDebitEnableAccount, dialogInterface, i);
            }
        }).j(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                EasyCashRepaymentActivity.C0(dialogInterface, i);
            }
        });
        j.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public final void onShow(DialogInterface dialogInterface) {
                EasyCashRepaymentActivity.this.D0(directDebitEnableAccount, dialogInterface);
            }
        });
        j.show();
    }

    private void X0(final String str, String str2) {
        if (TextUtils.isEmpty(str2) || TextUtils.isEmpty(str)) {
            return;
        }
        EasycashSingleButtonDialog l = EasycashSingleButtonDialog.d(this).m(getString(R.string.easycash_quick_repay_limit)).h(MessageFormat.format(getString(R.string.easycash_quick_repay_limit_min), str, str2)).o("dialog_quick_repay_limit_min").f(2131886194).l(new EasycashSingleButtonDialog.OnDialogButtonClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.dismiss();
            }
        });
        l.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public final void onShow(DialogInterface dialogInterface) {
                EasyCashRepaymentActivity.this.F0(str, dialogInterface);
            }
        });
        l.show();
    }

    private void Y0(final DirectDebitEnableAccount directDebitEnableAccount, BigDecimal bigDecimal) {
        EasyCashBottomQuickRepayPayingDialog easyCashBottomQuickRepayPayingDialog = new EasyCashBottomQuickRepayPayingDialog(this, directDebitEnableAccount.bankBasicInfo, bigDecimal, new EasyCashBottomQuickRepayPayingDialog.CallBack() {
            @Override
            public final void a(BigDecimal bigDecimal2) {
                EasyCashRepaymentActivity.this.I0(directDebitEnableAccount, bigDecimal2);
            }
        });
        this.N = easyCashBottomQuickRepayPayingDialog;
        easyCashBottomQuickRepayPayingDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                EasyCashRepaymentActivity.this.G0(dialogInterface);
            }
        });
        this.N.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public final void onShow(DialogInterface dialogInterface) {
                EasyCashRepaymentActivity.this.H0(directDebitEnableAccount, dialogInterface);
            }
        });
        this.N.show();
        Q0();
    }

    private void Z0() {
        EasycashSingleButtonDialog.d(this).k(R.drawable.easycash_ic_success).m(getString(R.string.repay_processing)).g(R.string.easycash_repayment_success_content).o("dialog_repayment_success").f(2131886119).l(new EasycashSingleButtonDialog.OnDialogButtonClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                EasyCashRepaymentActivity.this.J0(dialogInterface, i);
            }
        }).j(false).show();
    }

    private Map<String, String> a1() {
        this.R.put("repayment_amount", this.B + "");
        return this.R;
    }

    private void b1(DirectDebitEnableAccount directDebitEnableAccount, BigDecimal bigDecimal) {
        if (bigDecimal.compareTo(directDebitEnableAccount.bankBasicInfo.minAmount) < 0) {
            DirectDebitBankInfo directDebitBankInfo = directDebitEnableAccount.bankBasicInfo;
            X0(directDebitBankInfo.bankLabel, directDebitBankInfo.minAmountFormat);
        } else if (bigDecimal.compareTo(directDebitEnableAccount.bankBasicInfo.maxAmount) > 0) {
            W0(directDebitEnableAccount);
        } else {
            Y0(directDebitEnableAccount, bigDecimal);
        }
    }

    @NonNull
    private String m0(@NonNull String str, @NonNull String str2) {
        return Uri.parse(this.appGlobal.a.a().toString()).buildUpon().path(str).appendQueryParameter("bank", str2).appendQueryParameter("test_name", this.Q).appendQueryParameter("reqSpeBar", "1").appendQueryParameter("isAppBarHid", "1").build().toString();
    }

    private void n0(@NonNull String str) {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        int i = AnonymousClass5.a[DirectDebitGuidePageStrategy.fromName(this.Q).ordinal()];
        if (i == 1) {
            H5DialogUtil.v(this, m0("rc/popup/quick-payment-celebrate-popup", str), "QuickPayGuideDialog", AppResourceReportPageType.REPAYMENT_PAGE.name());
            return;
        }
        if (i == 2) {
            H5DialogUtil.v(this, m0("rc/popup/quick-payment-ticket-popup", str), "QuickPayGuideDialog", AppResourceReportPageType.REPAYMENT_PAGE.name());
        } else if (i == 3 || i == 4) {
            jumpToWebPage(m0("webview/bank-card-example", str));
        }
    }

    private void o0(String str) {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        Uri.Builder path = Uri.parse(this.appGlobal.a.a().toString()).buildUpon().path("/webview/" + str);
        path.appendQueryParameter("amount", this.B.toString());
        path.appendQueryParameter("instalmentIds", y2.a(",", this.D));
        long j = this.C;
        if (j != -1) {
            path.appendQueryParameter("couponId", String.valueOf(j));
        }
        jumpToWebPage(path.build().toString(), true);
    }

    private void p0() {
        QuickRepayListAdapter quickRepayListAdapter = new QuickRepayListAdapter(this, this.K);
        this.H = quickRepayListAdapter;
        quickRepayListAdapter.d(new OnItemClickListener() {
            public final void a(View view, int i, Object obj) {
                EasyCashRepaymentActivity.this.u0(view, i, (DirectDebitEnableAccount) obj);
            }
        });
        this.rvQuickRepay.setLayoutManager(new LinearLayoutManager(this));
        this.rvQuickRepay.setAdapter(this.H);
        LinearVerticalDecoration linearVerticalDecoration = new LinearVerticalDecoration(this, 2131165413, 2131165472, 2131099761);
        this.rvQuickRepay.addItemDecoration(linearVerticalDecoration);
        QuickRepayGuideCardAdapter quickRepayGuideCardAdapter = new QuickRepayGuideCardAdapter(this, this.L, 2);
        this.I = quickRepayGuideCardAdapter;
        quickRepayGuideCardAdapter.f(new OnItemClickListener() {
            public final void a(View view, int i, Object obj) {
                EasyCashRepaymentActivity.this.v0(view, i, (DirectDebitBankInfo) obj);
            }
        });
        this.rvGuideAddQuickRepay.setLayoutManager(new LinearLayoutManager(this));
        this.rvGuideAddQuickRepay.setAdapter(this.I);
        this.rvGuideAddQuickRepay.addItemDecoration(linearVerticalDecoration);
    }

    private void q0() {
        this.tvAmountPayable.setText(EcFormatUtil.n(this.B));
    }

    private void r0() {
        RepayBankCardListAdapter repayBankCardListAdapter = new RepayBankCardListAdapter(this, this.E);
        this.F = repayBankCardListAdapter;
        repayBankCardListAdapter.h(new OnItemClickListener() {
            public final void a(View view, int i, Object obj) {
                EasyCashRepaymentActivity.this.w0(view, i, (RepayCardDisplayData) obj);
            }
        });
        this.rvBankList.setFocusable(false);
        this.rvBankList.setNestedScrollingEnabled(false);
        this.rvBankList.setLayoutManager(new LinearLayoutManager(this));
        this.rvBankList.setHasFixedSize(true);
        this.rvBankList.setItemAnimator(new DefaultItemAnimator());
        this.rvBankList.setAdapter(this.F);
    }

    private void s0() {
        this.a.setVisibility(this.userSession.f().showCustomerService ? 0 : 8);
        this.a.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                EasyCashRepaymentActivity.this.x0(view);
            }
        });
    }

    public static void startEasyCashRepaymentActivity(Activity activity, BigDecimal bigDecimal, long j, ArrayList<String> arrayList) {
        Intent intent = new Intent(activity, (Class<?>) EasyCashRepaymentActivity.class);
        intent.putExtra(INTENT_KEY_REPAYMENT_AMOUNT, bigDecimal);
        intent.putExtra(INTENT_KEY_SELECTED_COUPON_ID, j);
        intent.putStringArrayListExtra(INTENT_KEY_SELECTED_INSTALMENT_ID_LIST, arrayList);
        activity.startActivity(intent);
    }

    private void t0() {
        new GeneralConfigManager(this).h(Collections.singletonList(EasycashConfigKey.APP_CONFIG_REPAYMENT_HINT), new AnonymousClass1());
    }

    public void u0(View view, int i, DirectDebitEnableAccount directDebitEnableAccount) {
        b1(directDebitEnableAccount, this.B);
        AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, directDebitEnableAccount);
    }

    public void v0(View view, int i, DirectDebitBankInfo directDebitBankInfo) {
        if (directDebitBankInfo == null) {
            AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, directDebitBankInfo);
            return;
        }
        K0(directDebitBankInfo.bankValue);
        n0(directDebitBankInfo.bankValue);
        AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, directDebitBankInfo);
    }

    public void w0(View view, int i, RepayCardDisplayData repayCardDisplayData) {
        N0(i, repayCardDisplayData);
        AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, repayCardDisplayData);
    }

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

    public void y0(DirectDebitBankInfo directDebitBankInfo) {
        if (directDebitBankInfo == null) {
            return;
        }
        K0(directDebitBankInfo.bankValue);
        n0(directDebitBankInfo.bankValue);
    }

    public void z0(DialogInterface dialogInterface) {
        ThirdPartEventUtils.D(this, EasycashUmengEvent.F4, new JsonParamsBuilder().d("source").a("repayPage").c());
    }

    @Override
    protected void B(@NonNull Bundle bundle) {
        super.B(bundle);
        this.B = (BigDecimal) bundle.getSerializable(INTENT_KEY_REPAYMENT_AMOUNT);
        this.C = bundle.getLong(INTENT_KEY_SELECTED_COUPON_ID);
        this.D = bundle.getStringArrayList(INTENT_KEY_SELECTED_INSTALMENT_ID_LIST);
    }

    @Override
    protected void D() {
        super.D();
        s0();
        r0();
        p0();
    }

    protected void L0() {
        try {
            SensorTrackEvent sensorTrackEvent = SensorTrackEvent.EC_OPEN_QUICK_REPAY_BANK_ENTER_SHOW;
            JSONObject a = sensorTrackEvent.a();
            a.put("entry_page", "还款页面入口");
            a.put(com.umeng.analytics.pro.d.M, this.P);
            ThirdPartEventUtils.Q(this, sensorTrackEvent, a);
        } catch (JSONException e) {
            DevUtil.a(e);
        }
    }

    @Override
    protected void N(@NonNull Bundle bundle) {
        super.N(bundle);
        bundle.putLong(INTENT_KEY_SELECTED_COUPON_ID, this.C);
        bundle.putSerializable(INTENT_KEY_REPAYMENT_AMOUNT, this.B);
        bundle.putStringArrayList(INTENT_KEY_SELECTED_INSTALMENT_ID_LIST, this.D);
    }

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

    @Override
    public String getTrackUrl() {
        return j0.b.a(this);
    }

    @Override
    public boolean isNeedProcessScreenShot() {
        return j0.a.a(this);
    }

    @OnClick({R.id.tv_add_bank})
    public void onClickAddBank() {
        if (BaseUtils.l() || CollectionUtils.f(this.M)) {
            return;
        }
        EasyCashBottomQuickRepayDialog easyCashBottomQuickRepayDialog = new EasyCashBottomQuickRepayDialog(this, this.M, new EasyCashBottomQuickRepayDialog.CallBack() {
            @Override
            public final void a(DirectDebitBankInfo directDebitBankInfo) {
                EasyCashRepaymentActivity.this.y0(directDebitBankInfo);
            }
        });
        easyCashBottomQuickRepayDialog.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public final void onShow(DialogInterface dialogInterface) {
                EasyCashRepaymentActivity.this.z0(dialogInterface);
            }
        });
        easyCashBottomQuickRepayDialog.show();
    }

    @OnClick({R.id.ll_expand})
    public void onExpandClicked() {
        if (BaseUtils.l()) {
            return;
        }
        if (CollectionUtils.f(this.J)) {
            this.L.clear();
            this.L.addAll(this.M);
            this.I.notifyDataSetChanged();
            this.llExpand.setVisibility(8);
            this.tvAddBank.setVisibility(8);
            return;
        }
        this.K.clear();
        this.K.addAll(this.J);
        this.llExpand.setVisibility(8);
        this.tvAddBank.setVisibility(CollectionUtils.f(this.M) ? 8 : 0);
        this.H.notifyDataSetChanged();
    }

    @Override
    protected void onNewIntent(Intent intent) {
        if (intent.getBooleanExtra(INTENT_KEY_PAY_SUCCESS, false)) {
            Z0();
        } else {
            super.onNewIntent(intent);
        }
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onQuickRepayNewCardBindEvent(QuickRepayNewCardBindEvent quickRepayNewCardBindEvent) {
        EventBus.c().q(quickRepayNewCardBindEvent);
        T0();
        V0(Collections.singletonList("REPAY_NOTICE_POP_UP"));
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onQuickRepayResultEvent(QuickRepayResultEvent quickRepayResultEvent) {
        if (quickRepayResultEvent.isSuccess) {
            finish();
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        ThirdPartEventUtils.P(this, SensorTrackEvent.EC_REPAYMENT_PAGE, a1());
    }

    @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);
    }

    @Override
    protected void z() {
        q0();
        t0();
        V0(Collections.singletonList("REPAY_NOTICE_POP_UP"));
        T0();
    }
}