what-the-bank/sources/com/scb/phone/view/fragment/investment/assessment/RiskSummaryFragment.java

288 lines
9.1 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
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.RiskSummaryRecyclerViewAdapter;
import com.scb.phone.view.fragment.BaseFragment;
import java.util.ArrayList;
import java.util.List;
import o.C0816Pb;
import o.C0819Pd;
import o.C0821Pe;
import o.C11123eZ;
import o.C13396fZU;
import o.C14957gcv;
import o.C17144uK;
import o.C17152uO;
import o.C17162uS;
import o.C17809ztu;
import o.InterfaceC12873fJq;
import o.InterfaceC13391fZD;
import o.InterfaceC9388dim;
import o.OW;
import o.YV;
import o.ZI;
import o.bBB;
import o.tJR;
/* loaded from: classes5.dex */
public final class RiskSummaryFragment extends Hilt_RiskSummaryFragment implements InterfaceC9388dim.LWm {
public static final RVV d = new RVV(0);
@BindView
public Button btContinue;
private InterfaceC12873fJq.LWm c;
@InterfaceC13391fZD
public bBB presenter;
@BindView
public RecyclerView rvQuestions;
@BindView
public TextView tvRiskSubTitle;
@BindView
public TextView tvRiskTitle;
/* loaded from: classes5.dex */
public static final class RVV {
private RVV() {
}
public /* synthetic */ RVV(byte b) {
this();
}
}
@OnClick
public final void continueButtonClicked() {
bBB bbb = this.presenter;
List<C0821Pe> list = null;
if (bbb == null) {
C14957gcv.a("");
bbb = null;
}
if (bbb.f != 0) {
bbb.f.y();
}
YV yv = bbb.a;
if (yv == null) {
C14957gcv.a("");
yv = null;
}
int i = bBB.IeS.c[yv.ordinal()];
if (i == 1) {
C17809ztu c17809ztu = bbb.d;
C17144uK c17144uK = bbb.b;
List<C0821Pe> list2 = bbb.e;
if (list2 == null) {
C14957gcv.a("");
} else {
list = list2;
}
c17809ztu.d(C17144uK.a(list));
} else if (i == 2) {
C17809ztu c17809ztu2 = bbb.d;
C17162uS c17162uS = bbb.g;
List<C0821Pe> list3 = bbb.e;
if (list3 == null) {
C14957gcv.a("");
} else {
list = list3;
}
C14957gcv.e(list, "");
C17152uO c17152uO = c17162uS.b;
c17809ztu2.b(new C11123eZ(C17152uO.c(list)));
}
C17809ztu c17809ztu3 = bbb.d;
c17809ztu3.d(c17809ztu3.i, new bBB.RVV(bbb));
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.investment.assessment.Hilt_RiskSummaryFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public final void onAttach(Context context) {
C14957gcv.e(context, "");
super.onAttach(context);
this.c = context instanceof InterfaceC12873fJq.LWm ? (InterfaceC12873fJq.LWm) context : null;
}
@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);
bBB bbb = this.presenter;
final bBB bbb2 = null;
if (bbb == null) {
C14957gcv.a("");
bbb = null;
}
bbb.e((bBB) this);
Bundle arguments = getArguments();
if (arguments != null) {
bBB bbb3 = this.presenter;
if (bbb3 != null) {
bbb2 = bbb3;
} else {
C14957gcv.a("");
}
String string = arguments.getString("name");
if (string == null) {
string = "";
}
Parcelable parcelable = arguments.getParcelable(CommonConstant.ReqAccessTokenParam.DISPLAY_LABEL);
if (parcelable == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
final C0819Pd c0819Pd = (C0819Pd) parcelable;
ArrayList parcelableArrayList = arguments.getParcelableArrayList("answer");
if (parcelableArrayList == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
C14957gcv.c(parcelableArrayList, "");
final ArrayList arrayList = parcelableArrayList;
YV yv = YV.OLD_SUITABILITY;
int i = arguments.getInt("suitabilityFlowType", -1);
if (i >= 0) {
yv = YV.values()[i];
}
final YV yv2 = yv;
C14957gcv.e(string, "");
C14957gcv.e(c0819Pd, "");
C14957gcv.e(arrayList, "");
C14957gcv.e(yv2, "");
bbb2.c = string;
bbb2.e = arrayList;
bbb2.a = yv2;
ZI.IeS ieS = new ZI.IeS(bbb2, c0819Pd, arrayList, yv2) { // from class: o.bBy
private YV b;
private List c;
private C0819Pd d;
private bBB e;
@Override // o.ZI.IeS
public final void e(Object obj) {
bBB.d(this.e, this.d, this.c, this.b, (InterfaceC9388dim.LWm) obj);
}
{
this.e = bbb2;
this.d = c0819Pd;
this.c = arrayList;
this.b = yv2;
}
};
if (bbb2.f != 0) {
ieS.e(bbb2.f);
}
}
return inflate;
}
@Override // o.InterfaceC9388dim.LWm
public final void a() {
Button button = this.btContinue;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(true);
}
@Override // o.InterfaceC9388dim.LWm
public final void a(C0819Pd c0819Pd, List<OW> list) {
C14957gcv.e(c0819Pd, "");
C14957gcv.e(list, "");
TextView textView = this.tvRiskTitle;
TextView textView2 = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(getString(R.string.risk_questionnaire_title));
TextView textView3 = this.tvRiskSubTitle;
if (textView3 != null) {
textView2 = textView3;
} else {
C14957gcv.a("");
}
textView2.setText(getString(R.string.auto_mf_onboarding_suitability_summary_message));
c(c0819Pd, list);
}
@Override // o.InterfaceC9388dim.LWm
public final void b(C0819Pd c0819Pd, List<OW> list) {
C14957gcv.e(c0819Pd, "");
C14957gcv.e(list, "");
TextView textView = this.tvRiskTitle;
TextView textView2 = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(getString(R.string.auto_single_form_suitability_assessment_summary_title));
TextView textView3 = this.tvRiskSubTitle;
if (textView3 != null) {
textView2 = textView3;
} else {
C14957gcv.a("");
}
textView2.setText(getString(R.string.auto_single_form_suitability_assessment_summary_description));
c(c0819Pd, list);
}
private final void c(C0819Pd c0819Pd, List<OW> list) {
RecyclerView recyclerView = this.rvQuestions;
RecyclerView recyclerView2 = null;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
getContext();
recyclerView.setLayoutManager(new LinearLayoutManager(1, false));
RecyclerView recyclerView3 = this.rvQuestions;
if (recyclerView3 == null) {
C14957gcv.a("");
recyclerView3 = null;
}
recyclerView3.setNestedScrollingEnabled(false);
RecyclerView recyclerView4 = this.rvQuestions;
if (recyclerView4 != null) {
recyclerView2 = recyclerView4;
} else {
C14957gcv.a("");
}
recyclerView2.setAdapter(new RiskSummaryRecyclerViewAdapter(c0819Pd, list));
}
@Override // o.InterfaceC9388dim.LWm
public final void a(String str, C0816Pb c0816Pb) {
C14957gcv.e(str, "");
C14957gcv.e(c0816Pb, "");
InterfaceC12873fJq.LWm lWm = this.c;
if (lWm != null) {
lWm.b(str, c0816Pb);
}
}
@Override // o.InterfaceC9388dim.LWm
public final void b(C13396fZU<String, tJR> c13396fZU) {
C14957gcv.e(c13396fZU, "");
g(c13396fZU);
}
}