package com.scb.phone.view.fragment.profilemanagement.accounts; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.Build; 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.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.core.widget.NestedScrollView; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.scb.phone.R; import com.scb.phone.view.activity.cardmanagement.CardActivationActivity; import com.scb.phone.view.activity.investment.scbs.AddAccountConsentActivity; import com.scb.phone.view.activity.profilemanagement.accounts.AddAccountValidateActivity; import com.scb.phone.view.activity.profilemanagement.accounts.VerifyIdentityActivity; import com.scb.phone.view.activity.profilemanagement.manageaccounts.AccountManagementSuccessActivity; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.fragment.profilemanagement.accounts.AddAccountsFragment; import java.util.List; import o.C0443Gr; import o.C11560ehe; import o.C12400exW; import o.C14957gcv; import o.C7831cvk; import o.Heg; import o.InterfaceC0834Plv; import o.InterfaceC13391fZD; import o.InterfaceC9531dlW; import o.PDC; import o.UJ; import o.UN; import o.UU; import o.UV; import o.UY; import o.YwG; import o.eCA; import o.gjJ; import o.huo; import o.qeC; /* loaded from: classes5.dex */ public final class AddAccountsFragment extends Hilt_AddAccountsFragment implements InterfaceC9531dlW { public static final HBt c = new HBt(0); private YwG d; private huo f; private C12400exW g; private boolean h; private huo i; private int j; @InterfaceC13391fZD public C7831cvk presenter; /* loaded from: classes5.dex */ public static final class HBt { private HBt() { } public /* synthetic */ HBt(byte b) { this(); } } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { Parcelable parcelable; C14957gcv.e(view, ""); super.onViewCreated(view, bundle); C7831cvk c7831cvk = this.presenter; C7831cvk c7831cvk2 = null; if (c7831cvk == null) { C14957gcv.a(""); c7831cvk = null; } c7831cvk.e((C7831cvk) this); v("addaccount_landing"); b(false); Bundle arguments = getArguments(); if (arguments != null) { if (Build.VERSION.SDK_INT >= 33) { parcelable = (Parcelable) arguments.getParcelable("com.scb.phone.EXTRA_UNREGISTERACCOUNT", UJ.class); } else { Parcelable parcelable2 = arguments.getParcelable("com.scb.phone.EXTRA_UNREGISTERACCOUNT"); if (!(parcelable2 instanceof UJ)) { parcelable2 = null; } parcelable = (UJ) parcelable2; } UJ uj = (UJ) parcelable; this.h = arguments.getBoolean("com.scb.phone.EXTRA_CONSENT_FLAG", false); this.j = arguments.getInt("com.scb.phone.EXTRA_CONSENT_VERSION"); if (uj != null) { C7831cvk c7831cvk3 = this.presenter; if (c7831cvk3 != null) { c7831cvk2 = c7831cvk3; } else { C14957gcv.a(""); } c7831cvk2.c(uj, this.h, this.j); } else { C7831cvk c7831cvk4 = this.presenter; if (c7831cvk4 != null) { c7831cvk2 = c7831cvk4; } else { C14957gcv.a(""); } c7831cvk2.b(this.h, this.j); } } huo registerForActivityResult = registerForActivityResult(new C11560ehe.Sts(), new InterfaceC0834Plv(this) { // from class: o.fuO private AddAccountsFragment a; @Override // o.InterfaceC0834Plv public final void d(Object obj) { AddAccountsFragment.d(this.a, (Heg) obj); } { this.a = this; } }); C14957gcv.c(registerForActivityResult, ""); this.f = registerForActivityResult; huo registerForActivityResult2 = registerForActivityResult(new C11560ehe.Sts(), new InterfaceC0834Plv(this) { // from class: o.fuS private AddAccountsFragment c; @Override // o.InterfaceC0834Plv public final void d(Object obj) { AddAccountsFragment.a(this.c, (Heg) obj); } { this.c = this; } }); C14957gcv.c(registerForActivityResult2, ""); this.i = registerForActivityResult2; } /* loaded from: classes5.dex */ public static final class LWm implements C12400exW.HBt { private AddAccountsFragment e; LWm(AddAccountsFragment addAccountsFragment) { this.e = addAccountsFragment; } @Override // o.C12400exW.HBt public final void a(UU uu) { C14957gcv.e(uu, ""); C7831cvk c7831cvk = this.e.presenter; if (c7831cvk == null) { C14957gcv.a(""); c7831cvk = null; } c7831cvk.b(uu); } } private final void b(boolean z) { this.g = new C12400exW(new LWm(this), new RVV(this)); getContext(); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(); linearLayoutManager.a(z); YwG ywG = this.d; C14957gcv.e(ywG); RecyclerView recyclerView = ywG.b; recyclerView.setLayoutManager(linearLayoutManager); C12400exW c12400exW = this.g; if (c12400exW == null) { C14957gcv.a(""); c12400exW = null; } recyclerView.setAdapter(c12400exW); recyclerView.setNestedScrollingEnabled(false); recyclerView.d(new eCA(), -1); } /* loaded from: classes5.dex */ public static final class RVV implements C12400exW.RVV { private AddAccountsFragment e; RVV(AddAccountsFragment addAccountsFragment) { this.e = addAccountsFragment; } @Override // o.C12400exW.RVV public final void c(UY uy) { C14957gcv.e(uy, ""); C7831cvk c7831cvk = this.e.presenter; if (c7831cvk == null) { C14957gcv.a(""); c7831cvk = null; } c7831cvk.d(uy); } } @Override // o.InterfaceC9531dlW public final void d(List list) { C14957gcv.e(list, ""); C12400exW c12400exW = this.g; if (c12400exW == null) { C14957gcv.a(""); c12400exW = null; } c12400exW.e(list); YwG ywG = this.d; C14957gcv.e(ywG); ywG.d.b.setOnClickListener(new View.OnClickListener(this) { // from class: o.fuQ private AddAccountsFragment c; @Override // android.view.View.OnClickListener public final void onClick(View view) { AddAccountsFragment.c(this.c); } { this.c = this; } }); } @Override // o.InterfaceC9531dlW public final void c(C0443Gr c0443Gr, UU uu) { C14957gcv.e(c0443Gr, ""); C14957gcv.e(uu, ""); Context context = getContext(); if (context != null) { CardActivationActivity.LWm lWm = CardActivationActivity.b; boolean z = this.h; int i = this.j; Intent intent = new Intent(context, (Class) CardActivationActivity.class); intent.putExtra("EXTRA_INACTIVE_CARD", c0443Gr); intent.putExtra("EXTRA_IS_CARD_X_PRODUCT", true); intent.putExtra("EXTRA_IS_CARD_X_ITEM", uu); intent.putExtra("EXTRA_CONSENT_FLAG", z); intent.putExtra("EXTRA_CONSENT_VERSION", i); context.startActivity(intent); } } @Override // o.InterfaceC9531dlW public final void e(C0443Gr c0443Gr) { C14957gcv.e(c0443Gr, ""); Context context = getContext(); if (context != null) { CardActivationActivity.LWm lWm = CardActivationActivity.b; Intent intent = new Intent(context, (Class) CardActivationActivity.class); intent.putExtra("EXTRA_INACTIVE_CARD", c0443Gr); intent.putExtra("EXTRA_IS_FROM_DEEPLINK_CARD_ACTIVATE", false); context.startActivity(intent); } } @Override // o.InterfaceC9531dlW public final void e() { CustomDialog b = CustomDialog.b(getContext()); String string = getString(R.string.add_accounts_verify_dialog_title); if (gjJ.a(string)) { b.mTitleTextView.setVisibility(0); b.mTitleTextView.setText(string); } String string2 = getString(R.string.add_accounts_verify_dialog_description); if (gjJ.a(string2)) { b.mTextTextView.setVisibility(0); b.mTextTextView.setText(string2); } b.aoO_(getString(R.string.cancel), new DialogInterface.OnClickListener() { // from class: o.fuP @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }).aoU_(getString(R.string.ok), new DialogInterface.OnClickListener(this) { // from class: o.fuR private AddAccountsFragment b; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { AddAccountsFragment.b(this.b); } { this.b = this; } }).show(); } @Override // o.InterfaceC9531dlW public final void c() { Context context = getContext(); if (context != null) { Intent intent = new Intent(context, (Class) VerifyIdentityActivity.class); huo huoVar = this.f; if (huoVar == null) { C14957gcv.a(""); huoVar = null; } huoVar.d(intent, null); } } @Override // o.InterfaceC9531dlW public final void a(List list) { C14957gcv.e(list, ""); Context context = getContext(); if (context != null) { AccountManagementSuccessActivity.b(context, list); } } @Override // o.InterfaceC9531dlW public final void e(UU uu) { C14957gcv.e(uu, ""); Context context = getContext(); if (context != null) { AddAccountValidateActivity.LWm lWm = AddAccountValidateActivity.b; boolean z = this.h; int i = this.j; C14957gcv.e(context, ""); C14957gcv.e(uu, ""); Intent intent = new Intent(context, (Class) AddAccountValidateActivity.class); intent.addFlags(603979776); intent.putExtra("com.scb.phone.EXTRA_CONSENT_FLAG", z); intent.putExtra("com.scb.phone.EXTRA_CONSENT_VERSION", i); intent.putExtra("com.scb.phone.EXTRA_VALIDATE_ACCOUNT", uu); context.startActivity(intent); } } @Override // o.InterfaceC9531dlW public final void b(String str) { C14957gcv.e(str, ""); YwG ywG = this.d; C14957gcv.e(ywG); ywG.d.d.setText(str); } @Override // o.InterfaceC9531dlW public final void d() { YwG ywG = this.d; C14957gcv.e(ywG); PDC pdc = ywG.d; pdc.d.setText(getString(R.string.add_account_empty)); pdc.a.setVisibility(0); pdc.b.setVisibility(8); } @Override // o.InterfaceC9531dlW public final void c(List list) { C14957gcv.e(list, ""); YwG ywG = this.d; C14957gcv.e(ywG); ywG.d.c.setVisibility(8); b(true); d(list); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C7831cvk c7831cvk = this.presenter; huo huoVar = null; if (c7831cvk == null) { C14957gcv.a(""); c7831cvk = null; } c7831cvk.w_(); huo huoVar2 = this.f; if (huoVar2 == null) { C14957gcv.a(""); huoVar2 = null; } huoVar2.e(); huo huoVar3 = this.i; if (huoVar3 == null) { C14957gcv.a(""); } else { huoVar = huoVar3; } huoVar.e(); super.onDestroy(); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroyView() { this.d = null; super.onDestroyView(); } public static /* synthetic */ void b(AddAccountsFragment addAccountsFragment) { C14957gcv.e(addAccountsFragment, ""); C7831cvk c7831cvk = addAccountsFragment.presenter; if (c7831cvk == null) { C14957gcv.a(""); c7831cvk = null; } C7831cvk.a(new Object[]{c7831cvk}, 1433869097, -1433869096, System.identityHashCode(c7831cvk)); } public static /* synthetic */ void c(AddAccountsFragment addAccountsFragment) { C14957gcv.e(addAccountsFragment, ""); huo huoVar = addAccountsFragment.i; if (huoVar == null) { C14957gcv.a(""); huoVar = null; } Context context = addAccountsFragment.getContext(); C7831cvk c7831cvk = addAccountsFragment.presenter; if (c7831cvk == null) { C14957gcv.a(""); c7831cvk = null; } huoVar.d(AddAccountConsentActivity.ahx_(context, c7831cvk.a()), null); } public static /* synthetic */ void d(AddAccountsFragment addAccountsFragment, Heg heg) { C14957gcv.e(addAccountsFragment, ""); C14957gcv.e(heg, ""); if (heg.e == -1) { C7831cvk c7831cvk = addAccountsFragment.presenter; if (c7831cvk == null) { C14957gcv.a(""); c7831cvk = null; } c7831cvk.b(addAccountsFragment.h, addAccountsFragment.j); } } public static /* synthetic */ void a(AddAccountsFragment addAccountsFragment, Heg heg) { C14957gcv.e(addAccountsFragment, ""); C14957gcv.e(heg, ""); if (heg.e != -1 || heg.b == null) { return; } C7831cvk c7831cvk = addAccountsFragment.presenter; if (c7831cvk == null) { C14957gcv.a(""); c7831cvk = null; } Intent intent = heg.b; if (intent != null) { if (Build.VERSION.SDK_INT >= 33) { Bundle extras = intent.getExtras(); if (extras != null) { r1 = (Parcelable) extras.getParcelable("KEY_CARDX_UNREGISTERED", UN.class); } } else { Bundle extras2 = intent.getExtras(); Parcelable parcelable = extras2 != null ? extras2.getParcelable("KEY_CARDX_UNREGISTERED") : null; r1 = (UN) (parcelable instanceof UN ? parcelable : null); } r1 = (UN) r1; } C7831cvk.a(new Object[]{c7831cvk, r1}, 1361189385, -1361189381, System.identityHashCode(c7831cvk)); } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); View inflate = layoutInflater.inflate(R.layout.2131559447, viewGroup, false); int i = R.id.item_cardx_add_account; View e = qeC.e(inflate, R.id.item_cardx_add_account); if (e != null) { int i2 = R.id.bt_add_account_cardx; Button button = (Button) qeC.e(e, R.id.bt_add_account_cardx); if (button != null) { i2 = R.id.iv_empty_icon; ImageView imageView = (ImageView) qeC.e(e, R.id.iv_empty_icon); if (imageView != null) { LinearLayout linearLayout = (LinearLayout) e; i2 = R.id.ll_layout_cardx_button; LinearLayout linearLayout2 = (LinearLayout) qeC.e(e, R.id.ll_layout_cardx_button); if (linearLayout2 != null) { i2 = R.id.tv_cardx_header; TextView textView = (TextView) qeC.e(e, R.id.tv_cardx_header); if (textView != null) { i2 = R.id.tv_cardx_remark; TextView textView2 = (TextView) qeC.e(e, R.id.tv_cardx_remark); if (textView2 != null) { PDC pdc = new PDC(linearLayout, button, imageView, linearLayout, linearLayout2, textView, textView2); i = R.id.ll_layout_account; LinearLayout linearLayout3 = (LinearLayout) qeC.e(inflate, R.id.ll_layout_account); if (linearLayout3 != null) { NestedScrollView nestedScrollView = (NestedScrollView) inflate; i = R.id.rv_add_account; RecyclerView recyclerView = (RecyclerView) qeC.e(inflate, R.id.rv_add_account); if (recyclerView != null) { YwG ywG = new YwG(nestedScrollView, pdc, linearLayout3, nestedScrollView, recyclerView); this.d = ywG; C14957gcv.e(ywG); NestedScrollView nestedScrollView2 = ywG.e; C14957gcv.c(nestedScrollView2, ""); return nestedScrollView2; } } } } } } } 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))); } }