package com.scb.phone.view.fragment.investment.assessment; import android.content.Context; import android.os.Bundle; import android.os.Parcelable; 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.huawei.hms.support.api.entity.common.CommonConstant; import com.scb.phone.R; import com.scb.phone.view.adapter.suitabilityassessment.QuestionnaireRecyclerViewAdapter; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.investment.assessment.RiskQuestionnaireFragment; import java.util.List; import o.C0819Pd; import o.C0821Pe; import o.C11123eZ; import o.C12438eyH; import o.C13396fZU; import o.C14957gcv; import o.C17144uK; import o.C17152uO; import o.C17162uS; import o.C17809ztu; import o.C3612bBb; import o.InterfaceC12867fJk; import o.InterfaceC12873fJq; import o.InterfaceC13391fZD; import o.InterfaceC9384dii; import o.YV; import o.ZI; import o.tJR; /* loaded from: classes5.dex */ public final class RiskQuestionnaireFragment extends Hilt_RiskQuestionnaireFragment implements InterfaceC9384dii.LWm { public static final IeS d = new IeS(0); @BindView public Button btContinue; private final InterfaceC12867fJk c = new InterfaceC12867fJk(this) { // from class: o.fgs private RiskQuestionnaireFragment a; @Override // o.InterfaceC12867fJk public final void b(C0819Pd c0819Pd) { RiskQuestionnaireFragment.b(this.a, c0819Pd); } { this.a = this; } }; private InterfaceC12873fJq.RVV h; @InterfaceC13391fZD public C3612bBb presenter; @BindView public RecyclerView rvQuestions; @BindView public TextView tvRiskSubTitle; @BindView public TextView tvRiskTitle; /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.investment.assessment.Hilt_RiskQuestionnaireFragment, 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.RVV) { this.h = (InterfaceC12873fJq.RVV) 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.2131559883, viewGroup, false); ((BaseFragment) this).a = ButterKnife.c(this, inflate); C3612bBb c3612bBb = this.presenter; RecyclerView recyclerView = null; if (c3612bBb == null) { C14957gcv.a(""); c3612bBb = null; } c3612bBb.e((C3612bBb) this); Bundle arguments = getArguments(); if (arguments != null) { C3612bBb c3612bBb2 = this.presenter; if (c3612bBb2 == null) { C14957gcv.a(""); c3612bBb2 = null; } Parcelable parcelable = arguments.getParcelable(CommonConstant.ReqAccessTokenParam.DISPLAY_LABEL); if (parcelable == null) { throw new IllegalArgumentException("Required value was null.".toString()); } final C0819Pd c0819Pd = (C0819Pd) parcelable; YV yv = YV.OLD_SUITABILITY; int i = arguments.getInt("suitabilityFlowType", -1); if (i >= 0) { yv = YV.values()[i]; } final YV yv2 = yv; C14957gcv.e(c0819Pd, ""); C14957gcv.e(yv2, ""); c3612bBb2.e = c0819Pd; c3612bBb2.c = yv2; ZI.IeS ieS = new ZI.IeS(yv2, c0819Pd) { // from class: o.bBm private YV b; private C0819Pd c; @Override // o.ZI.IeS public final void e(Object obj) { C3612bBb.d(this.b, this.c, (InterfaceC9384dii.LWm) obj); } { this.b = yv2; this.c = c0819Pd; } }; if (c3612bBb2.f != 0) { ieS.e(c3612bBb2.f); } c3612bBb2.c(); } RecyclerView recyclerView2 = this.rvQuestions; 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() { C3612bBb c3612bBb = this.presenter; YV yv = null; if (c3612bBb == null) { C14957gcv.a(""); c3612bBb = null; } if (c3612bBb.f != 0) { c3612bBb.f.y(); } YV yv2 = c3612bBb.c; if (yv2 == null) { C14957gcv.a(""); } else { yv = yv2; } int i = C3612bBb.LWm.c[yv.ordinal()]; if (i == 1) { C17809ztu c17809ztu = c3612bBb.b; C17144uK c17144uK = c3612bBb.a; c17809ztu.d(C17144uK.a(c3612bBb.d)); } else if (i == 2) { C17809ztu c17809ztu2 = c3612bBb.b; C17162uS c17162uS = c3612bBb.i; List list = c3612bBb.d; C14957gcv.e(list, ""); C17152uO c17152uO = c17162uS.b; c17809ztu2.b(new C11123eZ(C17152uO.c(list))); } C17809ztu c17809ztu3 = c3612bBb.b; c17809ztu3.d(c17809ztu3.i, new C3612bBb.Sts(c3612bBb)); } @Override // o.InterfaceC9384dii.LWm public final void b(boolean z) { Button button = this.btContinue; if (button == null) { C14957gcv.a(""); button = null; } button.setEnabled(z); } @Override // o.InterfaceC9384dii.LWm public final void e(C0819Pd c0819Pd) { C14957gcv.e(c0819Pd, ""); TextView textView = this.tvRiskTitle; RecyclerView recyclerView = null; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(getString(R.string.risk_questionnaire_title)); TextView textView2 = this.tvRiskSubTitle; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(getString(R.string.risk_questionnaire_subtitle)); RecyclerView recyclerView2 = this.rvQuestions; if (recyclerView2 != null) { recyclerView = recyclerView2; } else { C14957gcv.a(""); } recyclerView.setAdapter(new QuestionnaireRecyclerViewAdapter(c0819Pd, this.c)); } @Override // o.InterfaceC9384dii.LWm public final void d(C0819Pd c0819Pd) { C14957gcv.e(c0819Pd, ""); TextView textView = this.tvRiskTitle; RecyclerView recyclerView = null; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(getString(R.string.auto_single_form_suitability_assessment_questionnaire_section_1)); TextView textView2 = this.tvRiskSubTitle; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(getString(R.string.auto_single_form_suitability_assessment_questionnaire_section_1_description)); RecyclerView recyclerView2 = this.rvQuestions; if (recyclerView2 != null) { recyclerView = recyclerView2; } else { C14957gcv.a(""); } recyclerView.setAdapter(new C12438eyH(c0819Pd, this.c)); } @Override // o.InterfaceC9384dii.LWm public final void c(List list) { C14957gcv.e(list, ""); InterfaceC12873fJq.RVV rvv = this.h; if (rvv != null) { rvv.c(list); } } @Override // o.InterfaceC9384dii.LWm public final void c(C13396fZU c13396fZU) { C14957gcv.e(c13396fZU, ""); g(c13396fZU); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C3612bBb c3612bBb = this.presenter; if (c3612bBb == null) { C14957gcv.a(""); c3612bBb = null; } c3612bBb.w_(); super.onDestroy(); } /* loaded from: classes5.dex */ public static final class IeS { private IeS() { } public /* synthetic */ IeS(byte b) { this(); } } public static /* synthetic */ void b(RiskQuestionnaireFragment riskQuestionnaireFragment, C0819Pd c0819Pd) { C14957gcv.e(riskQuestionnaireFragment, ""); C3612bBb c3612bBb = riskQuestionnaireFragment.presenter; if (c3612bBb == null) { C14957gcv.a(""); c3612bBb = null; } C14957gcv.c(c0819Pd, ""); C14957gcv.e(c0819Pd, ""); c3612bBb.e = c0819Pd; c3612bBb.c(); } }