what-the-bank/sources/com/scb/phone/view/fragment/bankingagent/BankingEnterAmountFragment....

545 lines
19 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.bankingagent;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager.widget.ViewPager;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.HomeActivity;
import com.scb.phone.view.activity.bankingagent.BankingAgentReviewActivity;
import com.scb.phone.view.activity.bankingagent.BankingAgentTCActivity;
import com.scb.phone.view.custom.common.NoSwipeViewPager;
import com.scb.phone.view.fragment.bankingagent.BankingAgentSelectedFragment;
import com.scb.phone.view.fragment.bankingagent.BankingAgentsFragment;
import com.scb.phone.view.fragment.bankingagent.BankingEnterAmountFragment;
import com.scb.phone.view.fragment.bankingagent.BaseBankingAgentsFragment;
import java.util.List;
import me.relex.circleindicator.CircleIndicator;
import o.AbstractC12056eqx;
import o.AbstractC14961gcz;
import o.AbstractC15351go;
import o.C11560ehe;
import o.C12089erd;
import o.C14957gcv;
import o.C15634hL;
import o.C2610ahp;
import o.C2612ahr;
import o.Ect;
import o.FA;
import o.FB;
import o.FE;
import o.Heg;
import o.InterfaceC0834Plv;
import o.InterfaceC13391fZD;
import o.InterfaceC13393fZL;
import o.InterfaceC14890gbN;
import o.InterfaceC6624cYb;
import o.JVY;
import o.SnH;
import o.ZI;
import o.fZZ;
import o.huo;
import o.qeC;
/* loaded from: classes5.dex */
public final class BankingEnterAmountFragment extends Hilt_BankingEnterAmountFragment implements InterfaceC6624cYb.LWm, BaseBankingAgentsFragment.HBt, BankingAgentSelectedFragment.HBt {
public static final Sts c = new Sts(0);
private Ect d;
private C12089erd g;
private final InterfaceC13393fZL h;
private huo<Intent> j;
@InterfaceC13391fZD
public C2610ahp presenter;
public BankingEnterAmountFragment() {
IeS ieS = new IeS(this);
C14957gcv.e(ieS, "");
this.h = new fZZ(ieS);
}
/* loaded from: classes5.dex */
static final class IeS extends AbstractC14961gcz implements InterfaceC14890gbN<JVY> {
private BankingEnterAmountFragment c;
@Override // o.InterfaceC14890gbN
public final /* synthetic */ JVY invoke() {
Parcelable parcelable;
Bundle arguments = this.c.getArguments();
if (arguments == null) {
return null;
}
if (Build.VERSION.SDK_INT >= 33) {
parcelable = (Parcelable) arguments.getParcelable("banking_agent_bundle", JVY.class);
} else {
Parcelable parcelable2 = arguments.getParcelable("banking_agent_bundle");
parcelable = (JVY) (parcelable2 instanceof JVY ? parcelable2 : null);
}
return (JVY) parcelable;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
IeS(BankingEnterAmountFragment bankingEnterAmountFragment) {
super(0);
this.c = bankingEnterAmountFragment;
}
}
/* loaded from: classes5.dex */
public static final class Sts {
private Sts() {
}
public /* synthetic */ Sts(byte b) {
this();
}
}
@Override // androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
C14957gcv.e(view, "");
super.onViewCreated(view, bundle);
BankingAgentsFragment.Sts sts = BankingAgentsFragment.c;
Bundle arguments = getArguments();
String string = arguments != null ? arguments.getString("com.scb.phone.EXTRA_POSTING_TYPE", "D") : null;
b(BankingAgentsFragment.Sts.a(string != null ? string : "D"), R.id.fragment_container_banking_agent, "com.scb.phone.BANKING_AGENT_ENTER_AMOUNT_CONTAINER_TAG", false);
Ect ect = this.d;
C14957gcv.e(ect);
ect.e.setOnClickListener(new View.OnClickListener(this) { // from class: o.eHp
private BankingEnterAmountFragment a;
@Override // android.view.View.OnClickListener
public final void onClick(View view2) {
BankingEnterAmountFragment.b(this.a);
}
{
this.a = this;
}
});
Context requireContext = requireContext();
C14957gcv.c(requireContext, "");
C12089erd c12089erd = new C12089erd(requireContext, new HBt(this));
this.g = c12089erd;
Ect ect2 = this.d;
C14957gcv.e(ect2);
NoSwipeViewPager noSwipeViewPager = ect2.a;
c12089erd.c = noSwipeViewPager;
C14957gcv.e(noSwipeViewPager);
noSwipeViewPager.setAdapter(c12089erd);
noSwipeViewPager.addOnPageChangeListener(c12089erd.e);
huo<Intent> registerForActivityResult = registerForActivityResult(new C11560ehe.Sts(), new InterfaceC0834Plv(this) { // from class: o.eHo
private BankingEnterAmountFragment b;
@Override // o.InterfaceC0834Plv
public final void d(Object obj) {
BankingEnterAmountFragment.e(this.b, (Heg) obj);
}
{
this.b = this;
}
});
C14957gcv.c(registerForActivityResult, "");
this.j = registerForActivityResult;
C2610ahp c2610ahp = this.presenter;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
c2610ahp.e((C2610ahp) this);
Bundle arguments2 = getArguments();
String string2 = arguments2 != null ? arguments2.getString("com.scb.phone.EXTRA_POSTING_TYPE") : null;
if (string2 == null) {
string2 = "";
}
C14957gcv.e(string2, "");
c2610ahp.c = string2;
if (c2610ahp.f != 0) {
c2610ahp.f.y();
}
C15634hL c15634hL = c2610ahp.e;
C2610ahp.HBt hBt = new C2610ahp.HBt(c2610ahp);
C2610ahp.Sts sts2 = new C2610ahp.Sts(c2610ahp);
C14957gcv.e(hBt, "");
C14957gcv.e(sts2, "");
c15634hL.b(c15634hL.d, hBt, sts2, new AbstractC15351go.LWm());
c2610ahp.d();
JVY jvy = (JVY) this.h.e();
if (jvy != null) {
JVY jvy2 = jvy;
if (getActivity() != null) {
jvy2.c(((BaseActivity) getActivity()).scbAnalytics, "bankingagent_input");
}
}
}
/* loaded from: classes5.dex */
public static final class HBt implements AbstractC12056eqx.HBt<FA> {
private BankingEnterAmountFragment b;
HBt(BankingEnterAmountFragment bankingEnterAmountFragment) {
this.b = bankingEnterAmountFragment;
}
@Override // o.AbstractC12056eqx.HBt
public final /* synthetic */ void e(FA fa) {
FA fa2 = fa;
C14957gcv.e(fa2, "");
C2610ahp c2610ahp = this.b.presenter;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
C14957gcv.e(fa2, "");
c2610ahp.d = fa2;
C2612ahr c2612ahr = new C2612ahr(c2610ahp);
if (c2610ahp.f != 0) {
c2612ahr.e(c2610ahp.f);
}
}
@Override // o.AbstractC12056eqx.HBt
public final void d() {
C2610ahp c2610ahp = this.b.presenter;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
c2610ahp.d();
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroyView() {
C2610ahp c2610ahp = this.presenter;
huo<Intent> huoVar = null;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
c2610ahp.w_();
this.d = null;
huo<Intent> huoVar2 = this.j;
if (huoVar2 == null) {
C14957gcv.a("");
} else {
huoVar = huoVar2;
}
huoVar.e();
super.onDestroyView();
}
@Override // com.scb.phone.view.fragment.bankingagent.BaseBankingAgentsFragment.HBt
public final void d(final FE fe) {
C14957gcv.e(fe, "");
final C2610ahp c2610ahp = this.presenter;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
C14957gcv.e(fe, "");
c2610ahp.b = fe;
ZI.IeS ieS = new ZI.IeS(c2610ahp, fe) { // from class: o.ahw
private C2610ahp a;
private FE d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2610ahp.b(this.a, this.d, (InterfaceC6624cYb.LWm) obj);
}
{
this.a = c2610ahp;
this.d = fe;
}
};
if (c2610ahp.f != 0) {
ieS.e(c2610ahp.f);
}
C2612ahr c2612ahr = new C2612ahr(c2610ahp);
if (c2610ahp.f != 0) {
c2612ahr.e(c2610ahp.f);
}
}
@Override // o.InterfaceC6624cYb.LWm
public final void d(String str, FE fe) {
C14957gcv.e(str, "");
C14957gcv.e(fe, "");
BankingAgentSelectedFragment.LWm lWm = BankingAgentSelectedFragment.d;
C14957gcv.e(str, "");
C14957gcv.e(fe, "");
BankingAgentSelectedFragment bankingAgentSelectedFragment = new BankingAgentSelectedFragment();
Bundle bundle = new Bundle();
bundle.putParcelable("com.scb.phone.EXTRA_BANKING_AGENT_TAG", fe);
bundle.putString("com.scb.phone.EXTRA_POSTING_TYPE", str);
bankingAgentSelectedFragment.setArguments(bundle);
e(bankingAgentSelectedFragment, R.id.fragment_container_banking_agent, "com.scb.phone.BANKING_AGENT_ENTER_AMOUNT_CONTAINER_TAG", false, true);
}
@Override // com.scb.phone.view.fragment.bankingagent.BankingAgentSelectedFragment.HBt
public final void j() {
C2610ahp c2610ahp = this.presenter;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
if (c2610ahp.b != null) {
c2610ahp.a = -1.0d;
c2610ahp.b = null;
ZI.IeS ieS = new ZI.IeS() { // from class: o.aho
@Override // o.ZI.IeS
public final void e(Object obj) {
C2610ahp.b((InterfaceC6624cYb.LWm) obj);
}
};
if (c2610ahp.f != 0) {
ieS.e(c2610ahp.f);
}
}
}
@Override // o.InterfaceC6624cYb.LWm
public final void a() {
BankingAgentsFragment.Sts sts = BankingAgentsFragment.c;
Bundle arguments = getArguments();
String string = arguments != null ? arguments.getString("com.scb.phone.EXTRA_POSTING_TYPE", "D") : null;
e(BankingAgentsFragment.Sts.a(string != null ? string : "D"), R.id.fragment_container_banking_agent, "com.scb.phone.BANKING_AGENT_ENTER_AMOUNT_CONTAINER_TAG", false, true);
aN_();
}
@Override // o.InterfaceC6624cYb.LWm
public final void a(boolean z) {
Ect ect = this.d;
C14957gcv.e(ect);
ect.e.setVisibility(z ? 0 : 8);
}
@Override // o.InterfaceC6624cYb.LWm
public final void b() {
huo<Intent> huoVar = this.j;
if (huoVar == null) {
C14957gcv.a("");
huoVar = null;
}
BankingAgentTCActivity.HBt hBt = BankingAgentTCActivity.b;
Context requireContext = requireContext();
C14957gcv.c(requireContext, "");
C14957gcv.e(requireContext, "");
huoVar.d(new Intent(requireContext, (Class<?>) BankingAgentTCActivity.class), null);
}
@Override // o.InterfaceC6624cYb.LWm
public final void d(FB fb) {
C14957gcv.e(fb, "");
Context context = getContext();
if (context != null) {
BankingAgentReviewActivity.LWm lWm = BankingAgentReviewActivity.b;
JVY jvy = (JVY) this.h.e();
C14957gcv.e(context, "");
C14957gcv.e(fb, "");
Intent intent = new Intent(context, (Class<?>) BankingAgentReviewActivity.class);
intent.putExtra("BANKING_AGENT_REVIEW_DISPLAY", fb);
intent.putExtra("banking_agent_bundle", jvy);
context.startActivity(intent);
}
}
@Override // com.scb.phone.view.fragment.bankingagent.BankingAgentSelectedFragment.HBt
public final void c(double d) {
C2610ahp c2610ahp = this.presenter;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
c2610ahp.a = d;
C2612ahr c2612ahr = new C2612ahr(c2610ahp);
if (c2610ahp.f != 0) {
c2612ahr.e(c2610ahp.f);
}
}
@Override // o.InterfaceC6624cYb.LWm
public final void c(boolean z) {
Ect ect = this.d;
C14957gcv.e(ect);
ect.e.setEnabled(z);
}
@Override // o.InterfaceC6624cYb.LWm
public final void e(boolean z) {
C12089erd c12089erd = this.g;
if (c12089erd == null) {
C14957gcv.a("");
c12089erd = null;
}
c12089erd.b = z;
c12089erd.notifyDataSetChanged();
}
@Override // o.InterfaceC6624cYb.LWm
public final void b(List<FA> list) {
C14957gcv.e(list, "");
Ect ect = this.d;
C14957gcv.e(ect);
CircleIndicator circleIndicator = ect.c;
int size = list.size();
circleIndicator.setVisibility((size <= 0 || size >= 10) ? 8 : 0);
C12089erd c12089erd = this.g;
if (c12089erd == null) {
C14957gcv.a("");
c12089erd = null;
}
c12089erd.a = list;
c12089erd.notifyDataSetChanged();
List<FA> list2 = list;
if (list2 != null && !list2.isEmpty()) {
ViewPager viewPager = c12089erd.c;
if (viewPager != null) {
viewPager.setClipToPadding(false);
}
Resources resources = c12089erd.d.getResources();
int dimensionPixelOffset = resources != null ? resources.getDimensionPixelOffset(R.dimen.f28502131166616) : 0;
ViewPager viewPager2 = c12089erd.c;
if (viewPager2 != null) {
viewPager2.setPadding(dimensionPixelOffset, 0, dimensionPixelOffset, 0);
}
c12089erd.e.onPageSelected(0);
}
ect.c.setViewPager(ect.a);
}
@Override // o.InterfaceC6624cYb.LWm
public final void c() {
FragmentActivity activity = getActivity();
if (activity != null) {
activity.finish();
}
}
@Override // o.InterfaceC6624cYb.LWm
public final void d() {
startActivity((Intent) HomeActivity.e(new Object[]{getContext()}, -1290522472, 1290522474, (int) System.currentTimeMillis()));
FragmentActivity activity = getActivity();
if (activity != null) {
activity.finish();
}
}
@Override // o.InterfaceC6624cYb.LWm
public final void e() {
Ect ect = this.d;
C14957gcv.e(ect);
LinearLayout linearLayout = ect.b;
C14957gcv.c(linearLayout, "");
LinearLayout linearLayout2 = linearLayout;
C14957gcv.e(linearLayout2, "");
linearLayout2.setVisibility(8);
}
public static /* synthetic */ void b(BankingEnterAmountFragment bankingEnterAmountFragment) {
FE fe;
String str;
C14957gcv.e(bankingEnterAmountFragment, "");
C2610ahp c2610ahp = bankingEnterAmountFragment.presenter;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
if (c2610ahp.f != 0) {
c2610ahp.f.y();
}
FA fa = c2610ahp.d;
if (fa == null || (fe = c2610ahp.b) == null) {
return;
}
C15634hL c15634hL = c2610ahp.e;
C2610ahp.RVV rvv = new C2610ahp.RVV(c2610ahp, fa, fe);
C2610ahp.tOB tob = new C2610ahp.tOB(c2610ahp);
String str2 = fa.b;
String str3 = fe.e;
String str4 = fe.h;
double d = c2610ahp.a;
String str5 = c2610ahp.c;
if (str5 == null) {
C14957gcv.a("");
str = null;
} else {
str = str5;
}
SnH.HBt hBt = new SnH.HBt(str2, str3, str4, "BANKING_AGENT", d, str);
C14957gcv.e(rvv, "");
C14957gcv.e(tob, "");
C14957gcv.e(hBt, "");
c15634hL.b(c15634hL.h, rvv, tob, hBt);
}
public static /* synthetic */ void e(BankingEnterAmountFragment bankingEnterAmountFragment, Heg heg) {
C14957gcv.e(bankingEnterAmountFragment, "");
C14957gcv.e(heg, "");
if (heg.e == 0) {
C2610ahp c2610ahp = bankingEnterAmountFragment.presenter;
if (c2610ahp == null) {
C14957gcv.a("");
c2610ahp = null;
}
ZI.IeS ieS = new ZI.IeS() { // from class: o.ahn
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6624cYb.LWm) obj).c();
}
};
if (c2610ahp.f != 0) {
ieS.e(c2610ahp.f);
}
}
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559558, viewGroup, false);
int i = R.id.account_select_indicator;
CircleIndicator circleIndicator = (CircleIndicator) qeC.e(inflate, R.id.account_select_indicator);
if (circleIndicator != null) {
i = R.id.agent_layout;
LinearLayout linearLayout = (LinearLayout) qeC.e(inflate, R.id.agent_layout);
if (linearLayout != null) {
i = R.id.bt_review;
Button button = (Button) qeC.e(inflate, R.id.bt_review);
if (button != null) {
i = R.id.fragment_container_banking_agent;
FrameLayout frameLayout = (FrameLayout) qeC.e(inflate, R.id.fragment_container_banking_agent);
if (frameLayout != null) {
NestedScrollView nestedScrollView = (NestedScrollView) inflate;
i = R.id.vp_accounts;
NoSwipeViewPager noSwipeViewPager = (NoSwipeViewPager) qeC.e(inflate, R.id.vp_accounts);
if (noSwipeViewPager != null) {
Ect ect = new Ect(nestedScrollView, circleIndicator, linearLayout, button, frameLayout, nestedScrollView, noSwipeViewPager);
this.d = ect;
C14957gcv.e(ect);
NestedScrollView nestedScrollView2 = ect.d;
C14957gcv.c(nestedScrollView2, "");
return nestedScrollView2;
}
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
}