package com.scb.phone.view.fragment.cardmanagement; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.RadioButton; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.cardmanagement.StatementChannelCommonActivity; import com.scb.phone.view.activity.emailverification.ManageEmailLandingActivity; import com.scb.phone.view.custom.cardmanagement.CustomStatementChannelViewComponent; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.fragment.cardmanagement.StatementChannelChooseAddressFragment; import java.util.ArrayList; import o.C0367Fb; import o.C14957gcv; import o.C2962aoW; import o.C2963aoX; import o.C3020apc; import o.C3021apd; import o.InterfaceC13391fZD; import o.InterfaceC9068dcj; import o.ZI; import o.pug; /* loaded from: classes5.dex */ public final class StatementChannelChooseAddressFragment extends Hilt_StatementChannelChooseAddressFragment implements InterfaceC9068dcj.RVV, CustomStatementChannelViewComponent.LWm { public static final IeS c = new IeS(0); @BindView public Button btnNext; private String d; private C0367Fb f; private String g; private ArrayList h; private String i; @InterfaceC13391fZD public C2962aoW presenter; @BindView public CustomStatementChannelViewComponent viewAddNewAddress; @BindView public CustomStatementChannelViewComponent viewAddress; /* loaded from: classes5.dex */ public static final class IeS { private IeS() { } public /* synthetic */ IeS(byte b) { this(); } } @Override // androidx.fragment.app.Fragment public final void onResume() { super.onResume(); final C2962aoW c2962aoW = this.presenter; if (c2962aoW == null) { C14957gcv.a(""); c2962aoW = null; } String str = c2962aoW.c; if (str != null) { String u = c2962aoW.h.b.u(); if (u == null) { u = ""; } if (C14957gcv.b((Object) str, (Object) u)) { if (!C14957gcv.b(c2962aoW.a, Boolean.valueOf(c2962aoW.e.d()))) { ZI.IeS ieS = new ZI.IeS(c2962aoW) { // from class: o.aoY private C2962aoW b; @Override // o.ZI.IeS public final void e(Object obj) { C2962aoW.i(this.b, (InterfaceC9068dcj.RVV) obj); } { this.b = c2962aoW; } }; if (c2962aoW.f != 0) { ieS.e(c2962aoW.f); } } } else if (c2962aoW.e.d()) { ZI.IeS ieS2 = new ZI.IeS(c2962aoW) { // from class: o.apa private C2962aoW d; @Override // o.ZI.IeS public final void e(Object obj) { C2962aoW.b(this.d, (InterfaceC9068dcj.RVV) obj); } { this.d = c2962aoW; } }; if (c2962aoW.f != 0) { ieS2.e(c2962aoW.f); } } else { String u2 = c2962aoW.h.b.u(); if ((u2 != null ? u2 : "").length() > 0) { C3021apd c3021apd = new C3021apd(c2962aoW); if (c2962aoW.f != 0) { c3021apd.e(c2962aoW.f); } C2963aoX c2963aoX = new C2963aoX(); if (c2962aoW.f != 0) { c2963aoX.e(c2962aoW.f); } } else { C3020apc c3020apc = new C3020apc(c2962aoW); if (c2962aoW.f != 0) { c3020apc.e(c2962aoW.f); } } } c2962aoW.c = null; c2962aoW.a = null; } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); return layoutInflater.inflate(R.layout.2131559938, viewGroup, false); } @Override // androidx.fragment.app.Fragment public final void onCreate(Bundle bundle) { String string; String string2; super.onCreate(bundle); Bundle arguments = getArguments(); if (arguments != null) { C14957gcv.e("EXTRA_CHANNEL_KEY", ""); if (arguments == null) { string = ""; } else { string = arguments.getString("EXTRA_CHANNEL_KEY", ""); C14957gcv.c((Object) string, ""); } this.i = string; C14957gcv.e("EXTRA_ADDRESS_KEY", ""); if (arguments == null) { string2 = ""; } else { string2 = arguments.getString("EXTRA_ADDRESS_KEY", ""); C14957gcv.c((Object) string2, ""); } this.d = string2; C0367Fb c0367Fb = (C0367Fb) arguments.getParcelable("EXTRA_CREDIT_CARD_DISPLAY_KEY"); if (c0367Fb != null) { C14957gcv.c(c0367Fb, ""); this.f = c0367Fb; } ArrayList parcelableArrayList = arguments.getParcelableArrayList("EXTRA_CREDIT_CARD_DISPLAY_KEY_LIST"); if (parcelableArrayList != null) { C14957gcv.c(parcelableArrayList, ""); this.h = parcelableArrayList; } } } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { C14957gcv.e(view, ""); super.onViewCreated(view, bundle); ButterKnife.c(this, view); final C2962aoW c2962aoW = this.presenter; ArrayList arrayList = null; if (c2962aoW == null) { C14957gcv.a(""); c2962aoW = null; } c2962aoW.e((C2962aoW) this); C0367Fb c0367Fb = this.f; if (c0367Fb == null) { C14957gcv.a(""); c0367Fb = null; } ArrayList arrayList2 = this.h; if (arrayList2 == null) { C14957gcv.a(""); } else { arrayList = arrayList2; } C14957gcv.e(c0367Fb, ""); C14957gcv.e(arrayList, ""); c2962aoW.b = c0367Fb; c2962aoW.d = arrayList; ZI.IeS ieS = new ZI.IeS() { // from class: o.aph @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9068dcj.RVV) obj).c(); } }; if (c2962aoW.f != 0) { ieS.e(c2962aoW.f); } ZI.IeS ieS2 = new ZI.IeS(c2962aoW) { // from class: o.aoV private C2962aoW b; @Override // o.ZI.IeS public final void e(Object obj) { C2962aoW.e(this.b, (InterfaceC9068dcj.RVV) obj); } { this.b = c2962aoW; } }; if (c2962aoW.f != 0) { ieS2.e(c2962aoW.f); } ZI.IeS ieS3 = new ZI.IeS() { // from class: o.aoZ @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9068dcj.RVV) obj).b(); } }; if (c2962aoW.f != 0) { ieS3.e(c2962aoW.f); } ZI.IeS ieS4 = new ZI.IeS(c2962aoW) { // from class: o.apb private C2962aoW b; @Override // o.ZI.IeS public final void e(Object obj) { C2962aoW.f(this.b, (InterfaceC9068dcj.RVV) obj); } { this.b = c2962aoW; } }; if (c2962aoW.f != 0) { ieS4.e(c2962aoW.f); } } @Override // o.InterfaceC9068dcj.RVV public final void e() { e("EXTRA_SELECT_ADD_NEW_ADDRESS_KEY"); } @Override // o.InterfaceC9068dcj.RVV public final void d() { e("EXTRA_SELECT_ADDRESS_KEY"); } @OnClick public final void onClickNext() { final C2962aoW c2962aoW = this.presenter; final String str = null; if (c2962aoW == null) { C14957gcv.a(""); c2962aoW = null; } String str2 = this.g; if (str2 == null) { C14957gcv.a(""); } else { str = str2; } C14957gcv.e(str, ""); ZI.IeS ieS = new ZI.IeS(str, c2962aoW) { // from class: o.apf private String a; private C2962aoW b; @Override // o.ZI.IeS public final void e(Object obj) { C2962aoW.b(this.a, this.b, (InterfaceC9068dcj.RVV) obj); } { this.a = str; this.b = c2962aoW; } }; if (c2962aoW.f != 0) { ieS.e(c2962aoW.f); } } @Override // o.InterfaceC9068dcj.RVV public final void c(C0367Fb c0367Fb, ArrayList arrayList, String str) { C14957gcv.e(c0367Fb, ""); C14957gcv.e(arrayList, ""); C14957gcv.e(str, ""); Context context = getContext(); if (context != null) { StatementChannelCommonActivity.HBt hBt = StatementChannelCommonActivity.f6647o; String str2 = this.i; if (str2 == null) { C14957gcv.a(""); str2 = null; } context.startActivity(StatementChannelCommonActivity.HBt.Zm_(context, c0367Fb, arrayList, str2, str)); } } @Override // com.scb.phone.view.custom.cardmanagement.CustomStatementChannelViewComponent.LWm public final void e(String str) { C14957gcv.e(str, ""); this.g = str; CustomStatementChannelViewComponent customStatementChannelViewComponent = this.viewAddress; RadioButton radioButton = null; if (customStatementChannelViewComponent == null) { C14957gcv.a(""); customStatementChannelViewComponent = null; } RadioButton radioButton2 = customStatementChannelViewComponent.cbSelect; if (radioButton2 == null) { C14957gcv.a(""); radioButton2 = null; } radioButton2.setChecked(C14957gcv.b((Object) str, (Object) "EXTRA_SELECT_ADDRESS_KEY")); CustomStatementChannelViewComponent customStatementChannelViewComponent2 = this.viewAddNewAddress; if (customStatementChannelViewComponent2 == null) { C14957gcv.a(""); customStatementChannelViewComponent2 = null; } RadioButton radioButton3 = customStatementChannelViewComponent2.cbSelect; if (radioButton3 != null) { radioButton = radioButton3; } else { C14957gcv.a(""); } radioButton.setChecked(C14957gcv.b((Object) str, (Object) "EXTRA_SELECT_ADD_NEW_ADDRESS_KEY")); } @Override // o.InterfaceC9068dcj.RVV public final void c(boolean z, String str) { C14957gcv.e(str, ""); CustomStatementChannelViewComponent customStatementChannelViewComponent = this.viewAddress; if (customStatementChannelViewComponent == null) { C14957gcv.a(""); customStatementChannelViewComponent = null; } customStatementChannelViewComponent.setKey("EXTRA_SELECT_ADDRESS_KEY"); customStatementChannelViewComponent.b(false); customStatementChannelViewComponent.setTitle(str); String string = getString(R.string.ccr_email_already_verified_in_easy); C14957gcv.c((Object) string, ""); customStatementChannelViewComponent.setRemark(string); customStatementChannelViewComponent.setListener(this); customStatementChannelViewComponent.setVisibility(!z ? 8 : 0); } @Override // o.InterfaceC9068dcj.RVV public final void b() { CustomStatementChannelViewComponent customStatementChannelViewComponent = this.viewAddNewAddress; if (customStatementChannelViewComponent == null) { C14957gcv.a(""); customStatementChannelViewComponent = null; } customStatementChannelViewComponent.setKey("EXTRA_SELECT_ADD_NEW_ADDRESS_KEY"); customStatementChannelViewComponent.b(true); String string = getString(R.string.ccr_add_new_email); C14957gcv.c((Object) string, ""); customStatementChannelViewComponent.setTitle(string); String string2 = getString(R.string.ccr_add_new_email_remark); C14957gcv.c((Object) string2, ""); customStatementChannelViewComponent.setRemark(string2); customStatementChannelViewComponent.setListener(this); customStatementChannelViewComponent.setVisibility(0); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C2962aoW c2962aoW = this.presenter; C2962aoW c2962aoW2 = null; if (c2962aoW == null) { C14957gcv.a(""); c2962aoW = null; } c2962aoW.c = null; c2962aoW.a = null; C2962aoW c2962aoW3 = this.presenter; if (c2962aoW3 != null) { c2962aoW2 = c2962aoW3; } else { C14957gcv.a(""); } c2962aoW2.w_(); super.onDestroy(); } @Override // o.InterfaceC9068dcj.RVV public final void a() { C2962aoW c2962aoW = this.presenter; if (c2962aoW == null) { C14957gcv.a(""); c2962aoW = null; } String u = c2962aoW.h.b.u(); c2962aoW.c = u != null ? u : ""; c2962aoW.a = Boolean.valueOf(c2962aoW.e.d()); Context context = getContext(); if (context != null) { startActivityForResult(ManageEmailLandingActivity.aeX_(context), 119); } } @Override // o.InterfaceC9068dcj.RVV public final void g() { Context context = getContext(); if (context != null) { CustomDialog b = CustomDialog.b(context); b.setCancelable(false); b.c(R.string.confirm_to_receive_e_statements_via_new_email).d(R.string.confirm_to_receive_e_statements_via_new_email_desc).aoT_(R.string.ok, new DialogInterface.OnClickListener(this) { // from class: o.eJz private StatementChannelChooseAddressFragment e; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { StatementChannelChooseAddressFragment.b(this.e); } { this.e = this; } }).show(); } } @Override // o.InterfaceC9068dcj.RVV public final void e(final InterfaceC9068dcj.LWm lWm) { C14957gcv.e(lWm, ""); Context context = getContext(); if (context != null) { ((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(context).c(R.string.ccr_email_verification_title).d(R.string.change_statement_not_verify_email_desc), Integer.valueOf(R.string.ccr_email_verification_cancel_btn), new DialogInterface.OnClickListener(lWm) { // from class: o.eJv private InterfaceC9068dcj.LWm e; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { C14957gcv.e(this.e, ""); } { this.e = lWm; } }})).aoT_(R.string.ccr_email_verification_ok_btn, new DialogInterface.OnClickListener(lWm) { // from class: o.eJC private InterfaceC9068dcj.LWm c; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { StatementChannelChooseAddressFragment.c(this.c); } { this.c = lWm; } }).show(); } } @Override // o.InterfaceC9068dcj.RVV public final void c() { c("change_stmt_channel_chooseemail", new pug[0]); } public static /* synthetic */ void b(StatementChannelChooseAddressFragment statementChannelChooseAddressFragment) { C14957gcv.e(statementChannelChooseAddressFragment, ""); C0367Fb c0367Fb = statementChannelChooseAddressFragment.f; String str = null; if (c0367Fb == null) { C14957gcv.a(""); c0367Fb = null; } ArrayList arrayList = statementChannelChooseAddressFragment.h; if (arrayList == null) { C14957gcv.a(""); arrayList = null; } String str2 = statementChannelChooseAddressFragment.d; if (str2 == null) { C14957gcv.a(""); } else { str = str2; } statementChannelChooseAddressFragment.c(c0367Fb, arrayList, str); } public static /* synthetic */ void c(InterfaceC9068dcj.LWm lWm) { C14957gcv.e(lWm, ""); lWm.b(); } }