导航菜单

页面标题

页面副标题

Easycash v3.75.13 - SubmitKtpActivity.java 源代码

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

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


package com.fintopia.lender.module.ktp;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.OnClick;
import com.bigkoo.pickerview.OptionsPickerView;
import com.bigkoo.pickerview.TimePickerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.Transformation;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.fintopia.lender.R;
import com.fintopia.lender.module.LabelBean;
import com.fintopia.lender.module.baseui.LenderCommonActivity;
import com.fintopia.lender.module.camera.BitmapBytesMap;
import com.fintopia.lender.module.camera.TakePhotoActivity;
import com.fintopia.lender.module.ktp.models.UploadIdCardImage;
import com.fintopia.lender.module.launch.AppGeneralConfigUtils;
import com.fintopia.lender.module.launch.model.LenderConfigKey;
import com.fintopia.lender.module.maintab.AuthHelper;
import com.fintopia.lender.module.network.ILenderApiRoutes;
import com.fintopia.lender.module.rdl.EKycActivity;
import com.fintopia.lender.module.rdl.model.AuthInfoResponse;
import com.fintopia.lender.module.rdl.model.AuthOptionType;
import com.fintopia.lender.module.rdl.model.GetAuthOptionListInfoResponse;
import com.fintopia.lender.module.rdl.model.LenderAddressSelectEvent;
import com.fintopia.lender.module.rdl.model.LenderIndustryVocationResponse;
import com.fintopia.lender.module.rdl.model.RealNameVerificationResponseV2;
import com.fintopia.lender.module.utils.AuthStepRationale;
import com.fintopia.lender.widget.FullScreenDialog;
import com.fintopia.lender.widget.LenderBottomAddressDialog;
import com.fintopia.lender.widget.LenderTwoRowSelectCompanion;
import com.fintopia.lender.widget.PickViewHelper;
import com.google.android.gms.common.Scopes;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.IdnBaseResult;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.utils.FieldRuleUtils;
import com.lingyue.idnbaselib.utils.SmoothScrollUtils;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
import com.lingyue.idnbaselib.widget.SelectorLinkage;
import com.lingyue.idnbaselib.widget.editTextBridge.separatorEditText.KtpEditText;
import com.lingyue.supertoolkit.customtools.CollectionUtils;
import com.lingyue.supertoolkit.formattools.DateFormatUtil;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionDenied;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionGranted;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.lingyue.supertoolkit.widgets.CharFilterForMeiZu;
import com.veda.android.imageloaderlib.GlideRoundTransform;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;

@AuthStepRationale
public class SubmitKtpActivity extends LenderCommonActivity implements TextWatcher {
    public static final String INTENT_KEY_ERROR_FIELDS = "errorFields";
    public static final String INTENT_KEY_FOREIGNER = "foreigner";
    public static final int REQUEST_CODE_GUIDE_KTP = 1001;
    public static final int REQUEST_CODE_GUIDE_PASSPORT = 1002;
    private LabelBean D;
    private LabelBean E;
    private LabelBean F;
    private LabelBean G;
    private LabelBean H;
    private LabelBean I;
    private Date J;
    private LabelBean K;
    private LabelBean L;
    private LabelBean M;
    private LabelBean N;
    private LabelBean O;
    private LabelBean P;
    private LenderBottomAddressDialog Q;

    @BindView(4714)
    Button btnSubmit;
    public ArrayList<String> errorFieldList;

    @BindView(4878)
    EditText etBirthplace;

    @BindView(4881)
    EditText etEmail;

    @BindView(4886)
    KtpEditText etKtp;

    @BindView(4889)
    EditText etName;

    @BindView(4890)
    EditText etNeighborhoodCommittee;

    @BindView(4894)
    EditText etPassport;

    @BindView(4901)
    EditText etStreet;

    @BindView(5033)
    ImageView ivKtp;

    @BindView(5154)
    LinearLayout llPassport;

    @BindView(5161)
    LinearLayout llRdlSupplement;

    @BindView(5384)
    ScrollView scrollView;

    @BindView(5567)
    TextView tvAddress;

    @BindView(5571)
    TextView tvAddressTitle;

    @BindView(5600)
    TextView tvBirthplace;

    @BindView(5652)
    TextView tvEducationLevel;

    @BindView(5653)
    TextView tvEducationLevelTitle;

    @BindView(5654)
    TextView tvEmail;

    @BindView(5689)
    TextView tvKtpExpiryDate;

    @BindView(5690)
    TextView tvKtpExpiryDateTitle;

    @BindView(5724)
    TextView tvMaritalStatus;

    @BindView(5725)
    TextView tvMaritalStatusTitle;

    @BindView(5743)
    TextView tvMonthlyIncome;

    @BindView(5744)
    TextView tvMonthlyIncomeTitle;

    @BindView(5750)
    TextView tvNeighborhoodCommittee;

    @BindView(5788)
    TextView tvPassport;

    @BindView(5812)
    TextView tvProfession;

    @BindView(5813)
    TextView tvProfessionTitle;

    @BindView(5832)
    TextView tvReligion;

    @BindView(5833)
    TextView tvReligionTitle;

    @BindView(5863)
    TextView tvSourceOfFund;

    @BindView(5864)
    TextView tvSourceOfFundTitle;

    @BindView(5870)
    TextView tvStreet;

    @BindView(5893)
    TextView tvTipKtp;

    @BindView(5894)
    TextView tvTipName;

    @BindView(5896)
    TextView tvTipUploadKtp;

    @BindView(5940)
    TextView tvWorkExperience;

    @BindView(5941)
    TextView tvWorkExperienceTitle;

    private LenderTwoRowSelectCompanion f57u;

    private String f58v;

    @BindView(5963)
    View vKtpLine;

    private boolean f59w;

    private ArrayList<LabelBean> f60x = new ArrayList<>();
    private ArrayList<LabelBean> y = new ArrayList<>();
    private ArrayList<LabelBean> z = new ArrayList<>();
    private ArrayList<LabelBean> A = new ArrayList<>();
    private ArrayList<LabelBean> B = new ArrayList<>();
    private ArrayList<LabelBean> C = new ArrayList<>();
    private SelectorLinkage R = new SelectorLinkage();
    private boolean S = false;
    private boolean T = true;
    private String U = "isFirstEnter";

    static class AnonymousClass9 {
        static final int[] a;

        static {
            int[] iArr = new int[AuthOptionType.values().length];
            a = iArr;
            try {
                iArr[AuthOptionType.MARRY_STATUS.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[AuthOptionType.RELIGION.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[AuthOptionType.EDUCATION.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[AuthOptionType.SOURCE_OF_FUND.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                a[AuthOptionType.MONTHLY_INCOME_RANGE.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                a[AuthOptionType.WORK_EXPERIENCE.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
        }
    }

    private void A0() {
        this.R.a(this.tvProfessionTitle, new SelectorLinkage.Task() {
            public final void a(View view) {
                SubmitKtpActivity.this.R0(view);
            }
        });
        this.R.a(this.tvMonthlyIncomeTitle, new SelectorLinkage.Task() {
            public final void a(View view) {
                SubmitKtpActivity.this.T0(view);
            }
        });
        this.R.a(this.tvWorkExperienceTitle, new SelectorLinkage.Task() {
            public final void a(View view) {
                SubmitKtpActivity.this.V0(view);
            }
        });
        this.R.a(this.tvEducationLevelTitle, new SelectorLinkage.Task() {
            public final void a(View view) {
                SubmitKtpActivity.this.X0(view);
            }
        });
        this.R.a(this.tvSourceOfFundTitle, new SelectorLinkage.Task() {
            public final void a(View view) {
                SubmitKtpActivity.this.Z0(view);
            }
        });
    }

    private void B0() {
        LenderTwoRowSelectCompanion lenderTwoRowSelectCompanion = new LenderTwoRowSelectCompanion(getString(R.string.industry_vocation), this.tvProfession, this);
        this.f57u = lenderTwoRowSelectCompanion;
        lenderTwoRowSelectCompanion.e(new LenderTwoRowSelectCompanion.TwoRowSelectViewListener() {
            @Override
            public void a() {
                SubmitKtpActivity.this.m1();
            }

            @Override
            public void b(View view, LabelBean labelBean, LabelBean labelBean2) {
                SubmitKtpActivity.this.O = labelBean;
                SubmitKtpActivity.this.P = labelBean2;
                SubmitKtpActivity.this.tvProfession.setText(labelBean.label + " " + labelBean2.label);
                SubmitKtpActivity.this.R.c(SubmitKtpActivity.this.tvProfessionTitle);
            }
        });
    }

    private void C0() {
        this.etName.addTextChangedListener(this);
        this.etKtp.addTextChangedListener(this);
        this.etEmail.addTextChangedListener(this);
    }

    private boolean D0() {
        return (this.F == null || this.G == null || this.H == null || this.I == null) ? false : true;
    }

    private boolean E0(RealNameVerificationResponseV2.ErrorFields errorFields) {
        return this.errorFieldList.contains(errorFields.name());
    }

    private boolean F0() {
        return !CollectionUtils.f(this.errorFieldList);
    }

    public void G0(View view, LabelBean labelBean) {
        this.L = labelBean;
        this.tvEducationLevel.setText(labelBean.label);
        this.R.c(this.tvEducationLevelTitle);
    }

    public void H0(Activity activity, FullScreenDialog fullScreenDialog, View view, OptionsPickerView optionsPickerView) {
        LabelBean labelBean = this.L;
        if (labelBean != null) {
            optionsPickerView.y(this.z.indexOf(labelBean));
        }
    }

    public void I0(View view, LabelBean labelBean) {
        this.M = labelBean;
        this.tvMonthlyIncome.setText(labelBean.label);
        this.R.c(this.tvMonthlyIncomeTitle);
    }

    public void J0(Activity activity, FullScreenDialog fullScreenDialog, View view, OptionsPickerView optionsPickerView) {
        LabelBean labelBean = this.M;
        if (labelBean != null) {
            optionsPickerView.y(this.B.indexOf(labelBean));
        }
    }

    public void K0(Activity activity, FullScreenDialog fullScreenDialog, View view, OptionsPickerView optionsPickerView) {
        LabelBean labelBean = this.D;
        if (labelBean != null) {
            optionsPickerView.y(this.f60x.indexOf(labelBean));
        }
    }

    public void L0(Activity activity, FullScreenDialog fullScreenDialog, View view, OptionsPickerView optionsPickerView) {
        LabelBean labelBean = this.E;
        if (labelBean != null) {
            optionsPickerView.y(this.y.indexOf(labelBean));
        }
    }

    public void M0(View view, LabelBean labelBean) {
        this.K = labelBean;
        this.tvSourceOfFund.setText(labelBean.label);
        this.R.c(this.tvSourceOfFundTitle);
    }

    public void N0(Activity activity, FullScreenDialog fullScreenDialog, View view, OptionsPickerView optionsPickerView) {
        LabelBean labelBean = this.K;
        if (labelBean != null) {
            optionsPickerView.y(this.A.indexOf(labelBean));
        }
    }

    public void O0(View view, LabelBean labelBean) {
        this.N = labelBean;
        this.tvWorkExperience.setText(labelBean.label);
        this.R.c(this.tvWorkExperienceTitle);
    }

    public void P0(Activity activity, FullScreenDialog fullScreenDialog, View view, OptionsPickerView optionsPickerView) {
        LabelBean labelBean = this.N;
        if (labelBean != null) {
            optionsPickerView.y(this.C.indexOf(labelBean));
        }
    }

    public void Q0(View view) {
        SmoothScrollUtils.b(this.scrollView, view);
        showProfession();
    }

    public void R0(final View view) {
        if (this.P == null || this.O == null) {
            this.tvProfession.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    SubmitKtpActivity.this.Q0(view);
                }
            }, 500L);
        }
    }

    public void S0(View view) {
        SmoothScrollUtils.b(this.scrollView, view);
        showMonthlyIncome();
    }

    public void T0(final View view) {
        if (this.M == null) {
            this.tvMonthlyIncome.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    SubmitKtpActivity.this.S0(view);
                }
            }, 500L);
        }
    }

    public void U0(View view) {
        SmoothScrollUtils.b(this.scrollView, view);
        showWorkExperience();
    }

    public void V0(final View view) {
        if (this.N == null) {
            this.tvWorkExperience.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    SubmitKtpActivity.this.U0(view);
                }
            }, 500L);
        }
    }

    public void W0(View view) {
        SmoothScrollUtils.b(this.scrollView, view);
        showEducationLevel();
    }

    public void X0(final View view) {
        if (this.L == null) {
            this.tvEducationLevel.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    SubmitKtpActivity.this.W0(view);
                }
            }, 500L);
        }
    }

    public void Y0(View view) {
        SmoothScrollUtils.b(this.scrollView, view);
        showSourceOfFund();
    }

    public void Z0(final View view) {
        if (this.K == null) {
            this.tvSourceOfFund.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    SubmitKtpActivity.this.Y0(view);
                }
            }, 500L);
        }
    }

    public void a1() {
        setResult(-1);
        finish();
    }

    public void b1(View view, Date date) {
        this.tvKtpExpiryDate.setText(DateFormatUtil.d(date));
        this.J = date;
    }

    public static void c1(Activity activity, FullScreenDialog fullScreenDialog, View view, TimePickerView timePickerView) {
        timePickerView.r(false);
        Calendar calendar = Calendar.getInstance();
        Calendar calendar2 = Calendar.getInstance();
        Calendar calendar3 = Calendar.getInstance();
        calendar.add(1, 100);
        calendar2.add(1, -100);
        int i = calendar.get(1);
        Date time = calendar3.getTime();
        timePickerView.t(calendar2.get(1), i);
        timePickerView.w(time);
    }

    public void d1(LenderAddressSelectEvent lenderAddressSelectEvent) {
        LabelBean labelBean;
        if (lenderAddressSelectEvent == null || (labelBean = lenderAddressSelectEvent.provinceLabelBean) == null) {
            return;
        }
        this.F = labelBean;
        this.G = lenderAddressSelectEvent.cityLabelBean;
        this.H = lenderAddressSelectEvent.districtLabelBean;
        this.I = lenderAddressSelectEvent.villageLabelBean;
        StringBuilder sb = new StringBuilder(labelBean.label);
        if (this.G != null) {
            sb.append(", ");
            sb.append(this.G.label);
        }
        if (this.H != null) {
            sb.append(", ");
            sb.append(this.H.label);
        }
        if (this.I != null) {
            sb.append(", ");
            sb.append(this.I.label);
        }
        this.tvAddress.setText(sb.toString());
    }

    private void e1(byte[] bArr, UploadIdCardImage uploadIdCardImage) {
        i1(bArr);
        if (uploadIdCardImage != null) {
            if (!TextUtils.isEmpty(uploadIdCardImage.name)) {
                this.etName.setText(uploadIdCardImage.name);
            }
            if (!TextUtils.isEmpty(uploadIdCardImage.idNumber)) {
                this.etKtp.setText(uploadIdCardImage.idNumber);
            }
            if (!TextUtils.isEmpty(uploadIdCardImage.birthPlace)) {
                this.etBirthplace.setText(uploadIdCardImage.birthPlace);
            }
            if (!TextUtils.isEmpty(uploadIdCardImage.rtrw)) {
                this.etNeighborhoodCommittee.setText(uploadIdCardImage.rtrw);
            }
            LabelBean labelBean = uploadIdCardImage.religion;
            if (labelBean != null) {
                this.E = labelBean;
                this.tvReligion.setText(labelBean.label);
            }
            this.f58v = uploadIdCardImage.imgKey;
        }
    }

    public void f1(AuthInfoResponse authInfoResponse) {
        LabelBean labelBean;
        AuthInfoResponse.IdentityInfo identityInfo = authInfoResponse.body.identityInfo;
        if (!TextUtils.isEmpty(identityInfo.ktpImageUrl)) {
            Glide.with(this).load(identityInfo.ktpImageUrl).placeholder(R.drawable.lender_ic_ktp_capture).into(this.ivKtp);
            this.f58v = identityInfo.ktpImageKey;
        }
        if (E0(RealNameVerificationResponseV2.ErrorFields.IDENTITY_NUMBER)) {
            this.etKtp.requestFocus();
        } else {
            this.etKtp.setText(identityInfo.identityNumber);
        }
        if (E0(RealNameVerificationResponseV2.ErrorFields.NAME)) {
            this.etName.requestFocus();
        } else {
            this.etName.setText(identityInfo.name);
        }
        if (this.f59w) {
            Date date = new Date(identityInfo.expiryDate);
            this.J = date;
            this.tvKtpExpiryDate.setText(DateFormatUtil.d(date));
            this.etBirthplace.setText(identityInfo.birthPlace);
            if (!TextUtils.isEmpty(identityInfo.province)) {
                this.F = new LabelBean(identityInfo.province, "");
            }
            if (!TextUtils.isEmpty(identityInfo.city)) {
                this.G = new LabelBean(identityInfo.city, "");
            }
            if (!TextUtils.isEmpty(identityInfo.district)) {
                this.H = new LabelBean(identityInfo.district, "");
            }
            if (!TextUtils.isEmpty(identityInfo.village)) {
                this.I = new LabelBean(identityInfo.village, "");
            }
            LabelBean labelBean2 = this.F;
            if (labelBean2 != null && this.G != null && this.H != null && this.I != null) {
                this.tvAddress.setText(labelBean2.label + ", " + this.G.label + ", " + this.H.label + ", " + this.I.label);
            }
            this.etStreet.setText(identityInfo.street);
            this.etNeighborhoodCommittee.setText(identityInfo.rtrw);
            LabelBean labelBean3 = identityInfo.marryStatus;
            if (labelBean3 != null) {
                this.D = labelBean3;
                this.tvMaritalStatus.setText(labelBean3.label);
            }
            LabelBean labelBean4 = identityInfo.religion;
            if (labelBean4 != null) {
                this.E = labelBean4;
                this.tvReligion.setText(labelBean4.label);
            }
        }
        LabelBean labelBean5 = identityInfo.industry;
        if (labelBean5 != null && (labelBean = identityInfo.profession) != null) {
            this.O = labelBean5;
            this.P = labelBean;
            this.tvProfession.setText(this.O.label + " " + this.P.label);
        }
        LabelBean labelBean6 = identityInfo.monthlyIncome;
        if (labelBean6 != null) {
            this.M = labelBean6;
            this.tvMonthlyIncome.setText(labelBean6.label);
        }
        LabelBean labelBean7 = identityInfo.workExperience;
        if (labelBean7 != null) {
            this.N = labelBean7;
            this.tvWorkExperience.setText(labelBean7.label);
        }
        LabelBean labelBean8 = identityInfo.education;
        if (labelBean8 != null) {
            this.L = labelBean8;
            this.tvEducationLevel.setText(labelBean8.label);
        }
        LabelBean labelBean9 = identityInfo.sourceOfFund;
        if (labelBean9 != null) {
            this.K = labelBean9;
            this.tvSourceOfFund.setText(labelBean9.label);
        }
        if (E0(RealNameVerificationResponseV2.ErrorFields.EMAIL)) {
            this.etEmail.requestFocus();
        } else {
            this.etEmail.setText(identityInfo.email);
        }
    }

    public void g1(GetAuthOptionListInfoResponse getAuthOptionListInfoResponse, AuthOptionType authOptionType) {
        switch (AnonymousClass9.a[authOptionType.ordinal()]) {
            case 1:
                this.f60x.clear();
                this.f60x.addAll(getAuthOptionListInfoResponse.body);
                w0();
                break;
            case 2:
                this.y.clear();
                this.y.addAll(getAuthOptionListInfoResponse.body);
                x0();
                break;
            case 3:
                this.z.clear();
                this.z.addAll(getAuthOptionListInfoResponse.body);
                u0();
                break;
            case 4:
                this.A.clear();
                this.A.addAll(getAuthOptionListInfoResponse.body);
                y0();
                break;
            case 5:
                this.B.clear();
                this.B.addAll(getAuthOptionListInfoResponse.body);
                v0();
                break;
            case 6:
                this.C.clear();
                this.C.addAll(getAuthOptionListInfoResponse.body);
                z0();
                break;
        }
    }

    public void h1() {
        if (!F0()) {
            AuthHelper.f(this, new Runnable() {
                @Override
                public final void run() {
                    SubmitKtpActivity.this.a1();
                }
            });
        } else {
            startActivity(new Intent((Context) this, (Class<?>) EKycActivity.class));
            finish();
        }
    }

    private void i1(byte[] bArr) {
        Glide.with(this).load(bArr).override(180, 130).fitCenter().bitmapTransform(new Transformation[]{new GlideRoundTransform(this, 8, 0)}).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(this.ivKtp);
    }

    private void j1() {
        if (this.S) {
            setTitle(getString(R.string.lender_complete_profile_information));
            this.tvTipUploadKtp.setText(R.string.lender_click_to_upload_passport);
        } else {
            setTitle(getString(R.string.lender_label_submit_ktp));
            this.tvTipUploadKtp.setText(R.string.lender_click_to_upload_ktp);
        }
    }

    private void k1() {
        if (this.S) {
            this.ivKtp.setImageResource(R.drawable.lender_ic_passport_capture);
            this.llPassport.setVisibility(0);
            this.tvTipKtp.setVisibility(8);
            this.etKtp.setVisibility(8);
            this.vKtpLine.setVisibility(8);
            return;
        }
        this.ivKtp.setImageResource(R.drawable.lender_ic_ktp_capture);
        this.llPassport.setVisibility(8);
        this.tvTipKtp.setVisibility(0);
        this.etKtp.setVisibility(0);
        this.vKtpLine.setVisibility(0);
    }

    private void l1() {
        this.llRdlSupplement.setVisibility(this.f59w ? 0 : 8);
    }

    public void m1() {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).x().K(AndroidSchedulers.a()).a(new IdnObserver<LenderIndustryVocationResponse>(this) {
            public void onSuccess(LenderIndustryVocationResponse lenderIndustryVocationResponse) {
                SubmitKtpActivity.this.dismissLoadingDialog();
                SubmitKtpActivity.this.f57u.d(lenderIndustryVocationResponse.body);
                SubmitKtpActivity.this.f57u.f();
            }
        });
    }

    private void n1() {
        ((ILenderApiRoutes) this.apiHelper.a()).f0().a(new IdnObserver<AuthInfoResponse>(this) {
            public void onSuccess(AuthInfoResponse authInfoResponse) {
                SubmitKtpActivity.this.dismissLoadingDialog();
                SubmitKtpActivity.this.f1(authInfoResponse);
            }
        });
    }

    private void o1(HashMap<String, String> hashMap) {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).d0(hashMap).a(new IdnObserver<IdnBaseResult>(getCallBack()) {
            public void onSuccess(IdnBaseResult idnBaseResult) {
                SubmitKtpActivity.this.dismissLoadingDialog();
                SubmitKtpActivity.this.h1();
            }
        });
    }

    private void p1(HashMap<String, String> hashMap) {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).P0(hashMap).a(new IdnObserver<IdnBaseResult>(getCallBack()) {
            public void onSuccess(IdnBaseResult idnBaseResult) {
                SubmitKtpActivity.this.dismissLoadingDialog();
                SubmitKtpActivity.this.h1();
            }
        });
    }

    private void q1(final AuthOptionType authOptionType) {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).w(authOptionType.name()).a(new IdnObserver<GetAuthOptionListInfoResponse>(this) {
            public void onSuccess(GetAuthOptionListInfoResponse getAuthOptionListInfoResponse) {
                SubmitKtpActivity.this.dismissLoadingDialog();
                SubmitKtpActivity.this.g1(getAuthOptionListInfoResponse, authOptionType);
            }
        });
    }

    private void r1() {
        PickViewHelper.c(this, String.valueOf(this.tvKtpExpiryDate.getId()), new PickViewHelper.TimeSelectionCallBack() {
            @Override
            public final void b(View view, Date date) {
                SubmitKtpActivity.this.b1(view, date);
            }
        }, new FullScreenDialog.IFullScreenDialogInitCallBack() {
            @Override
            public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view, Object obj) {
                SubmitKtpActivity.c1(activity, fullScreenDialog, view, (TimePickerView) obj);
            }
        }).show();
    }

    private void s1() {
        this.permissionHelper.requestPermissions(this, new String[]{"android.permission.CAMERA"});
    }

    public static void startSubmitKtpActivity(Activity activity, ArrayList<String> arrayList) {
        Intent intent = new Intent(activity, (Class<?>) SubmitKtpActivity.class);
        intent.putStringArrayListExtra(INTENT_KEY_ERROR_FIELDS, arrayList);
        activity.startActivity(intent);
    }

    public static void startSubmitKtpActivityForRequest(Activity activity, Boolean bool, int i) {
        Intent intent = new Intent(activity, (Class<?>) SubmitKtpActivity.class);
        intent.putExtra("foreigner", bool);
        activity.startActivityForResult(intent, i);
    }

    private void u0() {
        PickViewHelper.f(this, PickViewHelper.b(this, this.z, "R2.id.tv_education_level", new PickViewHelper.SingleRowSelectionCallBack() {
            @Override
            public final void a(View view, Object obj) {
                SubmitKtpActivity.this.G0(view, (LabelBean) obj);
            }
        }), new FullScreenDialog.IFullScreenDialogInitCallBack() {
            @Override
            public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view, Object obj) {
                SubmitKtpActivity.this.H0(activity, fullScreenDialog, view, (OptionsPickerView) obj);
            }
        });
    }

    private void v0() {
        PickViewHelper.f(this, PickViewHelper.b(this, this.B, "R2.id.tv_monthly_income", new PickViewHelper.SingleRowSelectionCallBack() {
            @Override
            public final void a(View view, Object obj) {
                SubmitKtpActivity.this.I0(view, (LabelBean) obj);
            }
        }), new FullScreenDialog.IFullScreenDialogInitCallBack() {
            @Override
            public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view, Object obj) {
                SubmitKtpActivity.this.J0(activity, fullScreenDialog, view, (OptionsPickerView) obj);
            }
        });
    }

    private void w0() {
        PickViewHelper.f(this, PickViewHelper.b(this, this.f60x, "R2.id.tv_marital_status", new PickViewHelper.SingleRowSelectionCallBack<LabelBean>() {
            @Override
            public void a(View view, LabelBean labelBean) {
                SubmitKtpActivity.this.D = labelBean;
                SubmitKtpActivity submitKtpActivity = SubmitKtpActivity.this;
                submitKtpActivity.tvMaritalStatus.setText(submitKtpActivity.D.label);
            }
        }), new FullScreenDialog.IFullScreenDialogInitCallBack() {
            @Override
            public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view, Object obj) {
                SubmitKtpActivity.this.K0(activity, fullScreenDialog, view, (OptionsPickerView) obj);
            }
        });
    }

    private void x0() {
        PickViewHelper.f(this, PickViewHelper.b(this, this.y, "R2.id.tv_religion", new PickViewHelper.SingleRowSelectionCallBack<LabelBean>() {
            @Override
            public void a(View view, LabelBean labelBean) {
                SubmitKtpActivity.this.E = labelBean;
                SubmitKtpActivity submitKtpActivity = SubmitKtpActivity.this;
                submitKtpActivity.tvReligion.setText(submitKtpActivity.E.label);
            }
        }), new FullScreenDialog.IFullScreenDialogInitCallBack() {
            @Override
            public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view, Object obj) {
                SubmitKtpActivity.this.L0(activity, fullScreenDialog, view, (OptionsPickerView) obj);
            }
        });
    }

    private void y0() {
        PickViewHelper.f(this, PickViewHelper.b(this, this.A, "R2.id.tv_source_of_fund", new PickViewHelper.SingleRowSelectionCallBack() {
            @Override
            public final void a(View view, Object obj) {
                SubmitKtpActivity.this.M0(view, (LabelBean) obj);
            }
        }), new FullScreenDialog.IFullScreenDialogInitCallBack() {
            @Override
            public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view, Object obj) {
                SubmitKtpActivity.this.N0(activity, fullScreenDialog, view, (OptionsPickerView) obj);
            }
        });
    }

    private void z0() {
        PickViewHelper.f(this, PickViewHelper.b(this, this.C, "R2.id.tv_work_experience", new PickViewHelper.SingleRowSelectionCallBack() {
            @Override
            public final void a(View view, Object obj) {
                SubmitKtpActivity.this.O0(view, (LabelBean) obj);
            }
        }), new FullScreenDialog.IFullScreenDialogInitCallBack() {
            @Override
            public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view, Object obj) {
                SubmitKtpActivity.this.P0(activity, fullScreenDialog, view, (OptionsPickerView) obj);
            }
        });
    }

    @Override
    protected void A() {
        super.A();
        j1();
        k1();
        C0();
        this.etName.setFilters(new InputFilter[]{CharFilterForMeiZu.b(), new InputFilter.LengthFilter(60)});
        ThirdPartEventUtils.m(this.etName);
        ThirdPartEventUtils.m(this.etEmail);
        ThirdPartEventUtils.m(this.etBirthplace);
        ThirdPartEventUtils.m(this.etStreet);
        ThirdPartEventUtils.m(this.etNeighborhoodCommittee);
        l1();
        B0();
        A0();
    }

    @Override
    protected void G(@NonNull Bundle bundle) {
        super.G(bundle);
        bundle.putStringArrayList(INTENT_KEY_ERROR_FIELDS, this.errorFieldList);
        bundle.putBoolean("foreigner", this.S);
        bundle.putBoolean(this.U, this.T);
    }

    @PermissionDenied("android.permission.CAMERA")
    public void cameraPermissionDenied() {
        BaseUtils.p(this, getString(R.string.lender_permission_denied_camera));
    }

    @PermissionGranted({"android.permission.CAMERA"})
    public void carmeraPermissionGrant() {
        TakePhotoActivity.startTakeKTPActivityForResult(this, this.S);
    }

    @OnClick({5689})
    public void chooseKtpExpiryDate() {
        if (BaseUtils.l()) {
            return;
        }
        r1();
    }

    public void displaySelectAddressDlg() {
        if (D0()) {
            this.Q.j();
        }
        this.Q.show();
    }

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

    @Override
    protected void init() {
        super.init();
        if (!this.S) {
            this.f59w = AppGeneralConfigUtils.o().f(LenderConfigKey.IS_RDL_USER, Boolean.FALSE).booleanValue();
        } else {
            this.f59w = false;
            AppGeneralConfigUtils.o().u(LenderConfigKey.IS_RDL_USER, "false");
        }
    }

    @Override
    protected void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i != 32) {
            return;
        }
        if (i2 != -1) {
            if (i2 != 0) {
                return;
            }
            BaseUtils.p(u(), getString(R.string.lender_canceled));
        } else {
            byte[] b = BitmapBytesMap.a().b(intent.getStringExtra(TakePhotoActivity.BITMAP_BYTES_KEY));
            if (b == null || b.length == 0) {
                return;
            }
            e1(b, (UploadIdCardImage) intent.getParcelableExtra(TakePhotoActivity.UPLOAD_ID_CARD_IMAGE));
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (CollectionUtils.f(this.errorFieldList) && this.T) {
            this.T = false;
            s1();
        }
    }

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

    @OnClick({5567})
    public void showAddress(View view) {
        if (BaseUtils.l()) {
            return;
        }
        if (this.Q == null) {
            this.Q = new LenderBottomAddressDialog(this, getString(R.string.lender_address), false, false, new LenderBottomAddressDialog.CallBack() {
                @Override
                public final void a(LenderAddressSelectEvent lenderAddressSelectEvent) {
                    SubmitKtpActivity.this.d1(lenderAddressSelectEvent);
                }
            });
        }
        displaySelectAddressDlg();
    }

    @OnClick({5652})
    public void showEducationLevel() {
        if (BaseUtils.l()) {
            return;
        }
        if (CollectionUtils.f(this.z)) {
            q1(AuthOptionType.EDUCATION);
        } else {
            u0();
        }
    }

    @OnClick({5724})
    public void showMaritalStatus(View view) {
        if (BaseUtils.l()) {
            return;
        }
        if (CollectionUtils.f(this.f60x)) {
            q1(AuthOptionType.MARRY_STATUS);
        } else {
            w0();
        }
    }

    @OnClick({5743})
    public void showMonthlyIncome() {
        if (BaseUtils.l()) {
            return;
        }
        if (CollectionUtils.f(this.B)) {
            q1(AuthOptionType.MONTHLY_INCOME_RANGE);
        } else {
            v0();
        }
    }

    @OnClick({5812})
    public void showProfession() {
        if (BaseUtils.l()) {
            return;
        }
        this.f57u.c();
    }

    @OnClick({5832})
    public void showReligion(View view) {
        if (BaseUtils.l()) {
            return;
        }
        if (CollectionUtils.f(this.y)) {
            q1(AuthOptionType.RELIGION);
        } else {
            x0();
        }
    }

    @OnClick({5863})
    public void showSourceOfFund() {
        if (BaseUtils.l()) {
            return;
        }
        if (CollectionUtils.f(this.A)) {
            q1(AuthOptionType.SOURCE_OF_FUND);
        } else {
            y0();
        }
    }

    @OnClick({5940})
    public void showWorkExperience() {
        if (BaseUtils.l()) {
            return;
        }
        if (CollectionUtils.f(this.C)) {
            q1(AuthOptionType.WORK_EXPERIENCE);
        } else {
            z0();
        }
    }

    @OnClick({4714})
    protected void submitKtp() {
        if (BaseUtils.l()) {
            return;
        }
        ThirdPartEventUtils.y(this, "lender_verify_identityinfo_btn_submit");
        String trim = this.etName.getText().toString().trim();
        String trim2 = this.S ? this.etPassport.getText().toString().trim() : this.etKtp.getTrimmedText();
        String trim3 = this.etEmail.getText().toString().trim();
        String trim4 = this.etBirthplace.getText().toString().trim();
        String trim5 = this.etStreet.getText().toString().trim();
        String trim6 = this.etNeighborhoodCommittee.getText().toString().trim();
        if (TextUtils.isEmpty(this.f58v)) {
            String string = getString(R.string.lender_file_empty_toast);
            Object[] objArr = new Object[1];
            objArr[0] = getString(this.S ? R.string.lender_passport : R.string.ec_ktp);
            BaseUtils.p(this, MessageFormat.format(string, objArr));
            return;
        }
        if (TextUtils.isEmpty(trim)) {
            BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_name)));
            SmoothScrollUtils.a(this.tvTipName);
            showSoftInput(this.etName);
            return;
        }
        if (trim.matches(".*\\d.*")) {
            BaseUtils.o(this, R.string.ec_error_name_contains_number);
            SmoothScrollUtils.a(this.tvTipName);
            showSoftInput(this.etName);
            return;
        }
        if (this.S) {
            if (TextUtils.isEmpty(trim2)) {
                BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_passport)));
                SmoothScrollUtils.a(this.tvPassport);
                showSoftInput(this.etPassport);
                return;
            }
        } else if (TextUtils.isEmpty(trim2)) {
            BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.ec_ktp)));
            SmoothScrollUtils.a(this.tvTipKtp);
            showSoftInput(this.etKtp);
            return;
        } else if (!FieldRuleUtils.c(trim2)) {
            BaseUtils.o(this, R.string.lender_invalid_format_ktp);
            SmoothScrollUtils.a(this.tvTipKtp);
            showSoftInput(this.etKtp);
            return;
        }
        if (this.f59w) {
            if (this.J == null) {
                BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_ktp_expiry_date)));
                SmoothScrollUtils.a(this.tvKtpExpiryDateTitle);
                return;
            }
            if (TextUtils.isEmpty(trim4)) {
                BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_birthplace)));
                SmoothScrollUtils.a(this.tvBirthplace);
                showSoftInput(this.etBirthplace);
                return;
            }
            if (!D0()) {
                BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_address)));
                SmoothScrollUtils.a(this.tvAddressTitle);
                return;
            }
            if (TextUtils.isEmpty(trim5)) {
                BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_street)));
                SmoothScrollUtils.a(this.tvStreet);
                showSoftInput(this.etStreet);
                return;
            } else if (TextUtils.isEmpty(trim6)) {
                BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_neighborhood_committee)));
                SmoothScrollUtils.a(this.tvNeighborhoodCommittee);
                showSoftInput(this.etNeighborhoodCommittee);
                return;
            } else if (this.D == null) {
                BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.ec_marital_status)));
                SmoothScrollUtils.a(this.tvMaritalStatusTitle);
                return;
            } else if (this.E == null) {
                BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_religion)));
                SmoothScrollUtils.a(this.tvReligionTitle);
                return;
            }
        }
        if (this.O == null || this.P == null) {
            BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.industry_vocation)));
            SmoothScrollUtils.a(this.tvProfessionTitle);
            return;
        }
        if (this.M == null) {
            BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.ec_monthly_income)));
            SmoothScrollUtils.a(this.tvMonthlyIncomeTitle);
            return;
        }
        if (this.N == null) {
            BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_work_experience)));
            SmoothScrollUtils.a(this.tvWorkExperienceTitle);
            return;
        }
        if (this.L == null) {
            BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_education_level)));
            SmoothScrollUtils.a(this.tvEducationLevelTitle);
            return;
        }
        if (this.K == null) {
            BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.lender_source_of_fund)));
            SmoothScrollUtils.a(this.tvSourceOfFundTitle);
            return;
        }
        if (TextUtils.isEmpty(trim3)) {
            BaseUtils.p(this, MessageFormat.format(getString(R.string.lender_file_empty_toast), getString(R.string.ec_personal_email)));
            SmoothScrollUtils.a(this.tvEmail);
            showSoftInput(this.etEmail);
            return;
        }
        if (!FieldRuleUtils.b(trim3)) {
            BaseUtils.o(this, R.string.lender_email_format_error);
            SmoothScrollUtils.a(this.tvEmail);
            showSoftInput(this.etEmail);
            return;
        }
        HashMap hashMap = new HashMap();
        hashMap.put("imageKey", this.f58v);
        hashMap.put(AppMeasurementSdk.ConditionalUserProperty.NAME, trim);
        hashMap.put("identityNumber", trim2);
        hashMap.put(Scopes.EMAIL, trim3);
        hashMap.put("monthlyIncome", this.M.value);
        hashMap.put("workExperience", this.N.value);
        hashMap.put("education", this.L.value);
        hashMap.put("sourceOfFund", this.K.value);
        hashMap.put("industry", this.O.value);
        hashMap.put("profession", this.P.value);
        if (!this.f59w) {
            hashMap.put("foreigner", "" + this.S);
            o1(hashMap);
            return;
        }
        hashMap.put("expiryDate", DateFormatUtil.a(this.J));
        hashMap.put("birthPlace", trim4);
        hashMap.put("province", this.F.label);
        hashMap.put("district", this.H.label);
        hashMap.put("village", this.I.label);
        hashMap.put("street", trim5);
        hashMap.put("city", this.G.label);
        hashMap.put("marryStatus", this.D.value);
        hashMap.put("religion", this.E.value);
        hashMap.put("rtrw", trim6);
        p1(hashMap);
    }

    @OnClick({5033})
    protected void takeKtp() {
        if (BaseUtils.l()) {
            return;
        }
        ThirdPartEventUtils.y(this, "lender_verify_identity_btn_clickphoto");
        s1();
    }

    @Override
    protected void w() {
        super.w();
        if (CollectionUtils.f(this.errorFieldList)) {
            return;
        }
        showLoadingDialog();
        n1();
    }

    @Override
    protected void y(@NonNull Bundle bundle) {
        super.y(bundle);
        this.errorFieldList = bundle.getStringArrayList(INTENT_KEY_ERROR_FIELDS);
        this.S = bundle.getBoolean("foreigner", false);
        this.T = bundle.getBoolean(this.U, true);
    }

    @Override
    public void afterTextChanged(Editable editable) {
    }

    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }
}