package com.scb.phone.view.fragment.remittance; import android.content.Context; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.Group; import androidx.fragment.app.FragmentActivity; import androidx.recyclerview.widget.RecyclerView; import com.scb.phone.R; import com.scb.phone.view.adapter.remittance.RemittanceCountryListAdapter; import com.scb.phone.view.fragment.remittance.RemittanceCountrySelectionFragment; import java.util.ArrayList; import java.util.Collections; import java.util.List; import o.AbstractC14961gcz; import o.C1106Vt; import o.C1113Vx; import o.C11332edO; import o.C14866gag; import o.C14881gav; import o.C14957gcv; import o.C14964gdG; import o.C16148leh; import o.C17232uzG; import o.C5850cBQ; import o.InterfaceC12837fIl; import o.InterfaceC12881fJy; import o.InterfaceC13391fZD; import o.InterfaceC13393fZL; import o.InterfaceC14890gbN; import o.InterfaceC14894gbR; import o.InterfaceC16541pFg; import o.InterfaceC9563dmB; import o.VB; import o.Whg; import o.ZI; import o.fZZ; import o.gdE; import o.gdO; import o.qeC; import o.ySa; /* loaded from: classes5.dex */ public final class RemittanceCountrySelectionFragment extends Hilt_RemittanceCountrySelectionFragment implements InterfaceC9563dmB, InterfaceC12881fJy { private final InterfaceC13393fZL c; private RemittanceCountryListAdapter d; private RecyclerView.Sts f; private C16148leh h; private InterfaceC12837fIl j; @InterfaceC13391fZD public C5850cBQ presenter; public static final /* synthetic */ Whg e(RemittanceCountrySelectionFragment remittanceCountrySelectionFragment) { return (Whg) remittanceCountrySelectionFragment.c.e(); } public RemittanceCountrySelectionFragment() { IeS ieS = new IeS(this); C14957gcv.e(ieS, ""); this.c = new fZZ(ieS); } /* loaded from: classes5.dex */ public static final class LWm { private LWm() { } public /* synthetic */ LWm(byte b) { this(); } } /* loaded from: classes5.dex */ static final class IeS extends AbstractC14961gcz implements InterfaceC14890gbN { private RemittanceCountrySelectionFragment c; @Override // o.InterfaceC14890gbN public final /* synthetic */ Whg invoke() { View inflate = this.c.getLayoutInflater().inflate(R.layout.2131559867, (ViewGroup) null, false); int i = R.id.cl_search_container; ConstraintLayout constraintLayout = (ConstraintLayout) qeC.e(inflate, R.id.cl_search_container); if (constraintLayout != null) { i = R.id.et_country_list_search; EditText editText = (EditText) qeC.e(inflate, R.id.et_country_list_search); if (editText != null) { i = R.id.group_country_list; Group group = (Group) qeC.e(inflate, R.id.group_country_list); if (group != null) { i = R.id.include_error; View e = qeC.e(inflate, R.id.include_error); if (e != null) { int i2 = R.id.error_description; TextView textView = (TextView) qeC.e(e, R.id.error_description); if (textView != null) { i2 = R.id.error_title; TextView textView2 = (TextView) qeC.e(e, R.id.error_title); if (textView2 != null) { ySa ysa = new ySa((LinearLayout) e, textView, textView2); int i3 = R.id.iv_clear; ImageView imageView = (ImageView) qeC.e(inflate, R.id.iv_clear); if (imageView != null) { i3 = R.id.rv_country_list; RecyclerView recyclerView = (RecyclerView) qeC.e(inflate, R.id.rv_country_list); if (recyclerView != null) { i3 = R.id.v_search_separator; View e2 = qeC.e(inflate, R.id.v_search_separator); if (e2 != null) { return new Whg((ConstraintLayout) inflate, constraintLayout, editText, group, ysa, imageView, recyclerView, e2); } } } i = i3; } } throw new NullPointerException("Missing required view with ID: ".concat(e.getResources().getResourceName(i2))); } } } } throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i))); } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ IeS(RemittanceCountrySelectionFragment remittanceCountrySelectionFragment) { super(0); this.c = remittanceCountrySelectionFragment; } } @Override // com.scb.phone.view.fragment.remittance.Hilt_RemittanceCountrySelectionFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public final void onAttach(Context context) { C14957gcv.e(context, ""); super.onAttach(context); if (getParentFragment() instanceof InterfaceC12837fIl) { InterfaceC16541pFg parentFragment = getParentFragment(); C14957gcv.d(parentFragment, ""); this.j = (InterfaceC12837fIl) parentFragment; } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); ConstraintLayout constraintLayout = ((Whg) this.c.e()).d; C14957gcv.c(constraintLayout, ""); return constraintLayout; } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { C14957gcv.e(view, ""); super.onViewCreated(view, bundle); C5850cBQ c5850cBQ = this.presenter; if (c5850cBQ == null) { C14957gcv.a(""); c5850cBQ = null; } c5850cBQ.e((C5850cBQ) this); EditText editText = ((Whg) this.c.e()).a; C14957gcv.c(editText, ""); editText.addTextChangedListener(new HBt(this)); ((Whg) this.c.e()).a.setOnEditorActionListener(new TextView.OnEditorActionListener(this) { // from class: o.fxy private RemittanceCountrySelectionFragment d; @Override // android.widget.TextView.OnEditorActionListener public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return RemittanceCountrySelectionFragment.b(this.d, i); } { this.d = this; } }); ((Whg) this.c.e()).e.setOnClickListener(new View.OnClickListener(this) { // from class: o.fxv private RemittanceCountrySelectionFragment b; @Override // android.view.View.OnClickListener public final void onClick(View view2) { RemittanceCountrySelectionFragment.a(this.b); } { this.b = this; } }); } /* JADX WARN: Code restructure failed: missing block: B:62:0x0027, code lost: if ((r9 instanceof android.os.Parcelable) == false) goto L9; */ /* JADX WARN: Removed duplicated region for block: B:11:0x0057 */ /* JADX WARN: Removed duplicated region for block: B:14:0x005f */ /* JADX WARN: Removed duplicated region for block: B:17:0x0089 */ /* JADX WARN: Removed duplicated region for block: B:20:0x009f */ /* JADX WARN: Removed duplicated region for block: B:23:0x00aa */ /* JADX WARN: Removed duplicated region for block: B:26:0x00b9 */ /* JADX WARN: Removed duplicated region for block: B:31:0x0150 */ /* JADX WARN: Removed duplicated region for block: B:35:0x017b */ /* JADX WARN: Removed duplicated region for block: B:36:0x00cb */ /* JADX WARN: Removed duplicated region for block: B:60:0x00ac */ /* JADX WARN: Removed duplicated region for block: B:8:0x0045 */ @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void onActivityCreated(android.os.Bundle r9) { /* Method dump skipped, instructions count: 389 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.remittance.RemittanceCountrySelectionFragment.onActivityCreated(android.os.Bundle):void"); } /* loaded from: classes5.dex */ public static final class HBt implements TextWatcher { private RemittanceCountrySelectionFragment d; @Override // android.text.TextWatcher public final void afterTextChanged(Editable editable) { } @Override // android.text.TextWatcher public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public HBt(RemittanceCountrySelectionFragment remittanceCountrySelectionFragment) { this.d = remittanceCountrySelectionFragment; } @Override // android.text.TextWatcher public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { ImageView imageView = RemittanceCountrySelectionFragment.e(this.d).e; C14957gcv.c(imageView, ""); ImageView imageView2 = imageView; boolean z = String.valueOf(charSequence).length() > 0; C14957gcv.e(imageView2, ""); imageView2.setVisibility(z ? 0 : 8); C5850cBQ c5850cBQ = this.d.presenter; if (c5850cBQ == null) { C14957gcv.a(""); c5850cBQ = null; } String valueOf = String.valueOf(charSequence); C14957gcv.e(valueOf, ""); List list = c5850cBQ.a; ArrayList arrayList = new ArrayList(); for (Object obj : list) { if (obj instanceof C1113Vx) { arrayList.add(obj); } } C17232uzG c17232uzG = new C17232uzG(valueOf, arrayList); C11332edO c11332edO = c5850cBQ.b; gdE a = C11332edO.a(c17232uzG); C5850cBQ.HBt hBt = C5850cBQ.HBt.a; C14957gcv.e(a, ""); C14957gcv.e(hBt, ""); gdO gdo = new gdO(a, hBt); C14957gcv.e(gdo, ""); C14957gcv.e(gdo, ""); List a2 = C14881gav.a((List) C14964gdG.e(gdo, new ArrayList())); if (a2.isEmpty()) { a2 = Collections.singletonList(VB.RVV.a); C14957gcv.c(a2, ""); } final List list2 = a2; ZI.IeS ieS = new ZI.IeS(list2) { // from class: o.cBO private List b; @Override // o.ZI.IeS public final void e(Object obj2) { C5850cBQ.a(this.b, (InterfaceC9563dmB) obj2); } { this.b = list2; } }; if (c5850cBQ.f != 0) { ieS.e(c5850cBQ.f); } } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onSaveInstanceState(Bundle bundle) { C14957gcv.e(bundle, ""); super.onSaveInstanceState(bundle); C16148leh c16148leh = this.h; if (c16148leh == null) { C14957gcv.a(""); c16148leh = null; } bundle.putParcelable("RecyclerViewExpandableItemManager", c16148leh.Oa_()); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroyView() { ((Whg) this.c.e()).i.setItemAnimator(null); ((Whg) this.c.e()).i.setAdapter(null); super.onDestroyView(); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C5850cBQ c5850cBQ = this.presenter; if (c5850cBQ == null) { C14957gcv.a(""); c5850cBQ = null; } c5850cBQ.w_(); super.onDestroy(); } /* loaded from: classes5.dex */ static final class RVV extends AbstractC14961gcz implements InterfaceC14894gbR { private RemittanceCountrySelectionFragment e; @Override // o.InterfaceC14894gbR public final /* synthetic */ C14866gag invoke(C1106Vt c1106Vt) { C1106Vt c1106Vt2 = c1106Vt; C14957gcv.e(c1106Vt2, ""); InterfaceC12837fIl interfaceC12837fIl = this.e.j; if (interfaceC12837fIl != null) { interfaceC12837fIl.c(c1106Vt2); } return C14866gag.c; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ RVV(RemittanceCountrySelectionFragment remittanceCountrySelectionFragment) { super(1); this.e = remittanceCountrySelectionFragment; } } @Override // o.InterfaceC9563dmB public final void b(List list) { C14957gcv.e(list, ""); Group group = ((Whg) this.c.e()).b; C14957gcv.c(group, ""); Group group2 = group; C14957gcv.e(group2, ""); group2.setVisibility(0); LinearLayout linearLayout = ((Whg) this.c.e()).c.d; C14957gcv.c(linearLayout, ""); LinearLayout linearLayout2 = linearLayout; C14957gcv.e(linearLayout2, ""); linearLayout2.setVisibility(8); RemittanceCountryListAdapter remittanceCountryListAdapter = this.d; if (remittanceCountryListAdapter == null) { C14957gcv.a(""); remittanceCountryListAdapter = null; } C14957gcv.e(list, ""); remittanceCountryListAdapter.a = list; remittanceCountryListAdapter.c.e(); remittanceCountryListAdapter.notifyDataSetChanged(); } @Override // o.InterfaceC9563dmB public final void c(List list) { C14957gcv.e(list, ""); RemittanceCountryListAdapter remittanceCountryListAdapter = this.d; if (remittanceCountryListAdapter == null) { C14957gcv.a(""); remittanceCountryListAdapter = null; } C14957gcv.e(list, ""); remittanceCountryListAdapter.a = list; remittanceCountryListAdapter.c.e(); remittanceCountryListAdapter.notifyDataSetChanged(); } @Override // o.InterfaceC9563dmB public final void c() { Group group = ((Whg) this.c.e()).b; C14957gcv.c(group, ""); Group group2 = group; C14957gcv.e(group2, ""); group2.setVisibility(8); LinearLayout linearLayout = ((Whg) this.c.e()).c.d; C14957gcv.c(linearLayout, ""); LinearLayout linearLayout2 = linearLayout; C14957gcv.e(linearLayout2, ""); linearLayout2.setVisibility(0); } @Override // o.InterfaceC12881fJy public final void d() { FragmentActivity activity = getActivity(); C14957gcv.d(activity, ""); View currentFocus = activity.getCurrentFocus(); if (currentFocus != null) { currentFocus.clearFocus(); } } @Override // o.InterfaceC12881fJy public final void i() { aN_(); } public static /* synthetic */ boolean b(RemittanceCountrySelectionFragment remittanceCountrySelectionFragment, int i) { C14957gcv.e(remittanceCountrySelectionFragment, ""); if (i != 3) { return false; } remittanceCountrySelectionFragment.aN_(); return false; } public static /* synthetic */ void a(RemittanceCountrySelectionFragment remittanceCountrySelectionFragment) { C14957gcv.e(remittanceCountrySelectionFragment, ""); ((Whg) remittanceCountrySelectionFragment.c.e()).a.setText(""); } static { new LWm((byte) 0); } }