package com.scb.phone.view.fragment.sme.gifting; 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 com.scb.phone.view.activity.BaseActivity; import com.scb.phone.view.activity.landingpage.PartnerWebViewActivity; import com.scb.phone.view.activity.sme.gifting.GiftRecipientActivity; import o.C0915Rl; import o.C12536f; import o.C16124lSp; import o.C6134cJo; import o.C6583cXR; import o.InterfaceC13391fZD; import o.InterfaceC6673cZp; import o.WG; import o.WM; import o.ZI; /* loaded from: classes5.dex */ public class GiftingPresentTransferInputFragment extends Hilt_GiftingPresentTransferInputFragment implements InterfaceC6673cZp.RVV { @InterfaceC13391fZD public C6134cJo giftPresentTransferInputPresenter; public static GiftingPresentTransferInputFragment e(WM wm) { Bundle bundle = new Bundle(); bundle.putParcelable("GIFT_TRANSFER_DISPLAY", wm); GiftingPresentTransferInputFragment giftingPresentTransferInputFragment = new GiftingPresentTransferInputFragment(); giftingPresentTransferInputFragment.setArguments(bundle); return giftingPresentTransferInputFragment; } @Override // com.scb.phone.view.fragment.sme.gifting.BaseGiftTransferInputFragment, androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View onCreateView = super.onCreateView(layoutInflater, viewGroup, bundle); this.giftPresentTransferInputPresenter.e((C6134cJo) this); C6134cJo c6134cJo = this.giftPresentTransferInputPresenter; final WM wm = (WM) getArguments().getParcelable("GIFT_TRANSFER_DISPLAY"); c6134cJo.b = wm; if (c6134cJo.f != 0) { ZI.IeS ieS = new ZI.IeS(wm) { // from class: o.cJs private WM c; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6673cZp.RVV) obj).a(this.c); } { this.c = wm; } }; if (c6134cJo.f != 0) { ieS.e(c6134cJo.f); } } return onCreateView; } @Override // com.scb.phone.view.fragment.sme.gifting.BaseGiftTransferInputFragment protected final void c(final WG wg) { C6134cJo c6134cJo = this.giftPresentTransferInputPresenter; c6134cJo.d = wg; if (wg != null) { if (c6134cJo.f != 0) { ZI.IeS ieS = new ZI.IeS(wg) { // from class: o.cJu private WG e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6673cZp.RVV) obj).b(this.e); } { this.e = wg; } }; if (c6134cJo.f != 0) { ieS.e(c6134cJo.f); return; } return; } return; } if (c6134cJo.f != 0) { ZI.IeS ieS2 = new ZI.IeS() { // from class: o.cJx @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6673cZp.RVV) obj).e(); } }; if (c6134cJo.f != 0) { ieS2.e(c6134cJo.f); } } } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.scb.phone.view.fragment.sme.gifting.BaseGiftTransferInputFragment public final void g() { C6134cJo c6134cJo = this.giftPresentTransferInputPresenter; boolean isEnabled = this.sendGiftButton.isEnabled(); if (c6134cJo.f != 0) { if (isEnabled != (c6134cJo.d != null)) { ZI.IeS ieS = new ZI.IeS() { // from class: o.cJw @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6673cZp.RVV) obj).f(); } }; if (c6134cJo.f != 0) { ieS.e(c6134cJo.f); } } } } @Override // com.scb.phone.view.fragment.sme.gifting.BaseGiftTransferInputFragment protected final void j() { C6134cJo c6134cJo = this.giftPresentTransferInputPresenter; String obj = this.noteEditText.mNoteEditText.getText().toString(); if (TextUtils.isEmpty(obj) || ((Boolean) C6583cXR.c(new Object[]{obj}, -1032102340, 1032102340, (int) System.currentTimeMillis())).booleanValue()) { c6134cJo.c = obj; if (c6134cJo.f != 0) { c6134cJo.f.y(); } C16124lSp c16124lSp = c6134cJo.a; C12536f e = C12536f.e(); e.d = c6134cJo.d.a; c16124lSp.e(e); C16124lSp c16124lSp2 = c6134cJo.a; c16124lSp2.d(c16124lSp2.i, new C6134cJo.RVV(c6134cJo, (byte) 0)); return; } if (c6134cJo.f != 0) { ZI.IeS ieS = new ZI.IeS() { // from class: o.cJt @Override // o.ZI.IeS public final void e(Object obj2) { ((InterfaceC6673cZp.RVV) obj2).b(); } }; if (c6134cJo.f != 0) { ieS.e(c6134cJo.f); } } } @Override // com.scb.phone.view.fragment.sme.gifting.BaseGiftTransferInputFragment protected void onPreviewButtonClicked() { ((BaseActivity) getActivity()).scbAnalytics.c("gifting_input_preview"); final C6134cJo c6134cJo = this.giftPresentTransferInputPresenter; final String obj = this.noteEditText.mNoteEditText.getText().toString(); if (c6134cJo.f != 0) { ZI.IeS ieS = new ZI.IeS(c6134cJo, obj) { // from class: o.cJv private C6134cJo a; private String c; @Override // o.ZI.IeS public final void e(Object obj2) { InterfaceC6673cZp.RVV rvv = (InterfaceC6673cZp.RVV) obj2; rvv.a(r0.e.a(r0.b, "present", this.a.a.a.J(), this.c)); } { this.a = c6134cJo; this.c = obj; } }; if (c6134cJo.f != 0) { ieS.e(c6134cJo.f); } } } @Override // o.InterfaceC6673cZp.RVV public final void b(C0915Rl c0915Rl) { startActivity(new Intent(getActivity(), (Class) PartnerWebViewActivity.class).putExtra("com.scb.phone.EXTRA_DISPLAY", c0915Rl)); } @Override // o.InterfaceC12872fJp public final void i() { Intent intent = new Intent(getActivity(), (Class) GiftRecipientActivity.class); intent.putExtra("RECIPIENT_TYPE", "present"); startActivityForResult(intent, 100); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { super.onDestroy(); this.giftPresentTransferInputPresenter.w_(); if (((BaseGiftTransferInputFragment) this).c == null || ((BaseGiftTransferInputFragment) this).c.isDisposed()) { return; } ((BaseGiftTransferInputFragment) this).c.dispose(); } }