package com.scb.phone.view.fragment.investment.assessment; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.adapter.investment.assessment.RiskLevelsAdapter; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.investment.assessment.RiskSelectionFragment; import java.util.List; import o.C0819Pd; import o.C0822Pf; import o.C12442eyL; import o.C13396fZU; import o.C14957gcv; import o.C17809ztu; import o.C3625bBp; import o.C3626bBq; import o.InterfaceC12873fJq; import o.InterfaceC13391fZD; import o.InterfaceC9389din; import o.YV; import o.eCG; import o.fIW; import o.gdZ; import o.tJR; /* loaded from: classes5.dex */ public final class RiskSelectionFragment extends Hilt_RiskSelectionFragment implements InterfaceC9389din.LWm { public static final HBt c = new HBt(0); @BindView public Button btNext; private InterfaceC12873fJq.IeS d; @InterfaceC13391fZD public C3625bBp presenter; @BindView public RecyclerView rvRiskLevels; @BindView public TextView tvRiskLevelRemarkDescription; @BindView public TextView tvRiskLevelTitle; /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.investment.assessment.Hilt_RiskSelectionFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public final void onAttach(Context context) { C14957gcv.e(context, ""); super.onAttach(context); if (context instanceof InterfaceC12873fJq.IeS) { this.d = (InterfaceC12873fJq.IeS) context; } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); View inflate = layoutInflater.inflate(R.layout.2131559885, viewGroup, false); ((BaseFragment) this).a = ButterKnife.c(this, inflate); C3625bBp c3625bBp = this.presenter; RecyclerView recyclerView = null; if (c3625bBp == null) { C14957gcv.a(""); c3625bBp = null; } c3625bBp.e((C3625bBp) this); Bundle arguments = getArguments(); if (arguments != null) { C14957gcv.c(arguments, ""); YV yv = YV.OLD_SUITABILITY; int i = arguments.getInt("suitabilityFlowType", -1); if (i >= 0) { yv = YV.values()[i]; } YV yv2 = yv; boolean z = arguments.getBoolean("MF_SUITABILITY_MENU", false); C14957gcv.e(yv2, ""); c3625bBp.a = yv2; c3625bBp.c = z; if (c3625bBp.f != 0) { c3625bBp.f.y(); } YV yv3 = c3625bBp.a; if (yv3 == null) { C14957gcv.a(""); yv3 = null; } int i2 = C3625bBp.IeS.b[yv3.ordinal()]; if (i2 == 1) { c3625bBp.e.b(); } else if (i2 == 2) { c3625bBp.e.c(); } C17809ztu c17809ztu = c3625bBp.e; c17809ztu.d(c17809ztu.i, new C3625bBp.LWm(c3625bBp)); } RecyclerView recyclerView2 = this.rvRiskLevels; if (recyclerView2 != null) { recyclerView = recyclerView2; } else { C14957gcv.a(""); } recyclerView.getContext(); recyclerView.setLayoutManager(new LinearLayoutManager(1, false)); recyclerView.setNestedScrollingEnabled(false); return inflate; } @OnClick public final void continueButtonClicked() { C3625bBp c3625bBp = this.presenter; YV yv = null; if (c3625bBp == null) { C14957gcv.a(""); c3625bBp = null; } String str = c3625bBp.b; if (!(str == null || gdZ.d((CharSequence) str))) { if (c3625bBp.f != 0) { c3625bBp.f.y(); } YV yv2 = c3625bBp.a; if (yv2 == null) { C14957gcv.a(""); } else { yv = yv2; } int i = C3625bBp.IeS.b[yv.ordinal()]; if (i == 1) { c3625bBp.e.c(c3625bBp.b); } else if (i == 2) { c3625bBp.e.e(c3625bBp.b); } C17809ztu c17809ztu = c3625bBp.e; c17809ztu.d(c17809ztu.i, new C3625bBp.RVV(c3625bBp)); } } @Override // o.InterfaceC9389din.LWm public final void e(boolean z) { Button button = this.btNext; if (button == null) { C14957gcv.a(""); button = null; } button.setEnabled(z); } @Override // o.InterfaceC9389din.LWm public final void b(List list) { C14957gcv.e(list, ""); RecyclerView recyclerView = this.rvRiskLevels; if (recyclerView == null) { C14957gcv.a(""); recyclerView = null; } recyclerView.d(new eCG(requireContext(), 16), -1); recyclerView.setAdapter(new RiskLevelsAdapter(list, new fIW(this) { // from class: o.fgA private RiskSelectionFragment c; @Override // o.fIW public final void a(Object obj) { RiskSelectionFragment.c(this.c, (String) obj); } { this.c = this; } })); } @Override // o.InterfaceC9389din.LWm public final void c(List list) { C14957gcv.e(list, ""); TextView textView = this.tvRiskLevelTitle; RecyclerView recyclerView = null; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(getString(R.string.single_form_mf_risk_level_title_first)); TextView textView2 = this.tvRiskLevelRemarkDescription; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(getString(R.string.single_form_mf_risk_level_remark_description)); Button button = this.btNext; if (button == null) { C14957gcv.a(""); button = null; } button.setText(getText(R.string.single_form_mf_risk_level_button)); RecyclerView recyclerView2 = this.rvRiskLevels; if (recyclerView2 != null) { recyclerView = recyclerView2; } else { C14957gcv.a(""); } recyclerView.setAdapter(new C12442eyL(list, new fIW(this) { // from class: o.fgz private RiskSelectionFragment c; @Override // o.fIW public final void a(Object obj) { RiskSelectionFragment.a(this.c, (String) obj); } { this.c = this; } })); } @Override // o.InterfaceC9389din.LWm public final void d(C0819Pd c0819Pd) { C14957gcv.e(c0819Pd, ""); InterfaceC12873fJq.IeS ieS = this.d; if (ieS != null) { ieS.e(c0819Pd); } } @Override // o.InterfaceC9389din.LWm public final void d() { InterfaceC12873fJq.IeS ieS = this.d; if (ieS != null) { ieS.b(true); } } @Override // o.InterfaceC9389din.LWm public final void c() { InterfaceC12873fJq.IeS ieS = this.d; if (ieS != null) { ieS.b(false); } } @Override // o.InterfaceC9389din.LWm public final void d(C13396fZU c13396fZU) { C14957gcv.e(c13396fZU, ""); g(c13396fZU); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C3625bBp c3625bBp = this.presenter; if (c3625bBp == null) { C14957gcv.a(""); c3625bBp = null; } c3625bBp.w_(); super.onDestroy(); } /* loaded from: classes5.dex */ public static final class HBt { private HBt() { } public /* synthetic */ HBt(byte b) { this(); } } public static /* synthetic */ void a(RiskSelectionFragment riskSelectionFragment, String str) { C14957gcv.e(riskSelectionFragment, ""); C3625bBp c3625bBp = riskSelectionFragment.presenter; if (c3625bBp == null) { C14957gcv.a(""); c3625bBp = null; } C14957gcv.c((Object) str, ""); C14957gcv.e(str, ""); c3625bBp.b = str; C3626bBq c3626bBq = new C3626bBq(c3625bBp); if (c3625bBp.f != 0) { c3626bBq.e(c3625bBp.f); } } public static /* synthetic */ void c(RiskSelectionFragment riskSelectionFragment, String str) { C14957gcv.e(riskSelectionFragment, ""); C3625bBp c3625bBp = riskSelectionFragment.presenter; if (c3625bBp == null) { C14957gcv.a(""); c3625bBp = null; } C14957gcv.c((Object) str, ""); C14957gcv.e(str, ""); c3625bBp.b = str; C3626bBq c3626bBq = new C3626bBq(c3625bBp); if (c3625bBp.f != 0) { c3626bBq.e(c3625bBp.f); } } }