what-the-bank/sources/com/scb/phone/view/fragment/prepaid/traveltab/PrepaidTravelWalletTabFragm...

454 lines
14 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.prepaid.traveltab;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.prepaid.AddNewCurrencyActivity;
import com.scb.phone.view.activity.prepaid.PrepaidDetailsActivity;
import com.scb.phone.view.activity.prepaid.PrepaidTravelForeignCurrencyWalletDetailActivity;
import com.scb.phone.view.fragment.BaseFragment;
import java.util.ArrayList;
import java.util.List;
import o.AbstractC14961gcz;
import o.C1049Un;
import o.C12386exI;
import o.C14881gav;
import o.C14957gcv;
import o.C7691ctB;
import o.C7692ctC;
import o.Dwh;
import o.InterfaceC12865fJi;
import o.InterfaceC13391fZD;
import o.InterfaceC13393fZL;
import o.InterfaceC14890gbN;
import o.InterfaceC9509dlA;
import o.UA;
import o.UE;
import o.fZZ;
/* loaded from: classes5.dex */
public final class PrepaidTravelWalletTabFragment extends Hilt_PrepaidTravelWalletTabFragment implements InterfaceC9509dlA.RVV, PrepaidDetailsActivity.Sts, C12386exI.RVV {
@BindView
public Button btBuyNewCurrency;
private C12386exI c;
private final InterfaceC13393fZL d;
private InterfaceC12865fJi h;
private C1049Un i;
@BindView
public LinearLayout llViewCustomError;
@BindView
public LinearLayout llViewCustomProgress;
@InterfaceC13391fZD
public C7692ctC presenter;
@BindView
public RecyclerView rvWallet;
public PrepaidTravelWalletTabFragment() {
LWm lWm = LWm.e;
C14957gcv.e(lWm, "");
this.d = new fZZ(lWm);
}
/* loaded from: classes5.dex */
public static final class Sts {
private Sts() {
}
public /* synthetic */ Sts(byte b) {
this();
}
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.prepaid.traveltab.Hilt_PrepaidTravelWalletTabFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public final void onAttach(Context context) {
C14957gcv.e(context, "");
super.onAttach(context);
if (context instanceof InterfaceC12865fJi) {
this.h = (InterfaceC12865fJi) context;
}
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
return layoutInflater.inflate(R.layout.2131559827, viewGroup, false);
}
@Override // androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
C1049Un c1049Un;
C14957gcv.e(view, "");
super.onViewCreated(view, bundle);
((BaseFragment) this).a = ButterKnife.c(this, view);
C7692ctC c7692ctC = this.presenter;
C1049Un c1049Un2 = null;
if (c7692ctC == null) {
C14957gcv.a("");
c7692ctC = null;
}
c7692ctC.e((C7692ctC) this);
Bundle arguments = getArguments();
if (arguments != null && (c1049Un = (C1049Un) arguments.getParcelable("ARGS_PREPAID_CARD_DISPLAY")) != null) {
C14957gcv.c(c1049Un, "");
this.i = c1049Un;
}
C12386exI c12386exI = new C12386exI();
this.c = c12386exI;
PrepaidTravelWalletTabFragment prepaidTravelWalletTabFragment = this;
C14957gcv.e(prepaidTravelWalletTabFragment, "");
c12386exI.e = prepaidTravelWalletTabFragment;
RecyclerView recyclerView = this.rvWallet;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
getContext();
recyclerView.setLayoutManager(new LinearLayoutManager());
RecyclerView recyclerView2 = this.rvWallet;
if (recyclerView2 == null) {
C14957gcv.a("");
recyclerView2 = null;
}
recyclerView2.setNestedScrollingEnabled(false);
RecyclerView recyclerView3 = this.rvWallet;
if (recyclerView3 == null) {
C14957gcv.a("");
recyclerView3 = null;
}
C12386exI c12386exI2 = this.c;
if (c12386exI2 == null) {
C14957gcv.a("");
c12386exI2 = null;
}
recyclerView3.setAdapter(c12386exI2);
C7692ctC c7692ctC2 = this.presenter;
if (c7692ctC2 == null) {
C14957gcv.a("");
c7692ctC2 = null;
}
C1049Un c1049Un3 = this.i;
if (c1049Un3 == null) {
C14957gcv.a("");
} else {
c1049Un2 = c1049Un3;
}
String str = c1049Un2.i;
C14957gcv.e(str, "");
C7691ctB c7691ctB = new C7691ctB(c7692ctC2, str);
if (c7692ctC2.f != 0) {
c7691ctB.e(c7692ctC2.f);
}
}
@Override // o.InterfaceC9509dlA.RVV
public final void a(boolean z, boolean z2) {
InterfaceC12865fJi interfaceC12865fJi = this.h;
if (interfaceC12865fJi == null) {
C14957gcv.a("");
interfaceC12865fJi = null;
}
interfaceC12865fJi.e(z, z2);
}
@Override // com.scb.phone.view.activity.prepaid.PrepaidDetailsActivity.Sts
public final void b(C1049Un c1049Un) {
if (c1049Un != null) {
this.i = c1049Un;
C7692ctC c7692ctC = this.presenter;
if (c7692ctC == null) {
C14957gcv.a("");
c7692ctC = null;
}
String str = c1049Un.i;
C14957gcv.e(str, "");
C7691ctB c7691ctB = new C7691ctB(c7692ctC, str);
if (c7692ctC.f != 0) {
c7691ctB.e(c7692ctC.f);
}
}
Dwh dwh = (Dwh) this.d.e();
if (getActivity() != null) {
dwh.c(((BaseActivity) getActivity()).scbAnalytics, "planetscb_summary_wallet_screen");
}
}
@Override // o.InterfaceC9509dlA.RVV
public final void b(List<UA> list) {
int size;
C14957gcv.e(list, "");
if (getContext() != null) {
C12386exI c12386exI = this.c;
UE ue = null;
if (c12386exI == null) {
C14957gcv.a("");
c12386exI = null;
}
C14957gcv.e(list, "");
c12386exI.c = (UA) C14881gav.e((List) list);
ArrayList arrayList = new ArrayList();
for (Object obj : list) {
if (((UA) obj).g == 1) {
arrayList.add(obj);
}
}
c12386exI.a = arrayList;
if (c12386exI.a()) {
List<UA> list2 = c12386exI.a;
if (list2 == null) {
C14957gcv.a("");
list2 = null;
}
size = list2.size() + 3;
} else {
List<UA> list3 = c12386exI.a;
if (list3 == null) {
C14957gcv.a("");
list3 = null;
}
size = list3.size() + 2;
}
c12386exI.b = size;
c12386exI.notifyDataSetChanged();
InterfaceC12865fJi interfaceC12865fJi = this.h;
if (interfaceC12865fJi == null) {
C14957gcv.a("");
interfaceC12865fJi = null;
}
C7692ctC c7692ctC = this.presenter;
if (c7692ctC == null) {
C14957gcv.a("");
c7692ctC = null;
}
UE ue2 = c7692ctC.c;
if (ue2 == null) {
C14957gcv.a("");
} else {
ue = ue2;
}
interfaceC12865fJi.a(ue);
}
}
@Override // o.InterfaceC9509dlA.RVV
public final void b() {
LinearLayout linearLayout = this.llViewCustomProgress;
Button button = null;
if (linearLayout == null) {
C14957gcv.a("");
linearLayout = null;
}
linearLayout.setVisibility(0);
LinearLayout linearLayout2 = this.llViewCustomError;
if (linearLayout2 == null) {
C14957gcv.a("");
linearLayout2 = null;
}
linearLayout2.setVisibility(8);
RecyclerView recyclerView = this.rvWallet;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
recyclerView.setVisibility(8);
Button button2 = this.btBuyNewCurrency;
if (button2 != null) {
button = button2;
} else {
C14957gcv.a("");
}
button.setVisibility(8);
}
@Override // o.InterfaceC9509dlA.RVV
public final void d() {
LinearLayout linearLayout = this.llViewCustomProgress;
Button button = null;
if (linearLayout == null) {
C14957gcv.a("");
linearLayout = null;
}
linearLayout.setVisibility(8);
RecyclerView recyclerView = this.rvWallet;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
recyclerView.setVisibility(0);
Button button2 = this.btBuyNewCurrency;
if (button2 != null) {
button = button2;
} else {
C14957gcv.a("");
}
button.setVisibility(0);
}
@Override // o.InterfaceC9509dlA.RVV
public final void c() {
LinearLayout linearLayout = this.llViewCustomProgress;
LinearLayout linearLayout2 = null;
if (linearLayout == null) {
C14957gcv.a("");
linearLayout = null;
}
linearLayout.setVisibility(8);
LinearLayout linearLayout3 = this.llViewCustomError;
if (linearLayout3 != null) {
linearLayout2 = linearLayout3;
} else {
C14957gcv.a("");
}
linearLayout2.setVisibility(0);
}
@Override // o.InterfaceC9509dlA.RVV
public final void a() {
Button button = this.btBuyNewCurrency;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(true);
}
@Override // o.InterfaceC9509dlA.RVV
public final void e() {
Button button = this.btBuyNewCurrency;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(false);
}
@Override // o.C12386exI.RVV
public final void a(UA ua, ArrayList<String> arrayList) {
C14957gcv.e(ua, "");
C14957gcv.e(arrayList, "");
Context context = getContext();
if (context != null) {
PrepaidTravelForeignCurrencyWalletDetailActivity.HBt hBt = PrepaidTravelForeignCurrencyWalletDetailActivity.f7774o;
C7692ctC c7692ctC = this.presenter;
UE ue = null;
if (c7692ctC == null) {
C14957gcv.a("");
c7692ctC = null;
}
UE ue2 = c7692ctC.c;
if (ue2 == null) {
C14957gcv.a("");
} else {
ue = ue2;
}
startActivity(PrepaidTravelForeignCurrencyWalletDetailActivity.HBt.akJ_(context, ua, ue, arrayList));
}
}
@OnClick
public final void onReloadClick() {
C7692ctC c7692ctC = this.presenter;
C1049Un c1049Un = null;
if (c7692ctC == null) {
C14957gcv.a("");
c7692ctC = null;
}
C1049Un c1049Un2 = this.i;
if (c1049Un2 == null) {
C14957gcv.a("");
} else {
c1049Un = c1049Un2;
}
String str = c1049Un.i;
C14957gcv.e(str, "");
C7691ctB c7691ctB = new C7691ctB(c7692ctC, str);
if (c7692ctC.f != 0) {
c7691ctB.e(c7692ctC.f);
}
}
@OnClick
public final void navigateToNewCurrencyPage() {
Dwh dwh = (Dwh) this.d.e();
if (getActivity() != null) {
dwh.c(((BaseActivity) getActivity()).scbAnalytics, "planetscb_buynewcurrency");
}
Context context = getContext();
if (context != null) {
AddNewCurrencyActivity.IeS ieS = AddNewCurrencyActivity.b;
C7692ctC c7692ctC = this.presenter;
UE ue = null;
if (c7692ctC == null) {
C14957gcv.a("");
c7692ctC = null;
}
UE ue2 = c7692ctC.c;
if (ue2 == null) {
C14957gcv.a("");
} else {
ue = ue2;
}
C14957gcv.e(context, "");
C14957gcv.e(ue, "");
Intent putExtra = new Intent(context, (Class<?>) AddNewCurrencyActivity.class).putExtra("EXTRA_PREPAID_TRAVEL_WALLET_SUMMARY", ue);
C14957gcv.c(putExtra, "");
startActivity(putExtra);
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroyView() {
C7692ctC c7692ctC = this.presenter;
if (c7692ctC == null) {
C14957gcv.a("");
c7692ctC = null;
}
c7692ctC.w_();
super.onDestroyView();
}
/* loaded from: classes5.dex */
static final class LWm extends AbstractC14961gcz implements InterfaceC14890gbN<Dwh> {
public static final LWm e = new LWm();
@Override // o.InterfaceC14890gbN
public final /* synthetic */ Dwh invoke() {
return new Dwh();
}
LWm() {
super(0);
}
}
public static final PrepaidTravelWalletTabFragment e(C1049Un c1049Un) {
C14957gcv.e(c1049Un, "");
PrepaidTravelWalletTabFragment prepaidTravelWalletTabFragment = new PrepaidTravelWalletTabFragment();
Bundle bundle = new Bundle();
bundle.putParcelable("ARGS_PREPAID_CARD_DISPLAY", c1049Un);
prepaidTravelWalletTabFragment.setArguments(bundle);
return prepaidTravelWalletTabFragment;
}
static {
new Sts((byte) 0);
}
}