package com.scb.phone.view.fragment.hml; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.SpinnerAdapter; import android.widget.TextView; import androidx.constraintlayout.widget.Group; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.activity.hml.HmlRepaymentMethodAboutActivity; import com.scb.phone.view.custom.easycash.CustomTileToggle; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.hml.HmlBaseAccountSetupFragment; import java.util.List; import o.AbstractC5039blX; import o.C0811PYo; import o.C14957gcv; import o.InterfaceC13391fZD; import o.InterfaceC9291dgv; import o.MR; import o.ZI; import o.bTI; import o.pug; /* loaded from: classes5.dex */ public abstract class HmlBaseAccountSetupFragment extends BaseFragment implements InterfaceC9291dgv { @BindView public FrameLayout emailSeparator; @BindView public TextView estatementEmail; @BindView public TextView estatementEmailDisclaimer; @BindView public TextView estatementEmailTitle; @BindView public Button nextButton; @InterfaceC13391fZD public T presenter; @BindView public ImageView questionIcon; @BindView public Spinner receivingAccountSpinner; @BindView public Spinner repaymentAccountSpinner; @BindView public TextView repaymentAccountTitle; @BindView public TextView repaymentDateTextView; @BindView public TextView repaymentDateTitle; @BindView public TextView repaymentMethodLabel; @BindView public CustomTileToggle repaymentMethodToggle; @BindView public Group repaymentSpinnerGroup; public abstract String d(); @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); View inflate = layoutInflater.inflate(R.layout.2131559687, viewGroup, false); ButterKnife.c(this, inflate); T t = this.presenter; T t2 = null; if (t == null) { C14957gcv.a(""); t = null; } t.e(this); T t3 = this.presenter; if (t3 != null) { t2 = t3; } else { C14957gcv.a(""); } t2.b(); return inflate; } @Override // o.InterfaceC9291dgv public final void d(boolean z) { Group group = this.repaymentSpinnerGroup; if (group == null) { C14957gcv.a(""); group = null; } group.setVisibility(z ? 0 : 8); } private final void asY_(List list, Spinner spinner) { Context context = getContext(); if (context != null) { spinner.setAdapter((SpinnerAdapter) new ArrayAdapter(context, R.layout.2131559352, list)); } spinner.setOnItemSelectedListener(new RVV(this, list, spinner)); } /* loaded from: classes5.dex */ public static final class RVV implements AdapterView.OnItemSelectedListener { private Spinner c; private HmlBaseAccountSetupFragment d; private List e; RVV(HmlBaseAccountSetupFragment hmlBaseAccountSetupFragment, List list, Spinner spinner) { this.d = hmlBaseAccountSetupFragment; this.e = list; this.c = spinner; } @Override // android.widget.AdapterView.OnItemSelectedListener public final void onItemSelected(AdapterView adapterView, View view, int i, long j) { C14957gcv.e(adapterView, ""); C14957gcv.e(view, ""); T t = this.d.presenter; Spinner spinner = null; if (t == null) { C14957gcv.a(""); t = null; } MR.LWm lWm = this.e.get(i); Spinner spinner2 = this.c; Spinner spinner3 = this.d.receivingAccountSpinner; if (spinner3 != null) { spinner = spinner3; } else { C14957gcv.a(""); } boolean b = C14957gcv.b(spinner2, spinner); C14957gcv.e(lWm, ""); if (b) { C14957gcv.e(lWm, ""); t.d = lWm; } else { C14957gcv.e(lWm, ""); t.a = lWm; } } @Override // android.widget.AdapterView.OnItemSelectedListener public final void onNothingSelected(AdapterView adapterView) { C14957gcv.e(adapterView, ""); } } @Override // o.InterfaceC9291dgv public void c() { startActivity(HmlRepaymentMethodAboutActivity.agp_(getContext())); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroyView() { T t = this.presenter; if (t == null) { C14957gcv.a(""); t = null; } t.w_(); super.onDestroyView(); } @Override // o.InterfaceC9291dgv public final void e(boolean z) { pug[] pugVarArr = new pug[2]; pugVarArr[0] = new pug("user_type", d()); pugVarArr[1] = new pug("loan_type", z ? "business_owner" : "consumer"); c("p10x1_account_setup", pugVarArr); } public static /* synthetic */ void e(HmlBaseAccountSetupFragment hmlBaseAccountSetupFragment) { C14957gcv.e(hmlBaseAccountSetupFragment, ""); T t = hmlBaseAccountSetupFragment.presenter; if (t == null) { C14957gcv.a(""); t = null; } ZI.IeS ieS = new ZI.IeS() { // from class: o.blW @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9291dgv) obj).c(); } }; if (t.f != 0) { ieS.e(t.f); } } public static /* synthetic */ void b(HmlBaseAccountSetupFragment hmlBaseAccountSetupFragment, int i) { C14957gcv.e(hmlBaseAccountSetupFragment, ""); T t = hmlBaseAccountSetupFragment.presenter; if (t == null) { C14957gcv.a(""); t = null; } final boolean z = i == 0; t.b = z; ZI.IeS ieS = new ZI.IeS(z) { // from class: o.blZ private boolean d; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9291dgv) obj).d(this.d); } { this.d = z; } }; if (t.f != 0) { ieS.e(t.f); } } public static /* synthetic */ void c(HmlBaseAccountSetupFragment hmlBaseAccountSetupFragment) { C14957gcv.e(hmlBaseAccountSetupFragment, ""); T t = hmlBaseAccountSetupFragment.presenter; MR.LWm lWm = null; if (t == null) { C14957gcv.a(""); t = null; } if (t.f != 0) { t.f.y(); } MR.LWm lWm2 = t.a; if (lWm2 == null) { C14957gcv.a(""); lWm2 = null; } String str = lWm2.a; if (!t.b) { str = null; } C0811PYo c0811PYo = t.c; MR.LWm lWm3 = t.d; if (lWm3 != null) { lWm = lWm3; } else { C14957gcv.a(""); } c0811PYo.a(lWm.a, str); C0811PYo c0811PYo2 = t.c; c0811PYo2.d(c0811PYo2.i, new AbstractC5039blX.LWm(t, str)); } @Override // o.InterfaceC9291dgv public final void c(MR mr) { LinearLayout linearLayout; C14957gcv.e(mr, ""); List list = mr.b; Spinner spinner = this.receivingAccountSpinner; Button button = null; if (spinner == null) { C14957gcv.a(""); spinner = null; } asY_(list, spinner); List list2 = mr.h; Spinner spinner2 = this.repaymentAccountSpinner; if (spinner2 == null) { C14957gcv.a(""); spinner2 = null; } asY_(list2, spinner2); TextView textView = this.repaymentDateTextView; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(getString(R.string.hml_account_setup_repayment_date, mr.d.e, mr.d.a)); ImageView imageView = this.questionIcon; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setOnClickListener(new View.OnClickListener(this) { // from class: o.eZS private HmlBaseAccountSetupFragment d; @Override // android.view.View.OnClickListener public final void onClick(View view) { HmlBaseAccountSetupFragment.e(this.d); } { this.d = this; } }); if (LWm.e[mr.e.ordinal()] == 1) { CustomTileToggle customTileToggle = this.repaymentMethodToggle; if (customTileToggle == null) { C14957gcv.a(""); customTileToggle = null; } customTileToggle.setVisibility(8); ImageView imageView2 = this.questionIcon; if (imageView2 == null) { C14957gcv.a(""); imageView2 = null; } imageView2.setVisibility(8); TextView textView2 = this.repaymentMethodLabel; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(getString(R.string.hml_business_owner_account_setup_repayment_method_label)); TextView textView3 = this.repaymentAccountTitle; if (textView3 == null) { C14957gcv.a(""); textView3 = null; } textView3.setText(getString(R.string.hml_business_owner_account_setup_repayment_account_title)); } else { CustomTileToggle customTileToggle2 = this.repaymentMethodToggle; if (customTileToggle2 == null) { C14957gcv.a(""); customTileToggle2 = null; } customTileToggle2.a(new CustomTileToggle.HBt(this) { // from class: o.eZQ private HmlBaseAccountSetupFragment c; @Override // com.scb.phone.view.custom.easycash.CustomTileToggle.HBt public final void d(int i, View view) { HmlBaseAccountSetupFragment.b(this.c, i); } { this.c = this; } }); CustomTileToggle customTileToggle3 = this.repaymentMethodToggle; if (customTileToggle3 == null) { C14957gcv.a(""); customTileToggle3 = null; } if (mr.c) { CustomTileToggle customTileToggle4 = this.repaymentMethodToggle; if (customTileToggle4 == null) { C14957gcv.a(""); customTileToggle4 = null; } linearLayout = customTileToggle4.leftTile; } else { CustomTileToggle customTileToggle5 = this.repaymentMethodToggle; if (customTileToggle5 == null) { C14957gcv.a(""); customTileToggle5 = null; } linearLayout = customTileToggle5.rightTile; } customTileToggle3.a(linearLayout); } TextView textView4 = this.estatementEmail; if (textView4 == null) { C14957gcv.a(""); textView4 = null; } textView4.setText(mr.a); Button button2 = this.nextButton; if (button2 != null) { button = button2; } else { C14957gcv.a(""); } button.setOnClickListener(new View.OnClickListener(this) { // from class: o.eZP private HmlBaseAccountSetupFragment e; @Override // android.view.View.OnClickListener public final void onClick(View view) { HmlBaseAccountSetupFragment.c(this.e); } { this.e = this; } }); } /* loaded from: classes5.dex */ public final /* synthetic */ class LWm { public static final int[] e; static { int[] iArr = new int[bTI.values().length]; try { iArr[bTI.BUSINESS_OWNER.ordinal()] = 1; } catch (NoSuchFieldError unused) { } e = iArr; } } }