what-the-bank/sources/com/scb/phone/view/fragment/transferandpay/billpaymenttab/SecondaryTabsFragment.java

240 lines
8.3 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.transferandpay.billpaymenttab;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.google.android.material.tabs.TabLayout;
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.AnyTransferHistoryFragment;
import com.scb.phone.view.fragment.transferandpay.BillPaymentTabFragment;
import com.scb.phone.view.fragment.transferandpay.billpayment.BillPaymentHistoryFragment;
import com.scb.phone.view.fragment.transferandpay.billpaymenttab.SecondaryTabsFragment;
import o.C1193Xr;
import o.C12532ezw;
import o.C6435cSr;
import o.InterfaceC13391fZD;
import o.InterfaceC16541pFg;
import o.InterfaceC9010dbe;
import o.InterfaceC9663dnz;
import o.XB;
import o.ZI;
import o.gxQ;
import o.pug;
/* loaded from: classes5.dex */
public class SecondaryTabsFragment extends Hilt_SecondaryTabsFragment implements InterfaceC9010dbe.pwE, InterfaceC9663dnz.ZqN, InterfaceC9663dnz.HBt, InterfaceC9663dnz.Sts, InterfaceC9663dnz.IeS, BillPaymentTabFragment.LWm {
private InterfaceC9663dnz.IeS c;
AnyTransferHistoryFragment.RVV d;
private InterfaceC9663dnz.HBt f;
private InterfaceC9663dnz.Sts g;
private C12532ezw h;
private InterfaceC9663dnz.ZqN j;
@BindView
TabLayout mTabLayout;
@BindView
FragmentWrapContentViewPager mTabPager;
@InterfaceC13391fZD
public C6435cSr secondaryTabsPresenter;
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559960, viewGroup, false);
ButterKnife.c(this, inflate);
this.secondaryTabsPresenter.e((C6435cSr) this);
C6435cSr c6435cSr = this.secondaryTabsPresenter;
if (c6435cSr.d.c.n() != null) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.cSv
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9010dbe.pwE) obj).b();
}
};
if (c6435cSr.f != 0) {
ieS.e(c6435cSr.f);
}
} else if (c6435cSr.d.c.m() != null) {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.cSx
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9010dbe.pwE) obj).c();
}
};
if (c6435cSr.f != 0) {
ieS2.e(c6435cSr.f);
}
} else {
ZI.IeS ieS3 = new ZI.IeS() { // from class: o.cSw
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9010dbe.pwE) obj).b(0);
}
};
if (c6435cSr.f != 0) {
ieS3.e(c6435cSr.f);
}
}
return inflate;
}
@Override // o.InterfaceC9010dbe.pwE
public final void b() {
b(0);
this.mTabLayout.setVisibility(8);
}
@Override // o.InterfaceC9010dbe.pwE
public final void c() {
b(1);
this.mTabLayout.setVisibility(8);
}
@Override // o.InterfaceC9010dbe.pwE
public final void b(int i) {
C12532ezw c12532ezw = new C12532ezw(getChildFragmentManager(), getContext());
this.h = c12532ezw;
this.mTabPager.setAdapter(c12532ezw);
this.mTabPager.setOffscreenPageLimit(2);
this.mTabPager.setEnableDrawDynamicViewHeight(true);
this.mTabLayout.setupWithViewPager(this.mTabPager);
this.mTabPager.setCurrentItem(i, false);
this.mTabPager.addOnPageChangeListener(new ViewPager.ojQ(this) { // from class: com.scb.phone.view.fragment.transferandpay.billpaymenttab.SecondaryTabsFragment.1
private SecondaryTabsFragment d;
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrollStateChanged(int i2) {
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrolled(int i2, float f, int i3) {
}
{
this.d = this;
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageSelected(int i2) {
if (i2 == 2) {
this.d.d.d();
SecondaryTabsFragment secondaryTabsFragment = this.d;
pug[] pugVarArr = {new pug("tab_name", "History")};
if (secondaryTabsFragment.getActivity() != null) {
((BaseActivity) secondaryTabsFragment.getActivity()).scbAnalytics.e("billpayment_tab", pugVarArr);
}
}
}
});
}
@Override // com.scb.phone.view.fragment.transferandpay.billpaymenttab.Hilt_SecondaryTabsFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
InterfaceC16541pFg parentFragment = getParentFragment();
if (parentFragment instanceof InterfaceC9663dnz.ZqN) {
this.j = (InterfaceC9663dnz.ZqN) parentFragment;
}
if (parentFragment instanceof InterfaceC9663dnz.HBt) {
this.f = (InterfaceC9663dnz.HBt) parentFragment;
}
if (parentFragment instanceof InterfaceC9663dnz.Sts) {
this.g = (InterfaceC9663dnz.Sts) parentFragment;
}
if (parentFragment instanceof InterfaceC9663dnz.IeS) {
this.c = (InterfaceC9663dnz.IeS) parentFragment;
}
getChildFragmentManager().a(new gxQ(this) { // from class: o.fFk
private SecondaryTabsFragment e;
@Override // o.gxQ
public final void d(yRS yrs, Fragment fragment) {
SecondaryTabsFragment.e(this.e, fragment);
}
{
this.e = this;
}
});
}
@Override // o.InterfaceC9663dnz.ZqN
public final void c(C1193Xr c1193Xr) {
InterfaceC9663dnz.ZqN zqN = this.j;
if (zqN != null) {
zqN.c(c1193Xr);
}
}
@Override // o.InterfaceC9663dnz.HBt
public final void b(C1193Xr c1193Xr) {
InterfaceC9663dnz.HBt hBt = this.f;
if (hBt != null) {
hBt.b(c1193Xr);
}
}
@Override // o.InterfaceC9663dnz.IeS
public final InterfaceC9663dnz.ojQ e() {
InterfaceC9663dnz.IeS ieS = this.c;
if (ieS != null) {
return ieS.e();
}
return null;
}
@Override // o.InterfaceC9663dnz.IeS
public final void i() {
InterfaceC9663dnz.IeS ieS = this.c;
if (ieS != null) {
ieS.i();
}
}
@Override // o.InterfaceC9663dnz.IeS
public final void e(int i) {
InterfaceC9663dnz.IeS ieS = this.c;
if (ieS != null) {
ieS.e(i);
}
}
@Override // o.InterfaceC9663dnz.Sts
public final void b(XB xb) {
InterfaceC9663dnz.Sts sts = this.g;
if (sts != null) {
sts.b(xb);
}
}
@Override // com.scb.phone.view.fragment.transferandpay.BillPaymentTabFragment.LWm
public final void d() {
C12532ezw c12532ezw;
if (this.mTabPager.getCurrentItem() != 2 || (c12532ezw = this.h) == null) {
return;
}
BillPaymentHistoryFragment billPaymentHistoryFragment = c12532ezw.d;
if (!((AnyTransferHistoryFragment) billPaymentHistoryFragment).d || billPaymentHistoryFragment.isDetached()) {
return;
}
((AnyTransferHistoryFragment) billPaymentHistoryFragment).d = false;
billPaymentHistoryFragment.j().b();
}
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ void e(SecondaryTabsFragment secondaryTabsFragment, Fragment fragment) {
if (fragment instanceof BillPaymentHistoryFragment) {
secondaryTabsFragment.d = (AnyTransferHistoryFragment.RVV) fragment;
}
}
}