package com.scb.phone.view.fragment.paynow; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import androidx.core.widget.NestedScrollView; import androidx.fragment.app.FragmentActivity; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.HomeActivity; import com.scb.phone.view.activity.bot.BotContactScbActivity; import com.scb.phone.view.activity.facialrecognition.BotCommonFacialRecognitionLandingActivity; import com.scb.phone.view.activity.paynow.PayNowSuccessActivity; import com.scb.phone.view.activity.splash.SplashActivity; import com.scb.phone.view.custom.common.ThaiTextView; import com.scb.phone.view.custom.transferandpay.CustomNoteItem; import com.scb.phone.view.custom.transferandpay.CustomTransferAndPayItem; import com.scb.phone.view.custom.transferandpay.CustomTransferAndPaySource; import com.scb.phone.view.custom.transferandpay.CustomTransferAndPayTarget; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.paynow.PayNowReviewFragment; import o.C11560ehe; import o.C14957gcv; import o.C6583cXR; import o.C7186cjY; import o.EW; import o.Heg; import o.InterfaceC0834Plv; import o.InterfaceC12880fJx; import o.InterfaceC13391fZD; import o.InterfaceC9620dnF; import o.MC; import o.TN; import o.TP; import o.YC; import o.huo; /* loaded from: classes5.dex */ public final class PayNowReviewFragment extends Hilt_PayNowReviewFragment implements InterfaceC9620dnF.IeS { public static final IeS c = new IeS(0); @BindView public CustomTransferAndPaySource accountSource; @BindView public CustomTransferAndPayTarget accountTarget; @BindView public TextView amountToGet; @BindView public LinearLayout amountToGetLayout; @BindView public TextView amountToSend; @BindView public LinearLayout amountToSendLayout; @BindView public CustomTransferAndPayItem conversionRate; private TN d; @BindView public TextView fee; @BindView public LinearLayout feeLayout; private huo h; private huo i; private InterfaceC12880fJx j; @BindView public CustomNoteItem note; @BindView public NestedScrollView nsvReviewPage; @InterfaceC13391fZD public C7186cjY presenter; @BindView public ThaiTextView remark; @BindView public CustomNoteItem transactionDetails; @BindView public TextView tvWarningMessage; @BindView public TextView tvWarningMessageHeader; @BindView public View vEmptyPage; @BindView public LinearLayout warningMessageLayout; /* loaded from: classes5.dex */ public static final class IeS { private IeS() { } public /* synthetic */ IeS(byte b) { this(); } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); return layoutInflater.inflate(R.layout.2131559808, viewGroup, false); } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { C14957gcv.e(view, ""); super.onViewCreated(view, bundle); ((BaseFragment) this).a = ButterKnife.c(this, view); C7186cjY c7186cjY = this.presenter; TextView textView = null; if (c7186cjY == null) { C14957gcv.a(""); c7186cjY = null; } c7186cjY.e((C7186cjY) this); Bundle arguments = getArguments(); if (arguments != null) { TN tn = (TN) arguments.getParcelable("EXTRA_REVIEW_REMITTANCE_DISPLAY"); this.d = tn; if (tn != null) { TP tp = tn.d; CustomTransferAndPaySource customTransferAndPaySource = this.accountSource; if (customTransferAndPaySource == null) { C14957gcv.a(""); customTransferAndPaySource = null; } customTransferAndPaySource.setVisibility(0); customTransferAndPaySource.setSourceName(tp.c); customTransferAndPaySource.setAccountNumber(C6583cXR.b(tp.d, false)); customTransferAndPaySource.setAvatar(tp.a, R.drawable.bankicon_remittance); CustomTransferAndPayTarget customTransferAndPayTarget = this.accountTarget; if (customTransferAndPayTarget == null) { C14957gcv.a(""); customTransferAndPayTarget = null; } customTransferAndPayTarget.setVisibility(0); customTransferAndPayTarget.setTargetName(tn.c.e); customTransferAndPayTarget.setReferenceNumbers(tn.c.d); customTransferAndPayTarget.setAvatar(tn.c.b, R.drawable.bankicon_remittance); CustomTransferAndPayItem customTransferAndPayItem = this.conversionRate; if (customTransferAndPayItem == null) { C14957gcv.a(""); customTransferAndPayItem = null; } String str = tn.b; if (!TextUtils.isEmpty(str)) { customTransferAndPayItem.setVisibility(0); customTransferAndPayItem.setValue(str); } LinearLayout linearLayout = this.amountToSendLayout; if (linearLayout == null) { C14957gcv.a(""); linearLayout = null; } TextView textView2 = this.amountToSend; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } String str2 = tn.e; if (!TextUtils.isEmpty(str2)) { linearLayout.setVisibility(0); textView2.setText(str2); } LinearLayout linearLayout2 = this.amountToGetLayout; if (linearLayout2 == null) { C14957gcv.a(""); linearLayout2 = null; } TextView textView3 = this.amountToGet; if (textView3 == null) { C14957gcv.a(""); textView3 = null; } String str3 = tn.a; if (!TextUtils.isEmpty(str3)) { linearLayout2.setVisibility(0); textView3.setText(str3); } LinearLayout linearLayout3 = this.feeLayout; if (linearLayout3 == null) { C14957gcv.a(""); linearLayout3 = null; } TextView textView4 = this.fee; if (textView4 == null) { C14957gcv.a(""); textView4 = null; } String str4 = tn.i; if (!TextUtils.isEmpty(str4)) { linearLayout3.setVisibility(0); textView4.setText(str4); } CustomNoteItem customNoteItem = this.transactionDetails; if (customNoteItem == null) { C14957gcv.a(""); customNoteItem = null; } a(customNoteItem, R.string.remittance_recipient_purpose_input_title, tn.g); CustomNoteItem customNoteItem2 = this.transactionDetails; if (customNoteItem2 == null) { C14957gcv.a(""); customNoteItem2 = null; } customNoteItem2.topSpace.setVisibility(0); CustomNoteItem customNoteItem3 = this.transactionDetails; if (customNoteItem3 == null) { C14957gcv.a(""); customNoteItem3 = null; } customNoteItem3.setFullDivider(false); CustomNoteItem customNoteItem4 = this.note; if (customNoteItem4 == null) { C14957gcv.a(""); customNoteItem4 = null; } a(customNoteItem4, R.string.remittance_review_note, tn.f); ThaiTextView thaiTextView = this.remark; if (thaiTextView == null) { C14957gcv.a(""); thaiTextView = null; } thaiTextView.setText(tn.h); YC yc = tn.k; if (yc != null) { LinearLayout linearLayout4 = this.warningMessageLayout; if (linearLayout4 == null) { C14957gcv.a(""); linearLayout4 = null; } LinearLayout linearLayout5 = linearLayout4; C14957gcv.e(linearLayout5, ""); linearLayout5.setVisibility(0); TextView textView5 = this.tvWarningMessageHeader; if (textView5 == null) { C14957gcv.a(""); textView5 = null; } textView5.setText(yc.e); TextView textView6 = this.tvWarningMessage; if (textView6 != null) { textView = textView6; } else { C14957gcv.a(""); } textView.setText(yc.c); } } } v("outward_remittance_pp_review"); huo registerForActivityResult = registerForActivityResult(new C11560ehe.Sts(), new InterfaceC0834Plv(this) { // from class: o.frV private PayNowReviewFragment c; @Override // o.InterfaceC0834Plv public final void d(Object obj) { PayNowReviewFragment.e(this.c, (Heg) obj); } { this.c = this; } }); C14957gcv.c(registerForActivityResult, ""); this.h = registerForActivityResult; huo registerForActivityResult2 = registerForActivityResult(new C11560ehe.Sts(), new InterfaceC0834Plv(this) { // from class: o.frX private PayNowReviewFragment b; @Override // o.InterfaceC0834Plv public final void d(Object obj) { PayNowReviewFragment.d(this.b, (Heg) obj); } { this.b = this; } }); C14957gcv.c(registerForActivityResult2, ""); this.i = registerForActivityResult2; } /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.paynow.Hilt_PayNowReviewFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public final void onAttach(Context context) { C14957gcv.e(context, ""); super.onAttach(context); if (context instanceof InterfaceC12880fJx) { this.j = (InterfaceC12880fJx) context; } } private final void a(CustomNoteItem customNoteItem, int i, String str) { if (TextUtils.isEmpty(str)) { return; } customNoteItem.setVisibility(0); customNoteItem.setTitle(getString(i)); customNoteItem.setText(str); customNoteItem.divider.setVisibility(0); } @Override // o.InterfaceC9620dnF.IeS public final void d(EW ew) { C14957gcv.e(ew, ""); Context context = getContext(); if (context != null) { PayNowSuccessActivity.LWm lWm = PayNowSuccessActivity.b; context.startActivity(PayNowSuccessActivity.LWm.akk_(context, ew)); } } @Override // o.InterfaceC9620dnF.IeS public final void a() { FragmentActivity activity = getActivity(); if (activity != null) { activity.setResult(0); activity.finish(); } } @Override // o.InterfaceC9620dnF.IeS public final void c() { FragmentActivity activity = getActivity(); if (activity != null) { activity.setResult(-1); activity.finish(); } } @Override // o.InterfaceC9620dnF.IeS public final void c(String str, String str2) { C14957gcv.e(str, ""); C14957gcv.e(str2, ""); Context context = getContext(); if (context != null) { huo huoVar = this.h; if (huoVar == null) { C14957gcv.a(""); huoVar = null; } BotContactScbActivity.IeS ieS = BotContactScbActivity.b; huoVar.d(BotContactScbActivity.IeS.YE_(context, str, str2), null); } } @Override // o.InterfaceC9620dnF.IeS public final void a(MC mc) { C14957gcv.e(mc, ""); Context context = getContext(); if (context != null) { huo huoVar = this.i; if (huoVar == null) { C14957gcv.a(""); huoVar = null; } BotCommonFacialRecognitionLandingActivity.LWm lWm = BotCommonFacialRecognitionLandingActivity.b; huoVar.d(BotCommonFacialRecognitionLandingActivity.LWm.afq_(context, mc), null); } } @Override // o.InterfaceC9620dnF.IeS public final void d() { Context context = getContext(); if (context != null) { startActivity((Intent) HomeActivity.e(new Object[]{context}, -1290522472, 1290522474, (int) System.currentTimeMillis())); } } @Override // com.scb.phone.view.fragment.BaseFragment, o.InterfaceC9620dnF.IeS public final void aI_() { FragmentActivity activity = getActivity(); if (activity != null) { SplashActivity.b(new Object[]{activity}, 1199803597, -1199803588, (int) System.currentTimeMillis()); } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroyView() { C7186cjY c7186cjY = this.presenter; huo huoVar = null; if (c7186cjY == null) { C14957gcv.a(""); c7186cjY = null; } c7186cjY.w_(); huo huoVar2 = this.h; if (huoVar2 == null) { C14957gcv.a(""); huoVar2 = null; } huoVar2.e(); huo huoVar3 = this.i; if (huoVar3 == null) { C14957gcv.a(""); } else { huoVar = huoVar3; } huoVar.e(); super.onDestroyView(); } public static /* synthetic */ void e(PayNowReviewFragment payNowReviewFragment, Heg heg) { FragmentActivity activity; C14957gcv.e(payNowReviewFragment, ""); C14957gcv.e(heg, ""); if (heg.e != 0 || (activity = payNowReviewFragment.getActivity()) == null) { return; } activity.setResult(0); activity.finish(); } public static /* synthetic */ void d(PayNowReviewFragment payNowReviewFragment, Heg heg) { FragmentActivity activity; C14957gcv.e(payNowReviewFragment, ""); C14957gcv.e(heg, ""); if (heg.e == -1) { NestedScrollView nestedScrollView = payNowReviewFragment.nsvReviewPage; C7186cjY c7186cjY = null; if (nestedScrollView == null) { C14957gcv.a(""); nestedScrollView = null; } NestedScrollView nestedScrollView2 = nestedScrollView; C14957gcv.e(nestedScrollView2, ""); nestedScrollView2.setVisibility(8); View view = payNowReviewFragment.vEmptyPage; if (view == null) { C14957gcv.a(""); view = null; } C14957gcv.e(view, ""); view.setVisibility(0); InterfaceC12880fJx interfaceC12880fJx = payNowReviewFragment.j; if (interfaceC12880fJx == null) { C14957gcv.a(""); interfaceC12880fJx = null; } interfaceC12880fJx.j(); payNowReviewFragment.y(); Intent intent = heg.b; boolean booleanExtra = intent != null ? intent.getBooleanExtra("com.scb.phone.EXTRA_IS_FACE_VALIDATE", false) : false; TN tn = payNowReviewFragment.d; if (tn != null) { C7186cjY c7186cjY2 = payNowReviewFragment.presenter; if (c7186cjY2 != null) { c7186cjY = c7186cjY2; } else { C14957gcv.a(""); } c7186cjY.b(tn, booleanExtra); return; } return; } if (heg.e != 0 || (activity = payNowReviewFragment.getActivity()) == null) { return; } activity.setResult(0); activity.finish(); } @OnClick public final void onConfirmClicked() { TN tn = this.d; if (tn != null) { C7186cjY c7186cjY = this.presenter; if (c7186cjY == null) { C14957gcv.a(""); c7186cjY = null; } c7186cjY.b(tn, false); } } }