package com.scb.phone.view.fragment.transferandpay; 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 androidx.core.widget.NestedScrollView; import androidx.fragment.app.Fragment; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.activity.transferandpay.topup.TopUpActivity; import com.scb.phone.view.adapter.accountsummary.ErrorPagerAdapter; import com.scb.phone.view.adapter.transferandpay.AccountSourceAdapter; import com.scb.phone.view.custom.common.FragmentWrapContentViewPager; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.transferandpay.AccountSourceSelectFragment; import com.scb.phone.view.fragment.transferandpay.TopUpTabFragment; import com.scb.phone.view.fragment.transferandpay.topuptab.TopUpBillerFragment; import com.scb.phone.view.fragment.transferandpay.topuptab.TopUpBillerSelectedFragment; import com.scb.phone.view.fragment.transferandpay.topuptab.TopUpHistoryFragment; import com.scb.phone.view.fragment.transferandpay.topuptab.TopUpTargetTabFragment; import o.AbstractC13482fbE; import o.C0910Ri; import o.C1171Xc; import o.C1226Yl; import o.C12504ezU; import o.C14957gcv; import o.C6521cVe; import o.InterfaceC13391fZD; import o.InterfaceC9010dbe; import o.WW; import o.ZI; import o.pug; /* loaded from: classes5.dex */ public class TopUpTabFragment extends Hilt_TopUpTabFragment implements InterfaceC9010dbe.JRt, AccountSourceSelectFragment.Sts { private TopUpBillerSelectedFragment c; private AccountSourceSelectFragment d; private String f; private TopUpTargetTabFragment h; private String i; @BindView NestedScrollView scrollView; @InterfaceC13391fZD public C6521cVe topUpTabPresenter; public static TopUpTabFragment a(String str) { TopUpTabFragment topUpTabFragment = new TopUpTabFragment(); Bundle bundle = new Bundle(); bundle.putBoolean("com.scb.phone.FAVOURITE", true); bundle.putString("source", str); topUpTabFragment.setArguments(bundle); return topUpTabFragment; } public static TopUpTabFragment b(C1226Yl c1226Yl, C0910Ri c0910Ri, String str, String str2, C1171Xc c1171Xc, ErrorPagerAdapter.LWm lWm) { TopUpTabFragment topUpTabFragment = new TopUpTabFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("com.scb.phone.TOP_SHORTCUT", c1226Yl); bundle.putParcelable("com.scb.phone.TOP_HISTORY", c0910Ri); bundle.putString("source", str); bundle.putString("subtype", str2); bundle.putParcelable("EXTRA_ACCOUNT_SOURCE_DISPLAY", c1171Xc); bundle.putSerializable("EXTRA_ERROR_TYPE", lWm); topUpTabFragment.setArguments(bundle); return topUpTabFragment; } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559953, viewGroup, false); ((BaseFragment) this).a = ButterKnife.c(this, inflate); this.topUpTabPresenter.e((C6521cVe) this); this.f = Q(); this.i = O(); boolean z = (getActivity() instanceof TopUpActivity) && !((TopUpActivity) getActivity()).k; if (!"tile".equalsIgnoreCase(this.f) && z) { c("topup_landing", new pug("source", this.f)); } if (getArguments() == null || getArguments().getParcelable("EXTRA_ACCOUNT_SOURCE_DISPLAY") == null) { C6521cVe c6521cVe = this.topUpTabPresenter; ZI.IeS ieS = new ZI.IeS() { // from class: o.cVj @Override // o.ZI.IeS public final void e(Object obj) { C6521cVe.a((InterfaceC9010dbe.JRt) obj); } }; if (c6521cVe.f != 0) { ieS.e(c6521cVe.f); } } else { C6521cVe c6521cVe2 = this.topUpTabPresenter; final C1171Xc c1171Xc = (C1171Xc) getArguments().getParcelable("EXTRA_ACCOUNT_SOURCE_DISPLAY"); if (c1171Xc != null) { ZI.IeS ieS2 = new ZI.IeS(c1171Xc) { // from class: o.cVi private C1171Xc d; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9010dbe.JRt) obj).e(this.d); } { this.d = c1171Xc; } }; if (c6521cVe2.f != 0) { ieS2.e(c6521cVe2.f); } } else { ZI.IeS ieS3 = new ZI.IeS() { // from class: o.cVj @Override // o.ZI.IeS public final void e(Object obj) { C6521cVe.a((InterfaceC9010dbe.JRt) obj); } }; if (c6521cVe2.f != 0) { ieS3.e(c6521cVe2.f); } } } if (getArguments() != null && getArguments().getParcelable("com.scb.phone.TOP_SHORTCUT") != null) { h(); final C6521cVe c6521cVe3 = this.topUpTabPresenter; final C1226Yl c1226Yl = (C1226Yl) getArguments().getParcelable("com.scb.phone.TOP_SHORTCUT"); C0910Ri c0910Ri = (C0910Ri) getArguments().getParcelable("com.scb.phone.TOP_HISTORY"); if (c0910Ri != null) { c1226Yl.q = c0910Ri.g; c1226Yl.j = c0910Ri.i; c1226Yl.h = c0910Ri.b; } ZI.IeS ieS4 = new ZI.IeS(c6521cVe3, c1226Yl) { // from class: o.cVm private C1226Yl d; private C6521cVe e; @Override // o.ZI.IeS public final void e(Object obj) { C6521cVe.a(this.e, this.d, (InterfaceC9010dbe.JRt) obj); } { this.e = c6521cVe3; this.d = c1226Yl; } }; if (c6521cVe3.f != 0) { ieS4.e(c6521cVe3.f); } } else if (getArguments() != null && getArguments().getBoolean("com.scb.phone.FAVOURITE")) { h(); d("com.scb.phone/BROADCAST_TOP_UP_FAVOURITE_NEXT_STEP", "com.scb.phone/BROADCAST_TOP_UP_BACK_STEP"); } else { d("com.scb.phone/BROADCAST_TOP_UP_NEXT_STEP", "com.scb.phone/BROADCAST_TOP_UP_BACK_STEP"); TopUpTargetTabFragment c = TopUpTargetTabFragment.c((String) null); this.h = c; b(c, R.id.fragment_container_top_up, "TOP_UP_BILLER_FRAGMENT_TAG", true); } this.scrollView.setOnScrollChangeListener(new NestedScrollView.RVV(this) { // from class: o.fDX private TopUpTabFragment c; @Override // androidx.core.widget.NestedScrollView.RVV public final void e(NestedScrollView nestedScrollView, int i, int i2) { TopUpTabFragment.c(this.c, nestedScrollView, i, i2); } { this.c = this; } }); return inflate; } @Override // o.InterfaceC9010dbe.JRt public final void e(C1171Xc c1171Xc) { ErrorPagerAdapter.LWm lWm = ErrorPagerAdapter.LWm.NORMAL_ERROR; if (getArguments() != null && getArguments().getSerializable("EXTRA_ERROR_TYPE") != null) { lWm = (ErrorPagerAdapter.LWm) getArguments().getSerializable("EXTRA_ERROR_TYPE"); } this.d = AccountSourceSelectFragment.d(c1171Xc, lWm); AbstractC13482fbE a = getChildFragmentManager().a(); a.b(R.id.fragment_account_source_select, this.d, null, 2); a.b(); } private void h() { Fragment findFragmentById = getChildFragmentManager().findFragmentById(R.id.fragment_favourite_top_up_target); if (findFragmentById != null) { AbstractC13482fbE a = getChildFragmentManager().a(); a.c(findFragmentById); a.b(); } } /* JADX INFO: Access modifiers changed from: package-private */ @Override // com.scb.phone.view.fragment.transferandpay.BaseTransferAndPayTabFragment public final void axX_(Intent intent) { this.topUpTabPresenter.VJ_(intent.getExtras()); } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.scb.phone.view.fragment.transferandpay.BaseTransferAndPayTabFragment public final void axW_(Intent intent) { super.axW_(intent); b(new TopUpBillerFragment(), R.id.fragment_container_top_up, "TOP_UP_BILLER_FRAGMENT_TAG", true); this.c = null; } @Override // o.InterfaceC9010dbe.JRt public final void a(C1226Yl c1226Yl) { AccountSourceSelectFragment accountSourceSelectFragment = this.d; AccountSourceAdapter accountSourceAdapter = accountSourceSelectFragment.d; TopUpBillerSelectedFragment c = TopUpBillerSelectedFragment.c(c1226Yl, accountSourceAdapter != null ? accountSourceAdapter.d(accountSourceSelectFragment.mViewPager.getCurrentItem()) : null, this.f, this.i); this.c = c; e(c, R.id.fragment_container_top_up, "TOP_UP_BILLER_SELECTED_FRAGMENT_TAG", true, true); } @Override // com.scb.phone.view.fragment.transferandpay.BaseTransferAndPayTabFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { super.onDestroy(); this.topUpTabPresenter.w_(); } @Override // com.scb.phone.view.fragment.transferandpay.AccountSourceSelectFragment.Sts public final void a(WW ww) { if (ww != null) { TopUpBillerSelectedFragment topUpBillerSelectedFragment = this.c; if (topUpBillerSelectedFragment != null) { topUpBillerSelectedFragment.b(ww); return; } this.topUpTabPresenter.d = ww.d.doubleValue(); if (this.h == null) { aO_(); TopUpTargetTabFragment c = TopUpTargetTabFragment.c(ww.s); this.h = c; b(c, R.id.fragment_container_top_up, "TOP_UP_BILLER_FRAGMENT_TAG", true); } } } @Override // com.scb.phone.view.fragment.transferandpay.AccountSourceSelectFragment.Sts public final void e_(boolean z) { this.topUpTabPresenter.c(z); C0910Ri c0910Ri = getArguments() != null ? (C0910Ri) getArguments().getParcelable("com.scb.phone.TOP_HISTORY") : null; if (!z || c0910Ri == null || TextUtils.isEmpty(c0910Ri.d)) { return; } this.d.e(c0910Ri.d); } public static /* synthetic */ void c(TopUpTabFragment topUpTabFragment, NestedScrollView nestedScrollView, int i, int i2) { TopUpTargetTabFragment topUpTargetTabFragment; C12504ezU c12504ezU; TopUpHistoryFragment topUpHistoryFragment; if (i < i2 || i < (nestedScrollView.getChildAt(0).getMeasuredHeight() - nestedScrollView.getMeasuredHeight()) - 250 || (topUpTargetTabFragment = topUpTabFragment.h) == null) { return; } FragmentWrapContentViewPager fragmentWrapContentViewPager = topUpTargetTabFragment.mTabPager; if (fragmentWrapContentViewPager == null) { C14957gcv.a(""); fragmentWrapContentViewPager = null; } if (fragmentWrapContentViewPager.getCurrentItem() != 1 || (c12504ezU = topUpTargetTabFragment.c) == null || (topUpHistoryFragment = c12504ezU.b) == null || !((AnyTransferHistoryFragment) topUpHistoryFragment).d || topUpHistoryFragment.isDetached()) { return; } ((AnyTransferHistoryFragment) topUpHistoryFragment).d = false; topUpHistoryFragment.j().b(); } }