package com.scb.phone.view.fragment.profilemanagement.manageaccounts; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.activity.PreLoadCheckActivity; import com.scb.phone.view.activity.investment.scbs.AddAccountConsentActivity; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.fragment.profilemanagement.manageaccounts.AccountManagementFragment; import java.util.List; import o.AW; import o.C0690Mh; import o.C10457eEr; import o.C12402exY; import o.C12914fKz; import o.C15715hv; import o.C7773cue; import o.C7968cyO; import o.InterfaceC13391fZD; import o.InterfaceC8970dar; import o.Pag; import o.UU; import o.UV; import o.WEM; import o.ZI; import o.eCA; import o.gHK; import o.gjJ; import o.jwh; import o.wRi; /* loaded from: classes5.dex */ public class AccountManagementFragment extends Hilt_AccountManagementFragment implements InterfaceC8970dar.RVV { private CustomDialog c; private C12402exY d; @BindView View layoutEmptyAccount; @InterfaceC13391fZD public C7773cue presenter; @BindView RecyclerView recyclerView; public static AccountManagementFragment h() { Bundle bundle = new Bundle(); AccountManagementFragment accountManagementFragment = new AccountManagementFragment(); accountManagementFragment.setArguments(bundle); return accountManagementFragment; } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559432, viewGroup, false); ButterKnife.c(this, inflate); v("manageaccount_landing"); if (this.d == null) { this.d = new C12402exY(gHK.JURISTIC == (getActivity() instanceof PreLoadCheckActivity ? ((PreLoadCheckActivity) getActivity()).al() : null), new C12402exY.RVV(this) { // from class: com.scb.phone.view.fragment.profilemanagement.manageaccounts.AccountManagementFragment.1 private AccountManagementFragment c; { this.c = this; } @Override // o.C12402exY.RVV public final void a(final UU uu) { String string; String string2; String string3; String string4; final C7773cue c7773cue = this.c.presenter; if (15 == uu.s) { string = c7773cue.h.getString(C15715hv.tOB.account_management_delete_title_type_debit_card); string2 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_message_type_debit_card); string3 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_positive_label); string4 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_negative_label); } else if (2 == uu.s) { string = c7773cue.h.getString(C15715hv.tOB.account_management_delete_title_type_deposit); string2 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_message_type_deposit); string3 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_deposit_positive_label); string4 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_deposit_negative_label); } else { string = c7773cue.h.getString(C15715hv.tOB.account_management_delete_title); string2 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_message); string3 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_positive_label); string4 = c7773cue.h.getString(C15715hv.tOB.account_management_delete_negative_label); } final String str = string3; final String str2 = string4; final String str3 = string; final String str4 = string2; ZI.IeS ieS = new ZI.IeS(c7773cue, str3, str4, str, str2, uu) { // from class: o.cud private String a; private String b; private String c; private C7773cue d; private String e; private UU g; @Override // o.ZI.IeS public final void e(Object obj) { C7773cue.a(this.d, this.b, this.e, this.c, this.a, this.g, (InterfaceC8970dar.RVV) obj); } { this.d = c7773cue; this.b = str3; this.e = str4; this.c = str; this.a = str2; this.g = uu; } }; if (c7773cue.f != 0) { ieS.e(c7773cue.f); } } @Override // o.C12402exY.RVV public final void e(UU uu, String str) { final C7773cue c7773cue = this.c.presenter; if (c7773cue.f != 0) { c7773cue.f.y(); } jwh jwhVar = c7773cue.b; AW aw = c7773cue.i; jwhVar.c(AW.a(uu, str)); jwh jwhVar2 = c7773cue.b; jwhVar2.d(jwhVar2.i, new wRi.LWm(c7773cue) { // from class: o.cue.5 private C7773cue c; { this.c = c7773cue; } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final /* synthetic */ void onNext(Object obj) { super.onNext((Pag) obj); C7773cue c7773cue2 = this.c; c7773cue2.b.b(); jwh jwhVar3 = c7773cue2.b; jwhVar3.d(jwhVar3.i, new AnonymousClass4(c7773cue2)); } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final void onError(Throwable th) { super.onError(th); C7773cue.d(this.c, th); C7773cue.i(this.c); } }); } @Override // o.C12402exY.RVV public final void d(UU uu) { this.c.d.c(uu); } }, new C12402exY.IeS(this) { // from class: o.fvc private AccountManagementFragment e; @Override // o.C12402exY.IeS public final void d() { AccountManagementFragment.e(this.e); } { this.e = this; } }); } getContext(); this.recyclerView.setLayoutManager(new LinearLayoutManager()); this.recyclerView.setItemAnimator(new WEM()); this.recyclerView.setAdapter(this.d); this.recyclerView.setNestedScrollingEnabled(false); this.recyclerView.d(new eCA(), -1); this.presenter.e((C7773cue) this); final C7773cue c7773cue = this.presenter; boolean z = gHK.JURISTIC == (getActivity() instanceof PreLoadCheckActivity ? ((PreLoadCheckActivity) getActivity()).al() : null); c7773cue.c = z; C7968cyO p = c7773cue.a.a.p(); List e = c7773cue.e.e(p, c7773cue.b.d.T(), z); c7773cue.d = e; if (e.isEmpty() && p != null && !p.h.b) { ZI.IeS ieS = new ZI.IeS() { // from class: o.cuh @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8970dar.RVV) obj).c(); } }; if (c7773cue.f != 0) { ieS.e(c7773cue.f); } } ZI.IeS ieS2 = new ZI.IeS(c7773cue) { // from class: o.cug private C7773cue a; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8970dar.RVV) obj).e(this.a.d); } { this.a = c7773cue; } }; if (c7773cue.f != 0) { ieS2.e(c7773cue.f); } return inflate; } @Override // o.InterfaceC8970dar.RVV public final void e(List list) { this.d.e(list); } @Override // o.InterfaceC8970dar.RVV public final void d(String str, String str2, String str3, String str4, final C0690Mh c0690Mh) { CustomDialog customDialog = this.c; if (customDialog != null) { customDialog.dismiss(); } CustomDialog b = CustomDialog.b(getContext()); if (gjJ.a(str)) { b.mTitleTextView.setVisibility(0); b.mTitleTextView.setText(str); } if (gjJ.a(str2)) { b.mTextTextView.setVisibility(0); b.mTextTextView.setText(str2); } this.c = b; b.aoU_(str3, new DialogInterface.OnClickListener(c0690Mh) { // from class: o.fvh private C0690Mh a; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { AccountManagementFragment.awO_(this.a, dialogInterface); } { this.a = c0690Mh; } }); this.c.aoO_(str4, new DialogInterface.OnClickListener() { // from class: o.fvd @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }); this.c.setCancelable(false); this.c.show(); } public static /* synthetic */ void awO_(C0690Mh c0690Mh, DialogInterface dialogInterface) { dialogInterface.dismiss(); c0690Mh.d.run(); } @Override // o.InterfaceC8970dar.RVV public final void e(int i) { String string; if (i == 1) { string = getString(R.string.account_management_last_account_errror_message); } else { string = i == 0 ? getString(R.string.account_management_mutual_fund_errror_message) : ""; } String str = string; if (getActivity() != null) { C12914fKz.e(new Object[]{getActivity(), Integer.valueOf(R.id.view_group_root), Integer.valueOf(R.drawable.error), str, Integer.valueOf(R.color.f2852131099792), 0}, 1796001485, -1796001467, R.id.view_group_root); } } @Override // o.InterfaceC8970dar.RVV public final void b(String str) { if (getActivity() != null) { C12914fKz.e(new Object[]{getActivity(), Integer.valueOf(R.id.view_group_root), Integer.valueOf(R.drawable.error), str, Integer.valueOf(R.color.f2852131099792), 0}, 1796001485, -1796001467, R.id.view_group_root); } } @Override // o.InterfaceC8970dar.RVV public final void i() { j(getString(R.string.account_management_delete_success)); } @Override // o.InterfaceC8970dar.RVV public final void b() { if (getActivity() != null) { getActivity().finish(); } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { super.onDestroy(); this.presenter.w_(); } @Override // o.InterfaceC8970dar.RVV public final void d() { if (getContext() != null) { AddAccountConsentActivity.a(getContext()); } } @Override // o.InterfaceC8970dar.RVV public final void a() { C10457eEr.aqd_(this, new Intent("com.scb.phone/BROADCAST_HOME_ACTIVITY_REFRESH")); } @Override // o.InterfaceC8970dar.RVV public final void e() { C10457eEr.aqd_(this, new Intent("com.scb.phone/BROADCAST_NICKNAME_CHANGED")); } @Override // o.InterfaceC8970dar.RVV public final void c() { this.layoutEmptyAccount.setVisibility(0); } public static /* synthetic */ void e(AccountManagementFragment accountManagementFragment) { C7773cue c7773cue = accountManagementFragment.presenter; ZI.IeS ieS = new ZI.IeS() { // from class: o.cui @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8970dar.RVV) obj).d(); } }; if (c7773cue.f != 0) { ieS.e(c7773cue.f); } } }