what-the-bank/sources/com/scb/phone/view/fragment/transferandpay/topuptab/TopUpTargetTabFragment.java

164 lines
6.1 KiB
Java

package com.scb.phone.view.fragment.transferandpay.topuptab;
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.BaseFragment;
import com.scb.phone.view.fragment.transferandpay.AnyTransferHistoryFragment;
import com.scb.phone.view.fragment.transferandpay.topuptab.TopUpTargetTabFragment;
import o.C12504ezU;
import o.C14957gcv;
import o.gxQ;
import o.pug;
import o.yRS;
/* loaded from: classes5.dex */
public final class TopUpTargetTabFragment extends Hilt_TopUpTargetTabFragment {
public C12504ezU c;
private AnyTransferHistoryFragment.RVV d;
@BindView
public TabLayout mTabLayout;
@BindView
public FragmentWrapContentViewPager mTabPager;
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559960, viewGroup, false);
((BaseFragment) this).a = ButterKnife.c(this, inflate);
if (getArguments() != null) {
yRS childFragmentManager = getChildFragmentManager();
C14957gcv.c(childFragmentManager, "");
this.c = new C12504ezU(childFragmentManager, getContext());
FragmentWrapContentViewPager fragmentWrapContentViewPager = this.mTabPager;
FragmentWrapContentViewPager fragmentWrapContentViewPager2 = null;
if (fragmentWrapContentViewPager == null) {
C14957gcv.a("");
fragmentWrapContentViewPager = null;
}
fragmentWrapContentViewPager.setAdapter(this.c);
TabLayout tabLayout = this.mTabLayout;
if (tabLayout == null) {
C14957gcv.a("");
tabLayout = null;
}
FragmentWrapContentViewPager fragmentWrapContentViewPager3 = this.mTabPager;
if (fragmentWrapContentViewPager3 == null) {
C14957gcv.a("");
fragmentWrapContentViewPager3 = null;
}
tabLayout.setupWithViewPager(fragmentWrapContentViewPager3);
FragmentWrapContentViewPager fragmentWrapContentViewPager4 = this.mTabPager;
if (fragmentWrapContentViewPager4 == null) {
C14957gcv.a("");
fragmentWrapContentViewPager4 = null;
}
fragmentWrapContentViewPager4.setCurrentItem(0);
FragmentWrapContentViewPager fragmentWrapContentViewPager5 = this.mTabPager;
if (fragmentWrapContentViewPager5 != null) {
fragmentWrapContentViewPager2 = fragmentWrapContentViewPager5;
} else {
C14957gcv.a("");
}
fragmentWrapContentViewPager2.addOnPageChangeListener(new IeS(this));
}
return inflate;
}
/* loaded from: classes5.dex */
public static final class IeS implements ViewPager.ojQ {
private TopUpTargetTabFragment e;
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrollStateChanged(int i) {
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrolled(int i, float f, int i2) {
}
IeS(TopUpTargetTabFragment topUpTargetTabFragment) {
this.e = topUpTargetTabFragment;
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageSelected(int i) {
if (i == 1) {
AnyTransferHistoryFragment.RVV rvv = this.e.d;
if (rvv != null) {
rvv.d();
}
TopUpTargetTabFragment topUpTargetTabFragment = this.e;
pug[] pugVarArr = {new pug("tab_name", "History")};
if (topUpTargetTabFragment.getActivity() != null) {
((BaseActivity) topUpTargetTabFragment.getActivity()).scbAnalytics.e("topup_tab", pugVarArr);
}
}
}
}
@Override // com.scb.phone.view.fragment.transferandpay.topuptab.Hilt_TopUpTargetTabFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public final void onAttach(Context context) {
C14957gcv.e(context, "");
super.onAttach(context);
getChildFragmentManager().a(new gxQ(this) { // from class: o.fGN
private TopUpTargetTabFragment c;
@Override // o.gxQ
public final void d(yRS yrs, Fragment fragment) {
TopUpTargetTabFragment.e(this.c, yrs, fragment);
}
{
this.c = this;
}
});
}
/* loaded from: classes5.dex */
public static final class LWm {
private LWm() {
}
public /* synthetic */ LWm(byte b) {
this();
}
}
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ void e(TopUpTargetTabFragment topUpTargetTabFragment, yRS yrs, Fragment fragment) {
C14957gcv.e(topUpTargetTabFragment, "");
C14957gcv.e(yrs, "");
C14957gcv.e(fragment, "");
if (fragment instanceof AnyTransferHistoryFragment.RVV) {
topUpTargetTabFragment.d = (AnyTransferHistoryFragment.RVV) fragment;
}
}
public static final TopUpTargetTabFragment c(String str) {
Bundle bundle = new Bundle();
if (str != null) {
bundle.putString("account_extra", str);
}
TopUpTargetTabFragment topUpTargetTabFragment = new TopUpTargetTabFragment();
topUpTargetTabFragment.setArguments(bundle);
return topUpTargetTabFragment;
}
static {
new LWm((byte) 0);
}
}