导航菜单

页面标题

页面副标题

Easycash v3.75.13 - AddressLocationInfoNewActivity.java 源代码

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

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


package com.lingyue.easycash.authentication.addresslocation;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.DigitsKeyListener;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.OnClick;
import com.google.android.material.imageview.ShapeableImageView;
import com.lingyue.easycash.AuthUtils;
import com.lingyue.easycash.R;
import com.lingyue.easycash.adapters.AssociatedEmailAdapter;
import com.lingyue.easycash.adapters.AuthStepAdapter;
import com.lingyue.easycash.adapters.LinearVerticalDecoration;
import com.lingyue.easycash.appconfig.GeneralConfigDataRepository;
import com.lingyue.easycash.authentication.AuthBusinessProcessor;
import com.lingyue.easycash.commom.EasyCashCommonActivity;
import com.lingyue.easycash.models.AppInfo;
import com.lingyue.easycash.models.AwardStepType;
import com.lingyue.easycash.models.ContactInfoRequest;
import com.lingyue.easycash.models.ImmediateContactBean;
import com.lingyue.easycash.models.LabelBean;
import com.lingyue.easycash.models.address.ContactInfoResponse;
import com.lingyue.easycash.models.address.LabelBeanListResponse;
import com.lingyue.easycash.models.enums.AuthOptionType;
import com.lingyue.easycash.models.enums.EventErrorCode;
import com.lingyue.easycash.models.enums.EventStep;
import com.lingyue.easycash.models.event.AddressSelectEvent;
import com.lingyue.easycash.models.response.RelationShipResponse;
import com.lingyue.easycash.models.survey.UserSatisfactionSurveyScene;
import com.lingyue.easycash.net.EasyCashResponseCode;
import com.lingyue.easycash.utils.AuthBackTipsDialogUtil;
import com.lingyue.easycash.utils.EasycashUmengEvent;
import com.lingyue.easycash.utils.GiftAwardOperationUtil;
import com.lingyue.easycash.utils.SensorTrackEvent;
import com.lingyue.easycash.utils.applist.ALScene;
import com.lingyue.easycash.utils.applist.AppListCallBack;
import com.lingyue.easycash.utils.applist.AppListUtils;
import com.lingyue.easycash.widght.AuthGeneralView;
import com.lingyue.easycash.widght.AuthGeneralViewV2;
import com.lingyue.easycash.widght.BaseAuthGeneralView;
import com.lingyue.easycash.widght.CustomPopupWindow;
import com.lingyue.easycash.widght.EasycashSingleButtonDialog;
import com.lingyue.easycash.widght.bottomDialog.EasyCashBottomAddressDialog;
import com.lingyue.easycash.widght.selectLabelBeanView.SingleRowSelectCompanion;
import com.lingyue.easycash.widght.survey.ECSurveyUtils;
import com.lingyue.idnbaselib.SentryTransactionConstants;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.IdnBaseResult;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.model.MediaRegisterAwardResponse;
import com.lingyue.idnbaselib.model.response.BooleanResponse;
import com.lingyue.idnbaselib.sentrybusiness.ISentryBusinessEventAutoFinish;
import com.lingyue.idnbaselib.utils.DevUtil;
import com.lingyue.idnbaselib.utils.FieldRuleUtils;
import com.lingyue.idnbaselib.utils.JsonParamsBuilder;
import com.lingyue.idnbaselib.utils.SmoothScrollUtils;
import com.lingyue.idnbaselib.utils.TextViewUtil;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
import com.lingyue.idnbaselib.widget.OnItemClickListener;
import com.lingyue.idnbaselib.widget.SelectorLinkage;
import com.lingyue.supertoolkit.phonetools.ScreenUtils;
import com.lingyue.supertoolkit.resourcetools.SharedPreferenceUtils;
import com.lingyue.supertoolkit.screen.IScreenShotProtectPage;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.lingyue.supertoolkit.widgets.CharFilterForMeiZu;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.umeng.analytics.pro.bg;
import com.veda.android.bananalibrary.infrastructure.Logger;
import com.veda.android.imageloaderlib.IImageLoader;
import com.veda.android.imageloaderlib.Imager;
import com.yangqianguan.statistics.AutoTrackHelper;
import cz.msebera.android.httpclient.HttpStatus;
import io.reactivex.Flowable;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Predicate;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.subjects.PublishSubject;
import io.sentry.ITransaction;
import io.sentry.Sentry;
import io.sentry.SpanStatus;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;

public class AddressLocationInfoNewActivity extends EasyCashCommonActivity implements ISentryBusinessEventAutoFinish, IScreenShotProtectPage {
    private String A0;
    private ITransaction B0;
    private SingleRowSelectCompanion C;
    private SingleRowSelectCompanion D;
    private SingleRowSelectCompanion E;
    private SingleRowSelectCompanion F;
    private SingleRowSelectCompanion G;
    private LabelBean H;
    private LabelBean I;
    private LabelBean J;
    private LabelBean K;
    private LabelBean L;
    private LabelBean M;
    private LabelBean N;
    private LabelBean O;
    private LabelBean P;
    private List<AppInfo> Q;
    EasyCashBottomAddressDialog S;
    private ECSurveyUtils U;
    private CustomPopupWindow X;
    private PublishSubject<String> Z;

    private TextWatcher f11a0;

    @BindView(R.id.agv_education)
    AuthGeneralView agvEducation;

    @BindView(R.id.agv_first_name)
    AuthGeneralView agvFirstName;

    @BindView(R.id.agv_first_phone_number)
    AuthGeneralViewV2 agvFirstPhoneNumber;

    @BindView(R.id.agv_first_relation)
    AuthGeneralView agvFirstRelation;

    @BindView(R.id.agv_house_type)
    AuthGeneralView agvHouseType;

    @BindView(R.id.agv_live_address_city)
    AuthGeneralView agvLiveAddressCity;

    @BindView(R.id.agv_marital_status)
    AuthGeneralView agvMaritalStatus;

    @BindView(R.id.agv_personal_email)
    AuthGeneralView agvPersonalEmail;

    @BindView(R.id.agv_second_name)
    AuthGeneralView agvSecondName;

    @BindView(R.id.agv_second_phone_number)
    AuthGeneralViewV2 agvSecondPhoneNumber;

    @BindView(R.id.agv_second_relation)
    AuthGeneralView agvSecondRelation;

    @BindView(R.id.agv_street)
    AuthGeneralView agvStreet;

    private String f12b0;

    private RecyclerView f13c0;

    private AssociatedEmailAdapter f14d0;

    private ViewTreeObserver.OnGlobalLayoutListener f16f0;

    private AddressSelectEvent f17g0;

    private String f18h0;

    private String f19i0;

    private String f20j0;

    private String f21k0;

    @BindView(R.id.rl_award_content)
    RelativeLayout rlAwardContent;

    @BindView(R.id.rv_auth)
    RecyclerView rvAuth;

    @BindView(2131363222)
    NestedScrollView scrollView;

    @BindView(R.id.siv_award_content)
    ShapeableImageView sivAwardContent;

    @BindView(R.id.tv_award_content)
    TextView tvAwardContent;

    @BindView(R.id.v_emergency_contact_tip)
    View vEmergencyContactTip;
    private String z0;
    private final String B = "firstShowEmergencyContactWarningTip";
    private SelectorLinkage R = new SelectorLinkage();
    private boolean T = false;
    private final String V = "gmail.com";
    private final String W = "yahoo.com";
    private List<String> Y = new ArrayList();

    private int[] f15e0 = {Integer.MAX_VALUE, Integer.MAX_VALUE};

    static class AnonymousClass15 {
        static final int[] a;

        static {
            int[] iArr = new int[AuthOptionType.values().length];
            a = iArr;
            try {
                iArr[AuthOptionType.EDUCATION.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[AuthOptionType.HOUSE_TYPE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
        }
    }

    public void A1(View view) {
        if (this.N == null) {
            B2(view);
            this.agvEducation.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.z1();
                }
            }, 500L);
        }
    }

    public void A2(String str) {
        boolean z2;
        if (TextUtils.isEmpty(str)) {
            u2();
            return;
        }
        int indexOf = str.indexOf("@");
        if (indexOf == -1) {
            u2();
            return;
        }
        boolean z3 = true;
        String substring = str.substring(indexOf + 1);
        if (TextUtils.isEmpty(substring)) {
            z2 = true;
        } else {
            if (t1(substring, "gmail.com")) {
                z2 = true;
            } else if (t1(substring, "yahoo.com")) {
                z2 = false;
            } else {
                z2 = false;
            }
            z3 = false;
        }
        if (!z3 && !z2) {
            u2();
            return;
        }
        this.Y.clear();
        if (z2) {
            this.Y.add(compareEmail(substring, "gmail.com"));
        }
        if (z3) {
            this.Y.add(compareEmail(substring, "yahoo.com"));
        }
        this.f14d0.notifyDataSetChanged();
        this.X.f(this.agvPersonalEmail.getEtContent(), 0, (int) BaseUtils.a(-22.0f, this));
    }

    public void B1() {
        this.C.d();
    }

    public void C1(View view) {
        if (this.P == null) {
            B2(view);
            this.agvMaritalStatus.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.B1();
                }
            }, 500L);
        }
    }

    public void C2(String str) {
        this.Z.onNext(str);
    }

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

    private void D2(String str) {
        ThirdPartEventUtils.D(this, EasycashUmengEvent.o3, new JsonParamsBuilder().d("email_error_input_content").a(this.agvPersonalEmail.getEtContent().getText().toString()).c());
        this.B0.a("errorCode", "2004");
        this.B0.a("errorMessage", str);
        this.B0.o(SpanStatus.INTERNAL_ERROR);
        logNextStepResult(this.B0.getName(), "2004", str);
    }

    @SensorsDataInstrumented
    public void E1(View view) {
        this.D.d();
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    private void E2(EventStep eventStep, EventErrorCode eventErrorCode, String str) {
        ThirdPartEventUtils.D(this, EasycashUmengEvent.w3, new JsonParamsBuilder().d("step").a(eventStep.name().toLowerCase()).d("errorCode").a(eventErrorCode.name().toLowerCase()).d("errorMessage").a(str).c());
        this.B0.a("errorCode", "2004");
        this.B0.a("errorMessage", str);
        this.B0.o(SpanStatus.INTERNAL_ERROR);
        logNextStepResult(this.B0.getName(), "2004", str);
    }

    @SensorsDataInstrumented
    public void F1(View view) {
        this.E.d();
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    private void F2() {
        if (this.userSession.f().authLivingAddressReturn) {
            this.apiHelper.a().O1().K(AndroidSchedulers.a()).a(new IdnObserver<ContactInfoResponse>(this) {
                @Override
                public void onSuccess(ContactInfoResponse contactInfoResponse) {
                    ContactInfoResponse.Body body = contactInfoResponse.body;
                    if (body == null || TextUtils.isEmpty(body.livingAddress)) {
                        return;
                    }
                    AddressLocationInfoNewActivity.this.agvStreet.setInputText(contactInfoResponse.body.livingAddress);
                }
            });
        }
    }

    @SensorsDataInstrumented
    public void G1(View view) {
        this.C.d();
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    private void G2() {
        if (this.userSession.f().isSubsequentGainAuthSwitch) {
            duringActive((Flowable) GeneralConfigDataRepository.d().c(), false).C(new Predicate() {
                public final boolean test(Object obj) {
                    boolean a2;
                    a2 = AddressLocationInfoNewActivity.a2((Integer) obj);
                    return a2;
                }
            }).o0(1L).l0(Schedulers.c()).Q(AndroidSchedulers.a()).g0(new Consumer() {
                public final void accept(Object obj) {
                    AddressLocationInfoNewActivity.this.c2((Integer) obj);
                }
            }, new Consumer() {
                public final void accept(Object obj) {
                    DevUtil.a((Throwable) obj);
                }
            });
        }
    }

    @SensorsDataInstrumented
    public void H1(View view) {
        this.F.d();
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    private boolean H2(Runnable runnable) {
        ECSurveyUtils eCSurveyUtils = this.U;
        if (eCSurveyUtils != null) {
            return eCSurveyUtils.y(runnable);
        }
        return false;
    }

    @SensorsDataInstrumented
    public void I1(View view) {
        this.G.d();
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    public String J1(String str) {
        return !TextUtils.isEmpty(str) ? (TextUtils.isEmpty(str) || !FieldRuleUtils.b(str)) ? getString(R.string.easycash_email_format_error) : "" : "";
    }

    public String K1(String str) {
        int codePointCount = str.codePointCount(0, str.length());
        return this.userSession.f().authLivingAddressCheck ? (TextUtils.isEmpty(str) || (FieldRuleUtils.a(str) && codePointCount >= 6)) ? "" : getString(R.string.easycash_enter_correct_address_detail) : (TextUtils.isEmpty(str) || codePointCount >= 6) ? "" : getString(R.string.easycash_address_detail_hint);
    }

    @SensorsDataInstrumented
    public void L1(View view) {
        if (BaseUtils.l()) {
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
            return;
        }
        openCustomerService();
        ThirdPartEventUtils.t("auth_contact_csc_click");
        logSensorEvent(SensorTrackEvent.EC_ADDRESS_LOCATION_INFO_CSC_CLICK);
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    public void N1() {
        this.E.d();
    }

    public void O1() {
        this.D.d();
    }

    public void P1() {
        this.C.d();
    }

    public void Q1() {
        this.F.d();
    }

    public void R1() {
        this.G.d();
    }

    public static boolean S1(String str) throws Exception {
        return str.length() > 0;
    }

    public boolean T1(String str) throws Exception {
        return this.agvPersonalEmail.getEtContent().hasFocus();
    }

    public void U1(View view) {
        int visibleAreaBottom = getVisibleAreaBottom(view);
        int[] iArr = this.f15e0;
        int i = iArr[0];
        if (i == Integer.MAX_VALUE) {
            iArr[0] = visibleAreaBottom;
            return;
        }
        if (iArr[1] != Integer.MAX_VALUE) {
            view.getViewTreeObserver().removeOnGlobalLayoutListener(this.f16f0);
        } else if (visibleAreaBottom != i) {
            iArr[1] = visibleAreaBottom;
            if (this.agvPersonalEmail.getEtContent().hasFocus()) {
                c1();
            }
            view.getViewTreeObserver().removeOnGlobalLayoutListener(this.f16f0);
        }
    }

    public void V1(View view, int i, String str) {
        f2(str);
        AutoTrackHelper.trackRecyclerViewItemOnClick(view, i, str);
    }

    public String W1() {
        return this.f12b0;
    }

    public static String X1(String str) {
        String replaceAll = str.replaceAll("\\D", "");
        return replaceAll.length() > 4 ? replaceAll.replaceAll("(\\d{4})(?=\\d)", "$1 ") : replaceAll;
    }

    public String Y1(String str) {
        return (TextUtils.isEmpty(str) || FieldRuleUtils.f(str)) ? "" : getString(R.string.easycash_phone_number_check_tip);
    }

    @SensorsDataInstrumented
    public void Z1(int i, View view) {
        clickContact(i);
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
        AutoTrackHelper.trackViewOnClick(view);
    }

    public static boolean a2(Integer num) throws Exception {
        return num.intValue() == 16;
    }

    private void b1(final BaseAuthGeneralView baseAuthGeneralView) {
        if (baseAuthGeneralView == null) {
            return;
        }
        baseAuthGeneralView.setOnFocusListener(new BaseAuthGeneralView.OnFocusListener() {
            @Override
            public final void a() {
                AddressLocationInfoNewActivity.this.v1(baseAuthGeneralView);
            }
        });
    }

    public void c1() {
        int i;
        int[] iArr = new int[2];
        EditText etContent = this.agvPersonalEmail.getEtContent();
        etContent.getLocationOnScreen(iArr);
        int height = iArr[1] + etContent.getHeight();
        int e1 = e1();
        if (e1 != -1 && (i = e1 - height) < 300) {
            this.scrollView.smoothScrollBy(0, HttpStatus.SC_MULTIPLE_CHOICES - i);
        }
    }

    public void c2(Integer num) throws Exception {
        p1();
        this.S = new EasyCashBottomAddressDialog(this, getString(R.string.easycash_live_city), new EasyCashBottomAddressDialog.CallBack() {
            @Override
            public final void a(AddressSelectEvent addressSelectEvent) {
                AddressLocationInfoNewActivity.this.b2(addressSelectEvent);
            }
        });
        o2(this.agvFirstName);
        o2(this.agvSecondName);
        this.T = this.userSession.f().authCollectEmail;
        i1();
        F2();
        q1();
    }

    public static String compareEmail(String str, String str2) {
        if (str2 == null || str == null || str2.length() < str.length()) {
            return "";
        }
        int i = 0;
        while (i < str.length() && str2.charAt(i) == str.charAt(i)) {
            i++;
        }
        return str2.substring(i);
    }

    private void d1() {
        this.R.a(this.agvHouseType, new SelectorLinkage.Task() {
            @Override
            public final void a(View view) {
                AddressLocationInfoNewActivity.this.y1(view);
            }
        });
        this.R.a(this.agvEducation, new SelectorLinkage.Task() {
            @Override
            public final void a(View view) {
                AddressLocationInfoNewActivity.this.A1(view);
            }
        });
        this.R.a(this.agvMaritalStatus, new SelectorLinkage.Task() {
            @Override
            public final void a(View view) {
                AddressLocationInfoNewActivity.this.C1(view);
            }
        });
        this.R.b();
    }

    private int e1() {
        int i;
        int[] iArr = this.f15e0;
        int i2 = iArr[0];
        if (i2 == Integer.MAX_VALUE || (i = iArr[1]) == Integer.MAX_VALUE) {
            return -1;
        }
        return Math.min(i2, i);
    }

    private void e2() {
        this.authUtil.T(this, new AuthUtils.DefaultAuthCallBack(this));
    }

    private void f1() {
        if (this.userSession.b().canEnterMinimaListProcess) {
            this.rvAuth.setVisibility(8);
            return;
        }
        this.rvAuth.setAdapter(new AuthStepAdapter(this, this.authUtil.y(), this.authUtil.z()));
        this.rvAuth.setVisibility(0);
    }

    private void f2(String str) {
        u2();
        this.agvPersonalEmail.getEtContent().removeTextChangedListener(this.f11a0);
        this.agvPersonalEmail.getEtContent().setText(this.f12b0 + str);
        this.agvPersonalEmail.getEtContent().setSelection(this.agvPersonalEmail.getEtContent().getText().length());
        this.agvPersonalEmail.getEtContent().addTextChangedListener(this.f11a0);
    }

    private void g1() {
        this.agvLiveAddressCity.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AddressLocationInfoNewActivity.this.D1(view);
            }
        });
        this.agvEducation.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AddressLocationInfoNewActivity.this.E1(view);
            }
        });
        this.agvHouseType.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AddressLocationInfoNewActivity.this.F1(view);
            }
        });
        this.agvMaritalStatus.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AddressLocationInfoNewActivity.this.G1(view);
            }
        });
        this.agvFirstRelation.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AddressLocationInfoNewActivity.this.H1(view);
            }
        });
        this.agvSecondRelation.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AddressLocationInfoNewActivity.this.I1(view);
            }
        });
    }

    private void g2() {
        if (this.J == null) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_choose_live_city));
            SmoothScrollUtils.c(this.scrollView, this.agvLiveAddressCity);
            displaySelectAddressDlg();
            E2(EventStep.ADDRESS_CITY_RESIDENCE_CHECK, EventErrorCode.EMPTY, getString(R.string.please_choose_live_city));
            return;
        }
        if (this.K == null) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_choose_live_city));
            SmoothScrollUtils.c(this.scrollView, this.agvLiveAddressCity);
            displaySelectAddressDlg();
            E2(EventStep.ADDRESS_CITY_RESIDENCE_CHECK, EventErrorCode.EMPTY, getString(R.string.please_choose_live_city));
            return;
        }
        if (this.L == null) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_choose_live_city));
            SmoothScrollUtils.c(this.scrollView, this.agvLiveAddressCity);
            displaySelectAddressDlg();
            E2(EventStep.ADDRESS_CITY_RESIDENCE_CHECK, EventErrorCode.EMPTY, getString(R.string.please_choose_live_city));
            return;
        }
        if (this.M == null) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_choose_live_city));
            SmoothScrollUtils.c(this.scrollView, this.agvLiveAddressCity);
            displaySelectAddressDlg();
            E2(EventStep.ADDRESS_CITY_RESIDENCE_CHECK, EventErrorCode.EMPTY, getString(R.string.please_choose_live_city));
            return;
        }
        if (this.agvStreet.getEtContent().getText() == null || TextUtils.isEmpty(this.agvStreet.getEtContent().getText().toString().trim())) {
            BaseUtils.p(this, getString(R.string.please_input_street));
            SmoothScrollUtils.c(this.scrollView, this.agvStreet);
            showSoftInput(this.agvStreet.getEtContent());
            E2(EventStep.ADDRESS_STREET_CHECK, EventErrorCode.EMPTY, getString(R.string.please_input_street));
            return;
        }
        String trim = this.agvStreet.getEtContent().getText().toString().trim();
        if (this.userSession.f().authLivingAddressCheck) {
            if (!FieldRuleUtils.a(trim) || trim.length() < 6) {
                BaseUtils.p(this, getString(R.string.easycash_enter_correct_address_detail));
                SmoothScrollUtils.c(this.scrollView, this.agvStreet);
                showSoftInput(this.agvStreet.getEtContent());
                E2(EventStep.ADDRESS_STREET_CHECK, EventErrorCode.FORMAT_ERROR, getString(R.string.easycash_enter_correct_address_detail));
                return;
            }
        } else if (trim.length() < 6) {
            BaseUtils.p(this, getString(R.string.easycash_address_detail_hint));
            SmoothScrollUtils.c(this.scrollView, this.agvStreet);
            showSoftInput(this.agvStreet.getEtContent());
            E2(EventStep.ADDRESS_STREET_CHECK, EventErrorCode.FORMAT_ERROR, getString(R.string.easycash_address_detail_hint));
            return;
        }
        if (this.T) {
            if (TextUtils.isEmpty(this.agvPersonalEmail.getEtContent().getText().toString().trim())) {
                BaseUtils.p(this, getResources().getString(R.string.easycash_input_personal_email));
                SmoothScrollUtils.c(this.scrollView, this.agvPersonalEmail);
                showSoftInput(this.agvPersonalEmail.getEtContent());
                D2(getResources().getString(R.string.easycash_input_personal_email));
                return;
            }
            if (!FieldRuleUtils.b(this.agvPersonalEmail.getEtContent().getText().toString().trim())) {
                BaseUtils.p(this, getResources().getString(R.string.easycash_email_format_error));
                SmoothScrollUtils.c(this.scrollView, this.agvPersonalEmail);
                showSoftInput(this.agvPersonalEmail.getEtContent());
                D2(getResources().getString(R.string.easycash_email_format_error));
                return;
            }
        }
        if (this.O == null) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_choose_house_ownership));
            SmoothScrollUtils.c(this.scrollView, this.agvHouseType);
            this.agvHouseType.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.N1();
                }
            }, 500L);
            E2(EventStep.ADDRESS_HOUSE_OWNERSHIP_CHECK, EventErrorCode.EMPTY, getString(R.string.please_choose_house_ownership));
            return;
        }
        if (this.N == null) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_choose_education_info));
            SmoothScrollUtils.c(this.scrollView, this.agvEducation);
            this.agvEducation.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.O1();
                }
            }, 500L);
            E2(EventStep.ADDRESS_EDUCATION_INFO_CHECK, EventErrorCode.EMPTY, getString(R.string.please_choose_education_info));
            return;
        }
        if (this.P == null) {
            BaseUtils.p(this, getString(R.string.please_select_marry_status));
            SmoothScrollUtils.c(this.scrollView, this.agvMaritalStatus);
            this.agvMaritalStatus.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.P1();
                }
            }, 500L);
            E2(EventStep.ADDRESS_MARITAL_STATUS_CHECK, EventErrorCode.EMPTY, getString(R.string.please_select_marry_status));
            return;
        }
        if (this.H == null) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_input_contacts_relationship));
            SmoothScrollUtils.c(this.scrollView, this.agvFirstRelation);
            this.agvFirstRelation.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.Q1();
                }
            }, 500L);
            E2(EventStep.ADDRESS_CONTACTS_RELATIONSHIP_CHECK_ONE, EventErrorCode.EMPTY, getString(R.string.please_input_contacts_relationship));
            return;
        }
        if (this.agvFirstName.getEtContent().getText() == null || TextUtils.isEmpty(this.agvFirstName.getEtContent().getText().toString().trim())) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_input_name));
            SmoothScrollUtils.c(this.scrollView, this.agvFirstName);
            showSoftInput(this.agvFirstName.getEtContent());
            E2(EventStep.ADDRESS_NAME_RELATIONSHIP_CHECK_ONE, EventErrorCode.EMPTY, getString(R.string.please_input_name));
            return;
        }
        if (TextUtils.isEmpty(this.agvFirstPhoneNumber.getTrimmedText())) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_input_emergency_contact_phone_number));
            SmoothScrollUtils.c(this.scrollView, this.agvFirstPhoneNumber);
            showSoftInput(this.agvFirstPhoneNumber.getEtContent());
            E2(EventStep.ADDRESS_PHONE_RELATIONSHIP_CHECK_ONE, EventErrorCode.EMPTY, getString(R.string.please_input_emergency_contact_phone_number));
            return;
        }
        if (!FieldRuleUtils.f(this.agvFirstPhoneNumber.getTrimmedText())) {
            BaseUtils.p(getApplicationContext(), getString(R.string.easycash_phone_number_check_tip));
            SmoothScrollUtils.c(this.scrollView, this.agvFirstPhoneNumber);
            showSoftInput(this.agvFirstPhoneNumber.getEtContent());
            E2(EventStep.ADDRESS_PHONE_RELATIONSHIP_CHECK_ONE, EventErrorCode.FORMAT_ERROR, getString(R.string.easycash_phone_number_check_tip));
            return;
        }
        m2(this.agvFirstPhoneNumber.getEtContent());
        if (this.I == null) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_input_contacts_relationship));
            SmoothScrollUtils.c(this.scrollView, this.agvSecondRelation);
            this.agvSecondRelation.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.R1();
                }
            }, 500L);
            E2(EventStep.ADDRESS_CONTACTS_RELATIONSHIP_CHECK_TWO, EventErrorCode.EMPTY, getString(R.string.please_input_contacts_relationship));
            return;
        }
        if (this.agvSecondName.getEtContent().getText() == null || TextUtils.isEmpty(this.agvSecondName.getEtContent().getText().toString().trim())) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_input_name));
            SmoothScrollUtils.c(this.scrollView, this.agvSecondName);
            showSoftInput(this.agvSecondName.getEtContent());
            E2(EventStep.ADDRESS_NAME_RELATIONSHIP_CHECK_TWO, EventErrorCode.EMPTY, getString(R.string.please_input_name));
            return;
        }
        if (TextUtils.isEmpty(this.agvSecondPhoneNumber.getTrimmedText())) {
            BaseUtils.p(getApplicationContext(), getString(R.string.please_input_emergency_contact_phone_number));
            SmoothScrollUtils.c(this.scrollView, this.agvSecondPhoneNumber);
            showSoftInput(this.agvSecondPhoneNumber.getEtContent());
            E2(EventStep.ADDRESS_PHONE_RELATIONSHIP_CHECK_TWO, EventErrorCode.EMPTY, getString(R.string.please_input_emergency_contact_phone_number));
            return;
        }
        if (FieldRuleUtils.f(this.agvSecondPhoneNumber.getTrimmedText())) {
            m2(this.agvSecondPhoneNumber.getEtContent());
            l2();
            x2();
        } else {
            BaseUtils.p(getApplicationContext(), getString(R.string.easycash_phone_number_check_tip));
            SmoothScrollUtils.c(this.scrollView, this.agvSecondPhoneNumber);
            showSoftInput(this.agvSecondPhoneNumber.getEtContent());
            E2(EventStep.ADDRESS_PHONE_RELATIONSHIP_CHECK_TWO, EventErrorCode.FORMAT_ERROR, getString(R.string.easycash_phone_number_check_tip));
        }
    }

    private void h1() {
        this.D.f(new SingleRowSelectCompanion.SingleRowSelectViewListener() {
            @Override
            public void a() {
                AddressLocationInfoNewActivity.this.v2(AuthOptionType.EDUCATION);
            }

            @Override
            public void c() {
                AddressLocationInfoNewActivity.this.logAuthWorkPickerExpose(SentryTransactionConstants.AuthContactPickerType.EDUCATION);
            }

            @Override
            public void d(View view, LabelBean labelBean) {
                AddressLocationInfoNewActivity.this.N = labelBean;
                AddressLocationInfoNewActivity addressLocationInfoNewActivity = AddressLocationInfoNewActivity.this;
                addressLocationInfoNewActivity.agvEducation.setContentText(addressLocationInfoNewActivity.N.label);
                AddressLocationInfoNewActivity.this.R.c(AddressLocationInfoNewActivity.this.agvEducation);
            }
        });
    }

    private void h2() {
        this.f11a0 = new TextWatcher() {
            @Override
            public void afterTextChanged(Editable editable) {
                if (editable.toString().trim().isEmpty()) {
                    AddressLocationInfoNewActivity.this.u2();
                    return;
                }
                AddressLocationInfoNewActivity.this.f12b0 = editable.toString();
                AddressLocationInfoNewActivity.this.C2(editable.toString());
            }

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

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }
        };
        this.agvPersonalEmail.getEtContent().addTextChangedListener(this.f11a0);
        PublishSubject<String> r0 = PublishSubject.r0();
        this.Z = r0;
        r0.o(200L, TimeUnit.MILLISECONDS).v(new Predicate() {
            public final boolean test(Object obj) {
                boolean S1;
                S1 = AddressLocationInfoNewActivity.S1((String) obj);
                return S1;
            }
        }).K(AndroidSchedulers.a()).v(new Predicate() {
            public final boolean test(Object obj) {
                boolean T1;
                T1 = AddressLocationInfoNewActivity.this.T1((String) obj);
                return T1;
            }
        }).a(new Observer<String>() {
            public void onNext(String str) {
                AddressLocationInfoNewActivity.this.A2(str);
            }

            public void onSubscribe(Disposable disposable) {
                AddressLocationInfoNewActivity.this.addCompositeDisposable(disposable);
            }

            public void onError(Throwable th) {
            }

            public void onComplete() {
            }
        });
    }

    private void i1() {
        this.agvPersonalEmail.setVisibility(this.T ? 0 : 8);
        if (this.T) {
            this.agvPersonalEmail.setCallBack(new BaseAuthGeneralView.CallBack() {
                @Override
                public final String a(String str) {
                    String J1;
                    J1 = AddressLocationInfoNewActivity.this.J1(str);
                    return J1;
                }
            });
            n2();
            h2();
            j2();
        }
    }

    public void i2(RelationShipResponse relationShipResponse, boolean z2) {
        dismissLoadingDialog();
        if (z2) {
            this.F.e(relationShipResponse.body.first);
            this.F.h();
        } else {
            this.G.e(relationShipResponse.body.second);
            this.G.h();
        }
    }

    private void j1() {
        this.F.f(new SingleRowSelectCompanion.SingleRowSelectViewListener() {
            @Override
            public void a() {
                AddressLocationInfoNewActivity.this.w2(true);
            }

            @Override
            public void c() {
                AddressLocationInfoNewActivity.this.logAuthWorkPickerExpose(SentryTransactionConstants.AuthContactPickerType.FIRST_RELATION);
            }

            @Override
            public void d(View view, LabelBean labelBean) {
                AddressLocationInfoNewActivity.this.H = labelBean;
                AddressLocationInfoNewActivity addressLocationInfoNewActivity = AddressLocationInfoNewActivity.this;
                addressLocationInfoNewActivity.agvFirstRelation.setContentText(addressLocationInfoNewActivity.H.label);
            }
        });
    }

    private void j2() {
        final View rootView = getWindow().getDecorView().getRootView();
        this.f16f0 = new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public final void onGlobalLayout() {
                AddressLocationInfoNewActivity.this.U1(rootView);
            }
        };
        rootView.getViewTreeObserver().addOnGlobalLayoutListener(this.f16f0);
        this.agvPersonalEmail.setOnFocusListener(new BaseAuthGeneralView.OnFocusListener() {
            @Override
            public final void a() {
                AddressLocationInfoNewActivity.this.c1();
            }
        });
    }

    private void k1() {
        b1(this.agvFirstName);
        b1(this.agvFirstPhoneNumber);
        b1(this.agvSecondName);
        b1(this.agvSecondPhoneNumber);
    }

    public void k2() {
        dismissLoadingDialog();
        e2();
    }

    private void l1() {
        this.E.f(new SingleRowSelectCompanion.SingleRowSelectViewListener() {
            @Override
            public void a() {
                AddressLocationInfoNewActivity.this.v2(AuthOptionType.HOUSE_TYPE);
            }

            @Override
            public void c() {
                AddressLocationInfoNewActivity.this.logAuthWorkPickerExpose(SentryTransactionConstants.AuthContactPickerType.HOUSE_TYPE);
            }

            @Override
            public void d(View view, LabelBean labelBean) {
                AddressLocationInfoNewActivity.this.O = labelBean;
                AddressLocationInfoNewActivity addressLocationInfoNewActivity = AddressLocationInfoNewActivity.this;
                addressLocationInfoNewActivity.agvHouseType.setContentText(addressLocationInfoNewActivity.O.label);
                AddressLocationInfoNewActivity.this.R.c(AddressLocationInfoNewActivity.this.agvHouseType);
            }
        });
    }

    private void l2() {
        String trimmedText = this.agvFirstPhoneNumber.getTrimmedText();
        String trimmedText2 = this.agvSecondPhoneNumber.getTrimmedText();
        if (TextUtils.isEmpty(trimmedText) || TextUtils.isEmpty(trimmedText2)) {
            return;
        }
        if (trimmedText.startsWith("0")) {
            trimmedText = trimmedText.substring(1);
        }
        if (trimmedText2.startsWith("0")) {
            trimmedText2 = trimmedText2.substring(1);
        }
        if (TextUtils.equals(trimmedText, trimmedText2)) {
            ThirdPartEventUtils.y(this, EasycashUmengEvent.n);
        }
    }

    public ArrayList<LabelBean> m1() {
        ArrayList<LabelBean> arrayList = new ArrayList<>();
        arrayList.add(new LabelBean(getString(R.string.married), String.valueOf(10)));
        arrayList.add(new LabelBean(getString(R.string.marital_status_single), String.valueOf(20)));
        arrayList.add(new LabelBean(getString(R.string.divorced), String.valueOf(30)));
        return arrayList;
    }

    private void m2(EditText editText) {
        String str = this.userSession.b().mobileNumber;
        String replaceAll = editText.getText().toString().replaceAll(" ", "");
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(replaceAll)) {
            return;
        }
        if (str.startsWith("0")) {
            str = str.substring(1);
        }
        if (replaceAll.startsWith("0")) {
            replaceAll = replaceAll.substring(1);
        }
        if (TextUtils.equals(str, replaceAll)) {
            ThirdPartEventUtils.z(this, EasycashUmengEvent.m, String.valueOf(editText.getId()));
        }
    }

    private void n1() {
        this.C.f(new SingleRowSelectCompanion.SingleRowSelectViewListener() {
            @Override
            public void a() {
                AddressLocationInfoNewActivity.this.C.e(AddressLocationInfoNewActivity.this.m1());
                AddressLocationInfoNewActivity.this.C.h();
            }

            @Override
            public void c() {
                AddressLocationInfoNewActivity.this.logAuthWorkPickerExpose(SentryTransactionConstants.AuthContactPickerType.MARITAL_STATUS);
            }

            @Override
            public void d(View view, LabelBean labelBean) {
                AddressLocationInfoNewActivity.this.P = labelBean;
                AddressLocationInfoNewActivity addressLocationInfoNewActivity = AddressLocationInfoNewActivity.this;
                addressLocationInfoNewActivity.agvMaritalStatus.setContentText(addressLocationInfoNewActivity.P.label);
                AddressLocationInfoNewActivity.this.R.c(AddressLocationInfoNewActivity.this.agvMaritalStatus);
            }
        });
    }

    private void n2() {
        CustomPopupWindow f = new CustomPopupWindow.Builder(this).h(R.layout.layout_pop_search).j(-1).i(-2).g(1.0f).f();
        this.X = f;
        RecyclerView c = f.c(R.id.rv_result);
        this.f13c0 = c;
        c.setLayoutManager(new LinearLayoutManager(this));
        this.f14d0 = new AssociatedEmailAdapter(this, this.Y, new OnItemClickListener() {
            public final void a(View view, int i, Object obj) {
                AddressLocationInfoNewActivity.this.V1(view, i, (String) obj);
            }
        }, new AssociatedEmailAdapter.KeyWordsCallback() {
            @Override
            public final String a() {
                String W1;
                W1 = AddressLocationInfoNewActivity.this.W1();
                return W1;
            }
        });
        this.f13c0.addItemDecoration(new LinearVerticalDecoration(this, 2131165413, 2131165472, 2131099761));
        this.f13c0.setAdapter(this.f14d0);
    }

    private void o1() {
        this.G.f(new SingleRowSelectCompanion.SingleRowSelectViewListener() {
            @Override
            public void a() {
                AddressLocationInfoNewActivity.this.w2(false);
            }

            @Override
            public void c() {
                AddressLocationInfoNewActivity.this.logAuthWorkPickerExpose(SentryTransactionConstants.AuthContactPickerType.SECOND_RELATION);
            }

            @Override
            public void d(View view, LabelBean labelBean) {
                AddressLocationInfoNewActivity.this.I = labelBean;
                AddressLocationInfoNewActivity addressLocationInfoNewActivity = AddressLocationInfoNewActivity.this;
                addressLocationInfoNewActivity.agvSecondRelation.setContentText(addressLocationInfoNewActivity.I.label);
            }
        });
    }

    private void o2(AuthGeneralView authGeneralView) {
        if (!this.userSession.f().immediateContactBySelect) {
            authGeneralView.getIvRight().setVisibility(8);
            return;
        }
        authGeneralView.setRightIcon(R.drawable.easycash_ic_emergency_contact);
        ImageView ivRight = authGeneralView.getIvRight();
        ViewGroup.LayoutParams layoutParams = ivRight.getLayoutParams();
        layoutParams.height = getResources().getDimensionPixelSize(2131165540);
        layoutParams.width = getResources().getDimensionPixelSize(2131165540);
        ivRight.setLayoutParams(layoutParams);
    }

    private void p1() {
        this.C = new SingleRowSelectCompanion(getString(2131886836), this.agvMaritalStatus, this);
        this.D = new SingleRowSelectCompanion(getString(R.string.easycash_education), this.agvEducation, this);
        this.E = new SingleRowSelectCompanion(getString(R.string.easycash_house_ownership), this.agvHouseType, this);
        this.F = new SingleRowSelectCompanion(getString(R.string.relation), this.agvFirstRelation, this);
        this.G = new SingleRowSelectCompanion(getString(R.string.relation), this.agvSecondRelation, this);
        l1();
        h1();
        n1();
        j1();
        o1();
    }

    private void p2(BaseAuthGeneralView baseAuthGeneralView) {
        baseAuthGeneralView.getEtContent().setKeyListener(DigitsKeyListener.getInstance("0123456789"));
        baseAuthGeneralView.setFormatter(new BaseAuthGeneralView.Formatter() {
            @Override
            public final String a(String str) {
                String X1;
                X1 = AddressLocationInfoNewActivity.X1(str);
                return X1;
            }
        });
        baseAuthGeneralView.setCallBack(new BaseAuthGeneralView.CallBack() {
            @Override
            public final String a(String str) {
                String Y1;
                Y1 = AddressLocationInfoNewActivity.this.Y1(str);
                return Y1;
            }
        });
    }

    public void processAwardContentResponse(MediaRegisterAwardResponse.Body body) {
        if (TextUtils.isEmpty(body.text)) {
            this.rlAwardContent.setVisibility(8);
            return;
        }
        this.tvAwardContent.setText(TextViewUtil.d(body.text, body.dynamicTextFillStringMap, getResources().getColor(2131099780), 1));
        Imager.a().c(this, body.pictureMaterialUrl, this.sivAwardContent, new IImageLoader.IImageLoaderListener<String>() {
            @Override
            public boolean b(Exception exc, String str) {
                AddressLocationInfoNewActivity.this.sivAwardContent.setImageResource(R.drawable.easycash_banner_media_register_auth_award);
                ThirdPartEventUtils.z(AddressLocationInfoNewActivity.this, EasycashUmengEvent.i2, new JsonParamsBuilder().d("step").a(AwardStepType.IDENTITY.name()).c());
                return true;
            }

            @Override
            public boolean a(String str) {
                return false;
            }
        });
        this.sivAwardContent.setVisibility(0);
        this.rlAwardContent.setVisibility(0);
        ThirdPartEventUtils.z(this, EasycashUmengEvent.h2, new JsonParamsBuilder().d("step").a(AwardStepType.IDENTITY.name()).c());
    }

    private void q1() {
        if (this.userSession.f().authLivingAddressCheck) {
            this.agvStreet.getEtContent().setFilters(new InputFilter[]{CharFilterForMeiZu.a()});
            this.agvStreet.getEtContent().setInputType(524433);
            this.agvStreet.getEtContent().setTypeface(Typeface.defaultFromStyle(1));
            this.agvStreet.getEtContent().setSingleLine(true);
        }
        this.agvStreet.setCallBack(new BaseAuthGeneralView.CallBack() {
            @Override
            public final String a(String str) {
                String K1;
                K1 = AddressLocationInfoNewActivity.this.K1(str);
                return K1;
            }
        });
    }

    private void q2(AuthGeneralView authGeneralView, final int i) {
        authGeneralView.getEtContent().setFilters(new InputFilter[]{CharFilterForMeiZu.b()});
        authGeneralView.getEtContent().setInputType(524433);
        authGeneralView.getEtContent().setTypeface(Typeface.defaultFromStyle(1));
        authGeneralView.getIvRight().setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AddressLocationInfoNewActivity.this.Z1(i, view);
            }
        });
        o2(authGeneralView);
    }

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

    private void r2(LabelBean labelBean, AuthGeneralView authGeneralView) {
        if (labelBean == null || authGeneralView == null || TextUtils.isEmpty(labelBean.label)) {
            return;
        }
        authGeneralView.setContentText(labelBean.label);
    }

    private boolean s1() {
        return (this.J == null || this.K == null || this.L == null || this.M == null) ? false : true;
    }

    private void s2(String str, BaseAuthGeneralView baseAuthGeneralView) {
        if (TextUtils.isEmpty(str) || baseAuthGeneralView == null) {
            return;
        }
        baseAuthGeneralView.getEtContent().setText(str);
    }

    public static void startAddressLocationActivity(Activity activity) {
        activity.startActivity(new Intent(activity, (Class<?>) AddressLocationInfoNewActivity.class));
    }

    private boolean t1(String str, String str2) {
        if (str2 == null || str == null || str2.length() < str.length() || str.equals(str2)) {
            return false;
        }
        int i = 0;
        while (i < str.length() && str2.charAt(i) == str.charAt(i)) {
            i++;
        }
        return i == str.length();
    }

    private void t2() {
        AddressSelectEvent addressSelectEvent = this.f17g0;
        if (addressSelectEvent != null) {
            b2(addressSelectEvent);
        }
        s2(this.f18h0, this.agvStreet);
        s2(this.A0, this.agvPersonalEmail);
        r2(this.O, this.agvHouseType);
        r2(this.N, this.agvEducation);
        r2(this.P, this.agvMaritalStatus);
        r2(this.H, this.agvFirstRelation);
        s2(this.f19i0, this.agvFirstPhoneNumber);
        s2(this.f20j0, this.agvFirstName);
        r2(this.I, this.agvSecondRelation);
        s2(this.f21k0, this.agvSecondPhoneNumber);
        s2(this.z0, this.agvSecondName);
        if (getCurrentFocus() != null) {
            getCurrentFocus().clearFocus();
        }
    }

    public void u1(BaseAuthGeneralView baseAuthGeneralView) {
        SmoothScrollUtils.c(this.scrollView, baseAuthGeneralView);
    }

    public void u2() {
        CustomPopupWindow customPopupWindow = this.X;
        if (customPopupWindow == null || !customPopupWindow.d()) {
            return;
        }
        this.X.b();
    }

    public void v1(final BaseAuthGeneralView baseAuthGeneralView) {
        this.scrollView.postDelayed(new Runnable() {
            @Override
            public final void run() {
                AddressLocationInfoNewActivity.this.u1(baseAuthGeneralView);
            }
        }, 300L);
    }

    public void v2(final AuthOptionType authOptionType) {
        showLoadingDialog();
        this.apiHelper.a().w(authOptionType.name()).a(new IdnObserver<LabelBeanListResponse>(this) {
            @Override
            public void onSuccess(LabelBeanListResponse labelBeanListResponse) {
                AddressLocationInfoNewActivity.this.dismissLoadingDialog();
                int i = AnonymousClass15.a[authOptionType.ordinal()];
                if (i == 1) {
                    AddressLocationInfoNewActivity.this.D.e(labelBeanListResponse.body);
                    AddressLocationInfoNewActivity.this.D.h();
                } else {
                    if (i != 2) {
                        return;
                    }
                    AddressLocationInfoNewActivity.this.E.e(labelBeanListResponse.body);
                    AddressLocationInfoNewActivity.this.E.h();
                }
            }
        });
    }

    public void w1(DialogInterface dialogInterface) {
        logAuthWorkPickerExpose(SentryTransactionConstants.AuthContactPickerType.LIVE_ADDRESS);
    }

    public void w2(final boolean z2) {
        showLoadingDialog();
        this.apiHelper.a().D0().K(AndroidSchedulers.a()).a(new IdnObserver<RelationShipResponse>(this) {
            @Override
            public void onSuccess(RelationShipResponse relationShipResponse) {
                AddressLocationInfoNewActivity.this.i2(relationShipResponse, z2);
            }
        });
    }

    public void x1() {
        this.E.d();
    }

    private void x2() {
        ContactInfoRequest contactInfoRequest = new ContactInfoRequest();
        contactInfoRequest.addressProvince = this.J.label;
        contactInfoRequest.addressCity = this.K.label;
        contactInfoRequest.addressDistrict = this.L.label;
        contactInfoRequest.addressVillage = this.M.label;
        contactInfoRequest.addressDetail = this.agvStreet.getEtContent().getText().toString().trim();
        contactInfoRequest.gpsAddress = "";
        contactInfoRequest.marryStatus = this.P.value;
        contactInfoRequest.education = this.N.value;
        contactInfoRequest.houseType = this.O.value;
        ImmediateContactBean immediateContactBean = new ImmediateContactBean();
        contactInfoRequest.immediateContact = immediateContactBean;
        immediateContactBean.name = this.agvFirstName.getEtContent().getText().toString().trim();
        contactInfoRequest.immediateContact.mobilePhoneNo = this.agvFirstPhoneNumber.getTrimmedText();
        contactInfoRequest.immediateContact.relationship = this.H.value;
        ImmediateContactBean immediateContactBean2 = new ImmediateContactBean();
        contactInfoRequest.secondImmediateContact = immediateContactBean2;
        immediateContactBean2.name = this.agvSecondName.getEtContent().getText().toString().trim();
        contactInfoRequest.secondImmediateContact.mobilePhoneNo = this.agvSecondPhoneNumber.getTrimmedText();
        contactInfoRequest.secondImmediateContact.relationship = this.I.value;
        contactInfoRequest.appInfoList = this.Q;
        if (this.T) {
            contactInfoRequest.email = this.agvPersonalEmail.getEtContent().getText().toString().trim();
        }
        showLoadingDialog();
        this.apiHelper.a().m1(this.gson.t(contactInfoRequest)).K(AndroidSchedulers.a()).a(new IdnObserver<BooleanResponse>(this) {
            @Override
            public void onError(Throwable th, BooleanResponse booleanResponse) {
                if (booleanResponse.status.code == EasyCashResponseCode.USER_INVALID_ADDRESS_INPUT.code) {
                    AddressLocationInfoNewActivity.this.dismissLoadingDialog();
                    AddressLocationInfoNewActivity.this.agvStreet.m(booleanResponse.status.detail);
                    AddressLocationInfoNewActivity.this.agvStreet.setPassVerify(booleanResponse.status.detail);
                    AddressLocationInfoNewActivity.this.agvStreet.r();
                    AddressLocationInfoNewActivity addressLocationInfoNewActivity = AddressLocationInfoNewActivity.this;
                    SmoothScrollUtils.c(addressLocationInfoNewActivity.scrollView, addressLocationInfoNewActivity.agvStreet);
                    AddressLocationInfoNewActivity addressLocationInfoNewActivity2 = AddressLocationInfoNewActivity.this;
                    addressLocationInfoNewActivity2.showSoftInput(addressLocationInfoNewActivity2.agvStreet.getEtContent());
                } else {
                    super.onError(th, (Throwable) booleanResponse);
                    IdnBaseResult.Status status = booleanResponse.status;
                    if (status != null && status.code == EasyCashResponseCode.COMMON_SUCCESS.code) {
                        BaseUtils.o(AddressLocationInfoNewActivity.this, R.string.error_in_upload_address_contact_info);
                    }
                }
                ITransaction businessTransaction = AddressLocationInfoNewActivity.this.businessTransaction("UserAuthOrder");
                SpanStatus spanStatus = SpanStatus.INTERNAL_ERROR;
                businessTransaction.b(spanStatus);
                AddressLocationInfoNewActivity.this.B0.a("errorCode", "2000");
                AddressLocationInfoNewActivity.this.B0.a("errorMessage", booleanResponse.status.formatErrorMessageString());
                AddressLocationInfoNewActivity.this.B0.o(spanStatus);
                AddressLocationInfoNewActivity addressLocationInfoNewActivity3 = AddressLocationInfoNewActivity.this;
                addressLocationInfoNewActivity3.logNextStepResult(addressLocationInfoNewActivity3.B0.getName(), "2000", booleanResponse.status.formatErrorMessageString());
            }

            @Override
            public void onSuccess(BooleanResponse booleanResponse) {
                ITransaction businessTransaction = AddressLocationInfoNewActivity.this.businessTransaction("UserAuthOrder");
                SpanStatus spanStatus = SpanStatus.OK;
                businessTransaction.o(spanStatus);
                AddressLocationInfoNewActivity.this.k2();
                AddressLocationInfoNewActivity.this.B0.o(spanStatus);
                AddressLocationInfoNewActivity addressLocationInfoNewActivity = AddressLocationInfoNewActivity.this;
                addressLocationInfoNewActivity.logNextStepResult(addressLocationInfoNewActivity.B0.getName(), null, null);
            }
        });
    }

    public void y1(View view) {
        if (this.O == null) {
            B2(view);
            this.agvHouseType.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.x1();
                }
            }, 500L);
        }
    }

    private void y2(Intent intent, BaseAuthGeneralView baseAuthGeneralView, BaseAuthGeneralView baseAuthGeneralView2) {
        Uri data = intent.getData();
        String[] strArr = {"data1", bg.s};
        if (data == null) {
            return;
        }
        try {
            Cursor query = getContentResolver().query(data, strArr, null, null, null);
            if (query != null) {
                try {
                    if (query.moveToFirst()) {
                        int columnIndex = query.getColumnIndex("data1");
                        int columnIndex2 = query.getColumnIndex(bg.s);
                        String i = FieldRuleUtils.i(query.getString(columnIndex));
                        String string = query.getString(columnIndex2);
                        baseAuthGeneralView.getTvHintTop().setVisibility(0);
                        baseAuthGeneralView.setInputText(string);
                        baseAuthGeneralView.c();
                        baseAuthGeneralView2.getTvHintTop().setVisibility(0);
                        baseAuthGeneralView2.setInputText(i);
                        baseAuthGeneralView2.c();
                    }
                } finally {
                }
            }
            if (query != null) {
                query.close();
            }
        } catch (Exception e) {
            BaseUtils.p(this, getString(R.string.easycash_get_contact_error));
            Logger.c().b(Log.getStackTraceString(e));
        }
    }

    public void z1() {
        this.D.d();
    }

    private void z2() {
        SharedPreferenceUtils.E(this, "firstShowEmergencyContactWarningTip", false);
        EasycashSingleButtonDialog.d(this).o("dialog_emergency_contact_warning").g(R.string.easycash_emergency_contact_warning_tip).f(R.string.got_it).show();
    }

    @Override
    protected void B(@NonNull Bundle bundle) {
        super.B(bundle);
        this.f17g0 = (AddressSelectEvent) bundle.getSerializable("params_selected_address");
        this.f18h0 = bundle.getString("params_detail_address");
        this.O = (LabelBean) bundle.getSerializable("params_house_type");
        this.N = (LabelBean) bundle.getSerializable("params_education");
        this.P = (LabelBean) bundle.getSerializable("params_martial_status");
        this.H = (LabelBean) bundle.getSerializable("params_first_relationship");
        this.f20j0 = bundle.getString("params_first_relation_name");
        this.f19i0 = bundle.getString("params_first_phone_number");
        this.I = (LabelBean) bundle.getSerializable("params_second_relationship");
        this.z0 = bundle.getString("params_second_relation_name");
        this.f21k0 = bundle.getString("params_second_phone_number");
        this.A0 = bundle.getString("params_email");
    }

    void B2(@NonNull View view) {
        int[] iArr = new int[2];
        view.getLocationInWindow(iArr);
        if (iArr[1] > ScreenUtils.c(this) / 2) {
            SmoothScrollUtils.c(this.scrollView, view);
        }
    }

    @Override
    protected void D() {
        super.D();
        r1();
        q1();
        i1();
        p1();
        d1();
        g1();
        k1();
        q2(this.agvFirstName, 1001);
        q2(this.agvSecondName, 1000);
        p2(this.agvFirstPhoneNumber);
        p2(this.agvSecondPhoneNumber);
        this.vEmergencyContactTip.setVisibility(0);
        this.S = new EasyCashBottomAddressDialog(this, getString(R.string.easycash_live_city), new EasyCashBottomAddressDialog.CallBack() {
            @Override
            public final void a(AddressSelectEvent addressSelectEvent) {
                AddressLocationInfoNewActivity.this.M1(addressSelectEvent);
            }
        });
        AuthBusinessProcessor.a().e(this);
        ThirdPartEventUtils.A(this, this.agvStreet.getEtContent(), EasycashUmengEvent.l);
        t2();
    }

    @Override
    protected void N(@NonNull Bundle bundle) {
        super.N(bundle);
        bundle.putSerializable("params_selected_address", this.f17g0);
        bundle.putSerializable("params_detail_address", this.agvStreet.getContent());
        bundle.putSerializable("params_house_type", this.O);
        bundle.putSerializable("params_education", this.N);
        bundle.putSerializable("params_martial_status", this.P);
        bundle.putSerializable("params_first_relationship", this.H);
        bundle.putString("params_first_relation_name", this.agvFirstName.getContent());
        bundle.putString("params_first_phone_number", this.agvFirstPhoneNumber.getContent());
        bundle.putSerializable("params_second_relationship", this.I);
        bundle.putString("params_second_relation_name", this.agvSecondName.getContent());
        bundle.putString("params_second_phone_number", this.agvSecondPhoneNumber.getContent());
        bundle.putString("params_email", this.agvPersonalEmail.getContent());
    }

    public void clickContact(int i) {
        if (BaseUtils.l()) {
            return;
        }
        openSysContactApp(i);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent motionEvent) {
        if (motionEvent.getAction() == 0) {
            View currentFocus = getCurrentFocus();
            if (currentFocus instanceof EditText) {
                Rect rect = new Rect();
                currentFocus.getGlobalVisibleRect(rect);
                if (!rect.contains((int) motionEvent.getRawX(), (int) motionEvent.getRawY())) {
                    currentFocus.clearFocus();
                }
            }
        }
        return super.dispatchTouchEvent(motionEvent);
    }

    public void displaySelectAddressDlg() {
        if (s1()) {
            this.S.k();
        }
        this.S.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public final void onShow(DialogInterface dialogInterface) {
                AddressLocationInfoNewActivity.this.w1(dialogInterface);
            }
        });
        this.S.show();
    }

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

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

    public int getVisibleAreaBottom(View view) {
        Rect rect = new Rect();
        view.getWindowVisibleDisplayFrame(rect);
        return rect.bottom;
    }

    @Override
    protected void init() {
        super.init();
        businessTransaction("UserAuthOrder");
        this.T = this.userSession.f().authCollectEmail;
    }

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

    public void logAuthWorkPickerExpose(SentryTransactionConstants.AuthContactPickerType authContactPickerType) {
        HashMap hashMap = new HashMap();
        hashMap.put("pickerType", authContactPickerType.a());
        ThirdPartEventUtils.u("auth_contact_picker_expose", hashMap);
    }

    public void logNextStepResult(String str, String str2, @Nullable String str3) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("entry_page", str);
        if (str2 != null) {
            hashMap.put("reason", str2);
        }
        if (!TextUtils.isEmpty(str3)) {
            hashMap.put("error_cause", str3);
        }
        logSensorEventWithParams(SensorTrackEvent.EC_AUTH_NEXT_STEP_RESULT, hashMap);
    }

    @Override
    protected void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 1000) {
            if (i2 == -1) {
                y2(intent, this.agvSecondName, this.agvSecondPhoneNumber);
                ThirdPartEventUtils.t("auth_contact_select_click");
                return;
            }
            return;
        }
        if (i == 1001 && i2 == -1) {
            y2(intent, this.agvFirstName, this.agvFirstPhoneNumber);
            ThirdPartEventUtils.t("auth_contact_select_click");
        }
    }

    public void b2(AddressSelectEvent addressSelectEvent) {
        LabelBean labelBean;
        if (addressSelectEvent == null || (labelBean = addressSelectEvent.provinceLabelBean) == null) {
            return;
        }
        this.f17g0 = addressSelectEvent;
        this.J = labelBean;
        this.K = addressSelectEvent.cityLabelBean;
        this.L = addressSelectEvent.districtLabelBean;
        this.M = addressSelectEvent.villageLabelBean;
        StringBuilder sb = new StringBuilder(labelBean.label);
        if (this.K != null) {
            sb.append(", ");
            sb.append(this.K.label);
        }
        if (this.L != null) {
            sb.append(", ");
            sb.append(this.L.label);
        }
        if (this.M != null) {
            sb.append(", ");
            sb.append(this.M.label);
        }
        if (sb.length() != 0) {
            this.agvLiveAddressCity.setContentText(sb.toString());
        }
    }

    public void onBackPressed() {
        ThirdPartEventUtils.t("auth_contact_back_click");
        logSensorEvent(SensorTrackEvent.EC_ADDRESS_LOCATION_INFO_BACK);
        if (this.userSession.b().canEnterMinimaListProcess) {
            super/*androidx.activity.ComponentActivity*/.onBackPressed();
        } else {
            if (H2(new Runnable() {
                @Override
                public final void run() {
                    AddressLocationInfoNewActivity.this.finish();
                }
            })) {
                return;
            }
            AuthBackTipsDialogUtil.g(this, "16");
        }
    }

    @OnClick({2131361988})
    public void onConfirmClicked(View view) {
        if (BaseUtils.l()) {
            return;
        }
        ThirdPartEventUtils.y(this, EasycashUmengEvent.e);
        ThirdPartEventUtils.t("auth_contact_next_click");
        this.B0 = Sentry.C("auth_contact_next_click_result", "monitor");
        g2();
        logSensorEvent(SensorTrackEvent.EC_ADDRESS_LOCATION_INFO_NEXT_STEP);
    }

    @OnClick({R.id.v_emergency_contact_tip})
    public void onEmergencyContactWarningTipClick() {
        z2();
    }

    @Override
    protected void onResume() {
        super.onResume();
        ThirdPartEventUtils.t("auth_contact_expose");
        logSensorEvent(SensorTrackEvent.EC_ADDRESS_LOCATION_INFO_SHOW);
    }

    public void openSysContactApp(int i) {
        Intent intent = new Intent("android.intent.action.PICK");
        intent.setType("vnd.android.cursor.dir/phone_v2");
        if (intent.resolveActivity(getPackageManager()) != null) {
            startActivityForResult(intent, i);
        }
    }

    @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() {
        super.z();
        f1();
        F2();
        GiftAwardOperationUtil.a(AwardStepType.CONTACT_INFO.name(), this, true, new GiftAwardOperationUtil.GiftAwardCallback() {
            @Override
            public void b(MediaRegisterAwardResponse mediaRegisterAwardResponse) {
                AddressLocationInfoNewActivity.this.processAwardContentResponse(mediaRegisterAwardResponse.body);
            }

            @Override
            public void a() {
            }
        });
        new AppListUtils(this).u(ALScene.ADDRESS_LOCATION, new AppListCallBack<List<AppInfo>>() {
            @Override
            public void c(List<AppInfo> list) {
                AddressLocationInfoNewActivity.this.Q = list;
            }
        });
        ECSurveyUtils eCSurveyUtils = new ECSurveyUtils(this, UserSatisfactionSurveyScene.SCENE_ADDRESS_CONTACT);
        this.U = eCSurveyUtils;
        eCSurveyUtils.A();
        L();
        G2();
    }
}