package com.scb.phone.view.fragment.additionaldocument; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.fragment.app.FragmentActivity; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.custom.additionaldocument.DocumentInstructionsDetailCustomView; import com.scb.phone.view.fragment.additionaldocument.DocumentInstructionsFragment; import java.io.Serializable; import java.util.List; import o.C0401Fu; import o.C14957gcv; import o.C2499afk; import o.Hzp; import o.InterfaceC13391fZD; import o.InterfaceC9020dbo; import o.ZI; import o.fJK; /* loaded from: classes5.dex */ public final class DocumentInstructionsFragment extends Hilt_DocumentInstructionsFragment implements InterfaceC9020dbo { private fJK c; @BindView public TextView descriptionText; @BindView public LinearLayout detailsList; @BindView public TextView headerText; @BindView public TextView listTitle; @BindView public Button nextButton; @InterfaceC13391fZD public C2499afk presenter; @BindView public ImageView thumbnail; /* loaded from: classes5.dex */ public static final class LWm { public static final LWm a = new LWm(); private LWm() { } public static DocumentInstructionsFragment e(boolean z, String str, Hzp hzp) { C14957gcv.e(str, ""); C14957gcv.e(hzp, ""); Bundle bundle = new Bundle(); bundle.putBoolean("SHOW_NEXT_BUTTON_KEY", z); bundle.putSerializable("UPLOAD_METHOD", hzp); fJK.HBt hBt = fJK.Companion; bundle.putString(fJK.HBt.e(), str); DocumentInstructionsFragment documentInstructionsFragment = new DocumentInstructionsFragment(); documentInstructionsFragment.setArguments(bundle); return documentInstructionsFragment; } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { String string; C14957gcv.e(layoutInflater, ""); View inflate = layoutInflater.inflate(R.layout.2131559811, viewGroup, false); ButterKnife.c(this, inflate); if (getArguments() == null) { throw new IllegalArgumentException("Expression 'arguments' must not be null"); } Bundle arguments = getArguments(); if (arguments != null) { C2499afk c2499afk = this.presenter; Button button = null; if (c2499afk == null) { C14957gcv.a(""); c2499afk = null; } c2499afk.e((C2499afk) this); C2499afk c2499afk2 = this.presenter; if (c2499afk2 == null) { C14957gcv.a(""); c2499afk2 = null; } Serializable serializable = arguments.getSerializable("UPLOAD_METHOD"); C14957gcv.d(serializable, ""); Hzp hzp = (Hzp) serializable; C14957gcv.e(hzp, ""); c2499afk2.c = hzp; fJK.HBt hBt = fJK.Companion; String e = fJK.HBt.e(); C14957gcv.e(e, ""); if (arguments == null) { string = ""; } else { string = arguments.getString(e, ""); C14957gcv.c((Object) string, ""); } this.c = fJK.valueOf(string); Button button2 = this.nextButton; if (button2 == null) { C14957gcv.a(""); button2 = null; } button2.setVisibility(!arguments.getBoolean("SHOW_NEXT_BUTTON_KEY") ? 8 : 0); Context context = getContext(); if (context != null) { fJK fjk = this.c; if (fjk == null) { C14957gcv.a(""); fjk = null; } String e2 = fjk.e(context); if (e2 != null) { u(e2); } fJK fjk2 = this.c; if (fjk2 == null) { C14957gcv.a(""); fjk2 = null; } ImageView imageView = this.thumbnail; if (imageView == null) { C14957gcv.a(""); imageView = null; } TextView textView = this.headerText; if (textView == null) { C14957gcv.a(""); textView = null; } TextView textView2 = this.descriptionText; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } fjk2.ayK_(context, imageView, textView, textView2); fJK fjk3 = this.c; if (fjk3 == null) { C14957gcv.a(""); fjk3 = null; } List c = fjk3.c(context); Context context2 = getContext(); if (context2 != null) { LinearLayout linearLayout = this.detailsList; if (linearLayout == null) { C14957gcv.a(""); linearLayout = null; } linearLayout.removeAllViews(); for (C0401Fu c0401Fu : c) { LinearLayout linearLayout2 = this.detailsList; if (linearLayout2 == null) { C14957gcv.a(""); linearLayout2 = null; } linearLayout2.addView(new DocumentInstructionsDetailCustomView(context2, c0401Fu)); Context context3 = getContext(); LinearLayout linearLayout3 = this.detailsList; if (linearLayout3 == null) { C14957gcv.a(""); linearLayout3 = null; } View.inflate(context3, R.layout.2131559335, linearLayout3); } } fJK fjk4 = this.c; if (fjk4 == null) { C14957gcv.a(""); fjk4 = null; } boolean a = fjk4.a(); TextView textView3 = this.listTitle; if (textView3 == null) { C14957gcv.a(""); textView3 = null; } textView3.setVisibility(a ? 0 : 8); Button button3 = this.nextButton; if (button3 != null) { button = button3; } else { C14957gcv.a(""); } button.setOnClickListener(new View.OnClickListener(this) { // from class: o.eGy private DocumentInstructionsFragment b; @Override // android.view.View.OnClickListener public final void onClick(View view) { DocumentInstructionsFragment.c(this.b); } { this.b = this; } }); } } return inflate; } @Override // o.InterfaceC9020dbo public final void d(Hzp hzp) { C14957gcv.e(hzp, ""); FragmentActivity activity = getActivity(); if (activity != null) { activity.setResult(-1, new Intent().putExtra("UPLOAD_METHOD", hzp)); activity.finish(); } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C2499afk c2499afk = this.presenter; if (c2499afk == null) { C14957gcv.a(""); c2499afk = null; } c2499afk.w_(); super.onDestroy(); } public static /* synthetic */ void c(DocumentInstructionsFragment documentInstructionsFragment) { C14957gcv.e(documentInstructionsFragment, ""); final C2499afk c2499afk = documentInstructionsFragment.presenter; if (c2499afk == null) { C14957gcv.a(""); c2499afk = null; } ZI.IeS ieS = new ZI.IeS(c2499afk) { // from class: o.afj private C2499afk b; @Override // o.ZI.IeS public final void e(Object obj) { C2499afk.c(this.b, (InterfaceC9020dbo) obj); } { this.b = c2499afk; } }; if (c2499afk.f != 0) { ieS.e(c2499afk.f); } } }