package com.scb.phone.view.fragment.transferandpay; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.core.widget.NestedScrollView; import androidx.fragment.app.Fragment; import butterknife.BindView; import butterknife.ButterKnife; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.scb.phone.R; import com.scb.phone.view.activity.BaseActivity; import com.scb.phone.view.custom.common.FragmentWrapContentViewPager; import com.scb.phone.view.fragment.transferandpay.AccountSourceSelectFragment; import com.scb.phone.view.fragment.transferandpay.TransferTabFragment; import com.scb.phone.view.fragment.transferandpay.fixedtransfer.FixedTransferInputFormFragment; import com.scb.phone.view.fragment.transferandpay.fixedtransfer.FixedTransferTargetTabFragment; import com.scb.phone.view.fragment.transferandpay.transfer.TransferHistoryFragment; import com.scb.phone.view.fragment.transferandpay.transfer.TransferInputAmountFragment; import com.scb.phone.view.fragment.transferandpay.transfer.TransferTargetTabFragment; import com.scb.phone.view.fragment.transferandpay.transfer.TransferToMeStep1Fragment; import java.util.List; import o.AbstractC1237Yr; import o.AbstractC13482fbE; import o.C1171Xc; import o.C12220euB; import o.C12501ezR; import o.C12944fLv; import o.C6528cVl; import o.C6565cWo; import o.InterfaceC13391fZD; import o.InterfaceC9010dbe; import o.WW; import o.WmB; import o.YA; import o.YE; import o.YUM; import o.ZGL; import o.ZI; import o.cVH; import o.fSJ; import o.fSQ; import o.gjJ; import o.glR; import o.qhK; /* loaded from: classes5.dex */ public class TransferTabFragment extends Hilt_TransferTabFragment implements InterfaceC9010dbe.NOK, AccountSourceSelectFragment.Sts { private fSJ c; private AccountSourceSelectFragment d; private FixedTransferInputFormFragment f; private FixedTransferTargetTabFragment h; private String i; private TransferInputAmountFragment j; private TransferTargetTabFragment l; private TransferToMeStep1Fragment m; @BindView NestedScrollView scrollView; @InterfaceC13391fZD public C12944fLv successScreenshotHelper; @InterfaceC13391fZD public C6565cWo transferTabPresenter; private WmB n = new WmB(); private String g = ""; private boolean k = false; @Override // com.scb.phone.view.fragment.transferandpay.AccountSourceSelectFragment.Sts public final void e_(boolean z) { } public static TransferTabFragment c(String str) { TransferTabFragment transferTabFragment = new TransferTabFragment(); Bundle bundle = new Bundle(); bundle.putBoolean("com.scb.phone.FAVOURITE", true); bundle.putString("source", str); transferTabFragment.setArguments(bundle); return transferTabFragment; } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { YE ye; View inflate = layoutInflater.inflate(R.layout.2131559967, viewGroup, false); String Q = Q(); this.i = Q; this.n.e(Q); WmB wmB = this.n; if (getActivity() != null) { wmB.c(((BaseActivity) getActivity()).scbAnalytics, "transfer_landing"); } ButterKnife.c(this, inflate); this.transferTabPresenter.e((C6565cWo) this); final String stringExtra = (getActivity() == null || getActivity().getIntent() == null) ? "" : getActivity().getIntent().getStringExtra("com.scb.phone.EXTRA_TRANSFER_DEFAULT_ACCOUNT_NUMBER"); if (getArguments() != null) { this.k = getArguments().getBoolean("com.scb.phone.FAVOURITE", false); } C6565cWo c6565cWo = this.transferTabPresenter; final boolean z = this.k; if (z) { ye = YE.TRANSFER_FUNCTION; } else { ye = YE.TRANSFER_AND_FIXED_TRANSFER_FUNCTION; } C1171Xc.IeS ieS = new C1171Xc.IeS(ye); C1171Xc c1171Xc = ieS.c; c1171Xc.a = false; c1171Xc.b = true; c1171Xc.j = true; c1171Xc.g = true; final C1171Xc c1171Xc2 = ieS.c; ZI.IeS ieS2 = new ZI.IeS(c1171Xc2, stringExtra, z) { // from class: o.cWn private C1171Xc c; private boolean d; private String e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9010dbe.NOK) obj).c(this.c, this.e, this.d); } { this.c = c1171Xc2; this.e = stringExtra; this.d = z; } }; if (c6565cWo.f != 0) { ieS2.e(c6565cWo.f); } this.scrollView.setOnScrollChangeListener(new NestedScrollView.RVV(this) { // from class: o.fEi private TransferTabFragment e; @Override // androidx.core.widget.NestedScrollView.RVV public final void e(NestedScrollView nestedScrollView, int i, int i2) { TransferTabFragment.e(this.e, nestedScrollView, i, i2); } { this.e = this; } }); return inflate; } @Override // androidx.fragment.app.Fragment public void onResume() { super.onResume(); if (!f()) { if (getArguments() != null && getArguments().getBoolean("com.scb.phone.FAVOURITE")) { AbstractC13482fbE a = getChildFragmentManager().a(); a.c(getChildFragmentManager().findFragmentById(R.id.fragment_favourite_transfer_target)); a.b(); d("com.scb.phone/BROADCAST_TRANSFER_NEXT_FAVOURITE_STEP", "com.scb.phone/BROADCAST_TRANSFER_BACK_STEP"); } else { d("com.scb.phone/BROADCAST_TRANSFER_NEXT_STEP", "com.scb.phone/BROADCAST_TRANSFER_BACK_STEP"); } } if (this.c == null) { this.c = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_TRANSFER_CLEAR_FILTER_SOF")).subscribe(new fSQ(this) { // from class: o.fEm private TransferTabFragment a; @Override // o.fSQ public final void c(Object obj) { this.a.d.i(); } { this.a = this; } }, new fSQ() { // from class: o.fEj @Override // o.fSQ public final void c(Object obj) { guQ.a((Throwable) obj); } }); } } @Override // com.scb.phone.view.fragment.transferandpay.BaseTransferAndPayTabFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { this.transferTabPresenter.w_(); this.n = null; fSJ fsj = this.c; if (fsj != null) { fsj.dispose(); } super.onDestroy(); } @Override // o.InterfaceC9010dbe.NOK public final void b(AbstractC1237Yr abstractC1237Yr, String str) { this.m = TransferToMeStep1Fragment.a(str, "FIXED_TRANSFER", abstractC1237Yr); aO_(); e(this.m, R.id.container, "com.scb.phone.TransferTabFragment.TAG_NEXT_STEP", true, true); } @Override // o.InterfaceC9010dbe.NOK public final void c(boolean z, final boolean z2, final AbstractC1237Yr abstractC1237Yr) { if (z) { final C6565cWo c6565cWo = this.transferTabPresenter; ZI.IeS ieS = new ZI.IeS(c6565cWo, abstractC1237Yr, z2) { // from class: o.cWr private boolean a; private C6565cWo d; private AbstractC1237Yr e; @Override // o.ZI.IeS public final void e(Object obj) { InterfaceC9010dbe.NOK nok = (InterfaceC9010dbe.NOK) obj; nok.a(this.e, this.d.d, this.a); } { this.d = c6565cWo; this.e = abstractC1237Yr; this.a = z2; } }; if (c6565cWo.f != 0) { ieS.e(c6565cWo.f); return; } return; } this.d.c(abstractC1237Yr.c); final C6565cWo c6565cWo2 = this.transferTabPresenter; ZI.IeS ieS2 = new ZI.IeS(c6565cWo2, abstractC1237Yr) { // from class: o.cWk private AbstractC1237Yr b; private C6565cWo d; @Override // o.ZI.IeS public final void e(Object obj) { InterfaceC9010dbe.NOK nok = (InterfaceC9010dbe.NOK) obj; nok.b(r0.d, r0.b, this.d.e, this.b); } { this.d = c6565cWo2; this.b = abstractC1237Yr; } }; if (c6565cWo2.f != 0) { ieS2.e(c6565cWo2.f); } } /* JADX INFO: Access modifiers changed from: package-private */ @Override // com.scb.phone.view.fragment.transferandpay.BaseTransferAndPayTabFragment public final void axX_(Intent intent) { final AbstractC1237Yr abstractC1237Yr; final C6528cVl c6528cVl = new C6528cVl(); c6528cVl.b = (AbstractC1237Yr) intent.getParcelableExtra("com.scb.phone.EXTRA_TRANSFER_TARGET_DATA"); c6528cVl.a = intent.getStringExtra("com.scb.phone.EXTRA_TRANSFER_FUNCTION"); final boolean z = false; c6528cVl.e = intent.getBooleanExtra("com.scb.phone.EXTRA_FROM_TRANSFER_TO_ME_PAGE", false); c6528cVl.d = (AbstractC1237Yr) intent.getParcelableExtra("fixed_transfer_display"); c6528cVl.c = intent.getBooleanExtra("com.scb.phone.EXTRA_TRANSFER_TO_MAIN_AUTO", false); C6565cWo c6565cWo = this.transferTabPresenter; final String str = this.g; boolean z2 = this.k; if (c6528cVl.d != null) { c6528cVl.d.i = c6528cVl.b.i; } if (!z2 && (c6528cVl.b instanceof YA) && "000".equalsIgnoreCase(((YA) c6528cVl.b).d) && !c6528cVl.e) { final YA ya = (YA) c6528cVl.b; if (TextUtils.isEmpty(str)) { ZI.IeS ieS = new ZI.IeS(ya) { // from class: o.cWt private YA d; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9010dbe.NOK) obj).c(this.d); } { this.d = ya; } }; if (c6565cWo.f != 0) { ieS.e(c6565cWo.f); return; } return; } ZI.IeS ieS2 = new ZI.IeS(c6528cVl, str) { // from class: o.cWu private C6528cVl c; private String d; @Override // o.ZI.IeS public final void e(Object obj) { InterfaceC9010dbe.NOK nok = (InterfaceC9010dbe.NOK) obj; nok.b(this.c.d, this.d); } { this.c = c6528cVl; this.d = str; } }; if (c6565cWo.f != 0) { ieS2.e(c6565cWo.f); return; } return; } if (!TextUtils.isEmpty(c6528cVl.a) && c6528cVl.a.equals("FIXED_TRANSFER")) { z = true; } if (z && !c6528cVl.e && !c6528cVl.c) { abstractC1237Yr = c6528cVl.d; } else { abstractC1237Yr = c6528cVl.b; } ZI.IeS ieS3 = new ZI.IeS(z, c6528cVl, abstractC1237Yr) { // from class: o.cWq private boolean b; private C6528cVl c; private AbstractC1237Yr d; @Override // o.ZI.IeS public final void e(Object obj) { InterfaceC9010dbe.NOK nok = (InterfaceC9010dbe.NOK) obj; nok.c(this.b, this.c.c, this.d); } { this.b = z; this.c = c6528cVl; this.d = abstractC1237Yr; } }; if (c6565cWo.f != 0) { ieS3.e(c6565cWo.f); } } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.scb.phone.view.fragment.transferandpay.BaseTransferAndPayTabFragment public final void axW_(Intent intent) { super.axW_(intent); String stringExtra = intent.getStringExtra("com.scb.phone.EXTRA_TRANSFER_FUNCTION"); this.d.i(); this.n.e(this.i); WmB wmB = this.n; if (getActivity() != null) { wmB.c(((BaseActivity) getActivity()).scbAnalytics, "transfer_landing"); } if (TextUtils.isEmpty(stringExtra) || !stringExtra.equals("FIXED_TRANSFER")) { b((Fragment) this.l, R.id.container, getString(R.string.transfer_target_tab), true); this.j = null; } else { FixedTransferTargetTabFragment fixedTransferTargetTabFragment = this.h; fixedTransferTargetTabFragment.ctlTargetAccount.setScrollPosition(0, BitmapDescriptorFactory.HUE_RED, true); fixedTransferTargetTabFragment.vpTargetAccount.setCurrentItem(0); b((Fragment) this.h, R.id.container, "com.scb.phone.TransferTabFragment.TAG_FIXED_TRANSFER", true); this.f = null; } if (this.m != null) { this.m = null; } } @Override // o.InterfaceC9010dbe.NOK public final void c(C1171Xc c1171Xc, String str, boolean z) { this.d = AccountSourceSelectFragment.b(c1171Xc, str, z); AbstractC13482fbE a = getChildFragmentManager().a(); a.b(R.id.fragment_account_source_select, this.d, null, 2); a.b(); } @Override // o.InterfaceC9010dbe.NOK public final void b(String str, ZGL zgl, double d, AbstractC1237Yr abstractC1237Yr) { aN_(); this.j = TransferInputAmountFragment.e(abstractC1237Yr, str, zgl, d, this.i); aO_(); e(this.j, R.id.container, "com.scb.phone.TransferTabFragment.TAG_NEXT_STEP", true, true); } @Override // o.InterfaceC9010dbe.NOK public final void a(AbstractC1237Yr abstractC1237Yr, String str, boolean z) { aN_(); this.f = FixedTransferInputFormFragment.b(abstractC1237Yr, str, z, this.i); aO_(); e(this.f, R.id.container, "com.scb.phone.TransferTabFragment.TAG_FIXED_TRANSFER_INPUT", true, true); getChildFragmentManager().n(); } public static /* synthetic */ void e(TransferTabFragment transferTabFragment, NestedScrollView nestedScrollView, int i, int i2) { C12220euB c12220euB; TransferHistoryFragment transferHistoryFragment; FragmentWrapContentViewPager fragmentWrapContentViewPager; C12501ezR c12501ezR; TransferHistoryFragment transferHistoryFragment2; if (i < i2 || i < (nestedScrollView.getChildAt(0).getMeasuredHeight() - nestedScrollView.getMeasuredHeight()) - 250) { return; } TransferTargetTabFragment transferTargetTabFragment = transferTabFragment.l; if (transferTargetTabFragment != null && (fragmentWrapContentViewPager = transferTargetTabFragment.mTabPager) != null && fragmentWrapContentViewPager.getCurrentItem() == 2 && (c12501ezR = transferTargetTabFragment.d) != null && (transferHistoryFragment2 = c12501ezR.c) != null && ((AnyTransferHistoryFragment) transferHistoryFragment2).d && !transferHistoryFragment2.isDetached()) { ((AnyTransferHistoryFragment) transferHistoryFragment2).d = false; transferHistoryFragment2.j().b(); } FixedTransferTargetTabFragment fixedTransferTargetTabFragment = transferTabFragment.h; if (fixedTransferTargetTabFragment == null || (c12220euB = fixedTransferTargetTabFragment.c) == null || (transferHistoryFragment = c12220euB.a) == null || !((AnyTransferHistoryFragment) transferHistoryFragment).d || transferHistoryFragment.isDetached()) { return; } ((AnyTransferHistoryFragment) transferHistoryFragment).d = false; transferHistoryFragment.j().b(); } @Override // com.scb.phone.view.fragment.transferandpay.AccountSourceSelectFragment.Sts public final void a(WW ww) { AbstractC1237Yr abstractC1237Yr; if (ww != null) { List list = ww.w; if (list != null && list.contains("FIXED_TRANSFER_SOURCE")) { C6565cWo c6565cWo = this.transferTabPresenter; String str = ww.s; ZGL zgl = ww.p; double doubleValue = ww.d.doubleValue(); c6565cWo.d = str; c6565cWo.b = zgl; c6565cWo.e = doubleValue; C6565cWo c6565cWo2 = this.transferTabPresenter; String str2 = ww.s; if (gjJ.a(c6565cWo2.c) && c6565cWo2.c.equals(str2)) { return; } aO_(); this.g = ww.s; this.h = FixedTransferTargetTabFragment.e(ww.s); this.transferTabPresenter.c = ww.s; this.transferTabPresenter.a = false; e(this.h, R.id.container, "com.scb.phone.TransferTabFragment.TAG_FIXED_TRANSFER", true, true); return; } this.g = ""; TransferInputAmountFragment transferInputAmountFragment = this.j; if (transferInputAmountFragment != null && !transferInputAmountFragment.isDetached() && this.j.isAdded()) { cVH cvh = this.j.presenter; String str3 = ww.s; ZGL zgl2 = ww.p; final double doubleValue2 = ww.d.doubleValue(); cvh.f8627o = zgl2; cvh.l = str3; if (str3 != null && (abstractC1237Yr = cvh.g) != null && str3.equals(abstractC1237Yr.c) && cvh.g.h == qhK.OWN) { ZI.IeS ieS = new ZI.IeS() { // from class: o.cVM @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9010dbe.uqm) obj).b(); } }; if (cvh.f != 0) { ieS.e(cvh.f); } } ZI.IeS ieS2 = new ZI.IeS(doubleValue2) { // from class: o.cVL private double b; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9010dbe.uqm) obj).e(this.b); } { this.b = doubleValue2; } }; if (cvh.f != 0) { ieS2.e(cvh.f); } } TransferToMeStep1Fragment transferToMeStep1Fragment = this.m; if (transferToMeStep1Fragment != null && !transferToMeStep1Fragment.isDetached()) { TransferToMeStep1Fragment transferToMeStep1Fragment2 = this.m; String str4 = ww.s; if (str4 != null) { transferToMeStep1Fragment2.presenter.b(str4); } } FixedTransferTargetTabFragment fixedTransferTargetTabFragment = this.h; if (fixedTransferTargetTabFragment != null) { YUM yum = fixedTransferTargetTabFragment.fixedTransferTargetPresenter.d; if (!yum.h.isDisposed()) { yum.h.dispose(); } } C6565cWo c6565cWo3 = this.transferTabPresenter; String str5 = ww.s; ZGL zgl3 = ww.p; double doubleValue3 = ww.d.doubleValue(); c6565cWo3.d = str5; c6565cWo3.b = zgl3; c6565cWo3.e = doubleValue3; if (this.transferTabPresenter.a) { return; } aO_(); this.transferTabPresenter.a = true; this.transferTabPresenter.c = null; TransferTargetTabFragment a = TransferTargetTabFragment.a(ww.s); this.l = a; b((Fragment) a, R.id.container, getString(R.string.transfer_target_tab), true); } } @Override // o.InterfaceC9010dbe.NOK public final void c(YA ya) { this.m = TransferToMeStep1Fragment.d(this.transferTabPresenter.d, ya); aO_(); e(this.m, R.id.container, "com.scb.phone.TransferTabFragment.TAG_NEXT_STEP", true, true); } }