what-the-bank/sources/com/scb/phone/view/fragment/transferandpay/transfer/TransferTargetTabFragment.java

225 lines
8.2 KiB
Java

package com.scb.phone.view.fragment.transferandpay.transfer;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
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.custom.common.CustomDialog;
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.transfer.TransferTargetTabFragment;
import o.C0690Mh;
import o.C1019Twi;
import o.C10457eEr;
import o.C12501ezR;
import o.C16903sI;
import o.C6566cWp;
import o.C6583cXR;
import o.InterfaceC13391fZD;
import o.InterfaceC9010dbe;
import o.ZI;
import o.gxQ;
import o.pug;
import o.qhK;
import o.yGw;
/* loaded from: classes5.dex */
public class TransferTargetTabFragment extends Hilt_TransferTargetTabFragment implements InterfaceC9010dbe.AGo {
private AnyTransferHistoryFragment.RVV c;
public C12501ezR d;
@BindView
TabLayout mTabLayout;
@BindView
public FragmentWrapContentViewPager mTabPager;
@InterfaceC13391fZD
public C6566cWp transferTargetTabPresenter;
public static TransferTargetTabFragment a(String str) {
Bundle bundle = new Bundle();
bundle.putString("account_extra", str);
TransferTargetTabFragment transferTargetTabFragment = new TransferTargetTabFragment();
transferTargetTabFragment.setArguments(bundle);
return transferTargetTabFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
String str;
byte b = 0;
View inflate = layoutInflater.inflate(R.layout.2131559960, viewGroup, false);
((BaseFragment) this).a = ButterKnife.c(this, inflate);
this.transferTargetTabPresenter.e((C6566cWp) this);
C6566cWp c6566cWp = this.transferTargetTabPresenter;
C1019Twi c1019Twi = c6566cWp.d;
if (c1019Twi == null) {
str = "";
} else {
str = c1019Twi.z;
}
if (c6566cWp.d == null || qhK.OWN.equals(C6583cXR.G(str)) || qhK.SCB.equals(C6583cXR.G(str)) || qhK.OTHER.equals(C6583cXR.G(str))) {
c6566cWp.d(0);
} else if (qhK.PROMPTPAY.equals(C6583cXR.G(str))) {
c6566cWp.d(1);
} else {
ZI.IeS ieS = new ZI.IeS() { // from class: o.cWz
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9010dbe.AGo) obj).e();
}
};
if (c6566cWp.f != 0) {
ieS.e(c6566cWp.f);
}
}
C6566cWp c6566cWp2 = this.transferTargetTabPresenter;
String W = W();
c6566cWp2.e.a.d();
yGw ygw = c6566cWp2.e;
ygw.d(ygw.a.j(W), new C6566cWp.LWm(c6566cWp2, b));
return inflate;
}
@Override // com.scb.phone.view.fragment.transferandpay.transfer.Hilt_TransferTargetTabFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
getChildFragmentManager().a(new gxQ(this) { // from class: o.fHi
private TransferTargetTabFragment b;
@Override // o.gxQ
public final void d(yRS yrs, Fragment fragment) {
TransferTargetTabFragment.a(this.b, fragment);
}
{
this.b = this;
}
});
}
@Override // o.InterfaceC9010dbe.AGo
public final void a(int i) {
if (getArguments() != null) {
C12501ezR c12501ezR = new C12501ezR(getChildFragmentManager(), getContext());
this.d = c12501ezR;
this.mTabPager.setAdapter(c12501ezR);
this.mTabPager.setOffscreenPageLimit(2);
this.mTabLayout.setupWithViewPager(this.mTabPager);
this.mTabPager.setCurrentItem(i);
this.mTabPager.addOnPageChangeListener(new ViewPager.ojQ(this) { // from class: com.scb.phone.view.fragment.transferandpay.transfer.TransferTargetTabFragment.4
private TransferTargetTabFragment 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) {
final C6566cWp c6566cWp = this.d.transferTargetTabPresenter;
if (i2 == 2) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.cWw
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9010dbe.AGo) obj).d();
}
};
if (c6566cWp.f != 0) {
ieS.e(c6566cWp.f);
}
} else if (i2 == 1 && !c6566cWp.e.d.x().booleanValue()) {
ZI.IeS ieS2 = new ZI.IeS(c6566cWp) { // from class: o.cWy
private C6566cWp a;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9010dbe.AGo) obj).e(this.a.c);
}
{
this.a = c6566cWp;
}
};
if (c6566cWp.f != 0) {
ieS2.e(c6566cWp.f);
}
}
if (i2 != 1) {
c6566cWp.c = i2;
}
}
});
}
}
@Override // o.InterfaceC9010dbe.AGo
public final void c(int i) {
this.mTabPager.setDisableSwiping(true);
this.mTabLayout.setVisibility(8);
a(i);
}
@Override // o.InterfaceC9010dbe.AGo
public final void c() {
C10457eEr.aqd_(this, new Intent("com.scb.phone/BROADCAST_BANK_RECEIVED"));
}
@Override // o.InterfaceC9010dbe.AGo
public final void e() {
C6566cWp c6566cWp = this.transferTargetTabPresenter;
C0690Mh.IeS ieS = C0690Mh.IeS.NAVIGATE_BACK;
C16903sI c16903sI = c6566cWp.j;
c6566cWp.d(c16903sI.c((String) null, c16903sI.e(R.string.operation_not_found), ieS));
}
@Override // o.InterfaceC9010dbe.AGo
public final void d() {
this.c.d();
c("transfer_tab", new pug("tab_name", "History"));
}
@Override // o.InterfaceC9010dbe.AGo
public final void e(final int i) {
CustomDialog.b(getContext()).c(R.string.transfer_error_prevent_promptpay_title).d(R.string.transfer_error_prevent_promptpay_detail).aoT_(R.string.ok, new DialogInterface.OnClickListener(this, i) { // from class: o.fHl
private TransferTargetTabFragment b;
private int c;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i2) {
this.b.mTabPager.setCurrentItem(this.c);
}
{
this.b = this;
this.c = i;
}
}).show();
}
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ void a(TransferTargetTabFragment transferTargetTabFragment, Fragment fragment) {
if (fragment instanceof TransferHistoryFragment) {
transferTargetTabFragment.c = (AnyTransferHistoryFragment.RVV) fragment;
}
}
}