what-the-bank/sources/com/scb/phone/view/fragment/cardmanagement/CardActivationFragment.java

469 lines
17 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.cardmanagement;
import android.content.Intent;
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.AdapterView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import com.scb.phone.R;
import com.scb.phone.view.custom.common.DefaultButton;
import com.scb.phone.view.fragment.cardmanagement.CardActivationFragment;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import java.util.Calendar;
import o.AIb;
import o.C0439Gp;
import o.C0443Gr;
import o.C0690Mh;
import o.C0693Mj;
import o.C12060erA;
import o.C13020fOa;
import o.C14957gcv;
import o.C16375no;
import o.C2883amx;
import o.GlE;
import o.InterfaceC13391fZD;
import o.InterfaceC8956dad;
import o.InterfaceC8999dbT;
import o.LmF;
import o.ZAm;
import o.ZI;
import o.nMh;
import o.oWG;
import o.qeC;
import o.xZj;
/* loaded from: classes5.dex */
public final class CardActivationFragment extends Hilt_CardActivationFragment implements InterfaceC8999dbT.RVV {
public static final LWm c = new LWm(0);
private LmF d;
private String g;
private String h;
private RVV i;
private InterfaceC8956dad j;
@InterfaceC13391fZD
public C2883amx presenter;
/* loaded from: classes5.dex */
enum IeS {
YEAR,
MONTH
}
/* loaded from: classes5.dex */
public interface RVV {
void c(String str);
void d(String str);
void d(C0443Gr c0443Gr);
void e(String str);
void f();
void h();
}
public static final /* synthetic */ LmF d(CardActivationFragment cardActivationFragment) {
LmF lmF = cardActivationFragment.d;
C14957gcv.e(lmF);
return lmF;
}
/* loaded from: classes5.dex */
public static final class LWm {
private LWm() {
}
public /* synthetic */ LWm(byte b) {
this();
}
}
@Override // androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
C0443Gr c0443Gr;
Intent intent;
Intent intent2;
Parcelable parcelable;
C14957gcv.e(view, "");
super.onViewCreated(view, bundle);
C2883amx c2883amx = this.presenter;
if (c2883amx == null) {
C14957gcv.a("");
c2883amx = null;
}
c2883amx.e((C2883amx) this);
aa();
if (getActivity() != null) {
FragmentActivity activity = getActivity();
if (activity == null || (intent2 = activity.getIntent()) == null) {
c0443Gr = null;
} else {
C14957gcv.c(intent2, "");
if (Build.VERSION.SDK_INT >= 33) {
Bundle extras = intent2.getExtras();
parcelable = extras != null ? (Parcelable) extras.getParcelable("EXTRA_INACTIVE_CARD", C0443Gr.class) : null;
} else {
Bundle extras2 = intent2.getExtras();
Parcelable parcelable2 = extras2 != null ? extras2.getParcelable("EXTRA_INACTIVE_CARD") : null;
if (!(parcelable2 instanceof C0443Gr)) {
parcelable2 = null;
}
parcelable = (C0443Gr) parcelable2;
}
c0443Gr = (C0443Gr) parcelable;
}
FragmentActivity activity2 = getActivity();
boolean z = false;
if (activity2 != null && (intent = activity2.getIntent()) != null) {
z = intent.getBooleanExtra("EXTRA_IS_CARD_X_PRODUCT", false);
}
C2883amx c2883amx2 = this.presenter;
if (c2883amx2 == null) {
C14957gcv.a("");
c2883amx2 = null;
}
c2883amx2.g = z;
C16375no c16375no = c2883amx2.b;
final C0439Gp c2 = C16375no.c(c0443Gr);
ZI.IeS ieS = new ZI.IeS(c2) { // from class: o.amE
private C0439Gp d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2883amx.d(this.d, (InterfaceC8999dbT.RVV) obj);
}
{
this.d = c2;
}
};
if (c2883amx2.f != 0) {
ieS.e(c2883amx2.f);
}
this.j = (InterfaceC8956dad) getActivity();
RVV rvv = (RVV) getActivity();
this.i = rvv;
if (rvv != null) {
rvv.d(c0443Gr);
}
C2883amx c2883amx3 = this.presenter;
if (c2883amx3 == null) {
C14957gcv.a("");
c2883amx3 = null;
}
c2883amx3.a = c0443Gr;
}
C2883amx c2883amx4 = this.presenter;
if (c2883amx4 == null) {
C14957gcv.a("");
c2883amx4 = null;
}
if (c2883amx4.f != 0) {
c2883amx4.f.y();
}
ArrayList arrayList = new ArrayList();
C0443Gr c0443Gr2 = c2883amx4.a;
String str = c0443Gr2 != null ? c0443Gr2.c : null;
C0443Gr c0443Gr3 = c2883amx4.a;
arrayList.add(new oWG(str, new oWG.LWm(c0443Gr3 != null ? c0443Gr3.b : null)));
c2883amx4.d.b(new ZAm(arrayList));
xZj xzj = c2883amx4.d;
xzj.d(xzj.i, new C2883amx.Sts(c2883amx4));
LmF lmF = this.d;
C14957gcv.e(lmF);
lmF.e.setOnClickListener(new View.OnClickListener(this) { // from class: o.eIU
private CardActivationFragment c;
@Override // android.view.View.OnClickListener
public final void onClick(View view2) {
CardActivationFragment.c(this.c);
}
{
this.c = this;
}
});
}
/* loaded from: classes5.dex */
public static final class HBt implements AdapterView.OnItemSelectedListener {
private IeS d;
private CardActivationFragment e;
@Override // android.widget.AdapterView.OnItemSelectedListener
public final void onNothingSelected(AdapterView<?> adapterView) {
}
HBt(CardActivationFragment cardActivationFragment, IeS ieS) {
this.e = cardActivationFragment;
this.d = ieS;
}
@Override // android.widget.AdapterView.OnItemSelectedListener
public final void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
String str;
String str2;
C14957gcv.e(adapterView, "");
C14957gcv.e(view, "");
boolean z = false;
if (i == 0) {
View childAt = adapterView.getChildAt(0);
C14957gcv.d(childAt, "");
((TextView) childAt).setTextColor(nMh.getColor(this.e.requireActivity(), R.color.f3412131099849));
return;
}
int i2 = Sts.b[this.d.ordinal()];
C2883amx c2883amx = null;
if (i2 == 1) {
this.e.h = adapterView.getSelectedItem().toString();
C2883amx c2883amx2 = this.e.presenter;
if (c2883amx2 == null) {
C14957gcv.a("");
c2883amx2 = null;
}
c2883amx2.e = this.e.h;
RVV rvv = this.e.i;
if (rvv != null) {
rvv.c(this.e.h);
}
} else if (i2 == 2) {
this.e.g = adapterView.getSelectedItem().toString();
C2883amx c2883amx3 = this.e.presenter;
if (c2883amx3 == null) {
C14957gcv.a("");
c2883amx3 = null;
}
c2883amx3.c = this.e.g;
RVV rvv2 = this.e.i;
if (rvv2 != null) {
rvv2.d(this.e.g);
}
}
DefaultButton defaultButton = CardActivationFragment.d(this.e).e;
C2883amx c2883amx4 = this.e.presenter;
if (c2883amx4 != null) {
c2883amx = c2883amx4;
} else {
C14957gcv.a("");
}
int i3 = Calendar.getInstance().get(1);
int i4 = Calendar.getInstance().get(2);
if (c2883amx.c != null && (str = c2883amx.e) != null && ((str != null && Integer.parseInt(str) != i3) || ((str2 = c2883amx.c) != null && Integer.parseInt(str2) >= i4 + 1))) {
z = true;
}
defaultButton.setButtonEnabled(z);
}
/* loaded from: classes5.dex */
public final /* synthetic */ class Sts {
public static final int[] b;
static {
int[] iArr = new int[IeS.values().length];
try {
iArr[IeS.YEAR.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[IeS.MONTH.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
b = iArr;
}
}
}
@Override // o.InterfaceC8999dbT.RVV
public final void d() {
C0693Mj c0693Mj = new C0693Mj();
c0693Mj.d = getString(R.string.already_activated_title);
c0693Mj.c = getString(R.string.already_activated_message);
C0690Mh c0690Mh = new C0690Mh();
c0690Mh.e = C0690Mh.IeS.NAVIGATE_BACK;
c0690Mh.b = getString(R.string.ok);
c0693Mj.e = c0690Mh;
e(c0693Mj);
}
@Override // o.InterfaceC8999dbT.RVV
public final void b(String str) {
RVV rvv = this.i;
if (rvv != null) {
rvv.e(str);
}
C13020fOa b = Picasso.d().e(str).e(R.drawable.default_card_without_logo).b(R.drawable.default_card);
b.e = true;
LmF lmF = this.d;
C14957gcv.e(lmF);
b.aBu_(lmF.c.c, null);
}
@Override // o.InterfaceC8999dbT.RVV
public final void b(C0439Gp c0439Gp) {
C14957gcv.e(c0439Gp, "");
LmF lmF = this.d;
C14957gcv.e(lmF);
AIb aIb = lmF.c;
aIb.e.setText(c0439Gp.a);
aIb.d.setText(c0439Gp.d);
aIb.a.setText(c0439Gp.b);
}
@Override // o.InterfaceC8999dbT.RVV
public final void b() {
LmF lmF = this.d;
C14957gcv.e(lmF);
lmF.b.setVisibility(0);
lmF.f.setVisibility(0);
lmF.e.setButtonEnabled(false);
LmF lmF2 = this.d;
C14957gcv.e(lmF2);
Spinner spinner = lmF2.d.b;
C14957gcv.c(spinner, "");
FragmentActivity requireActivity = requireActivity();
if (this.presenter == null) {
C14957gcv.a("");
}
spinner.setAdapter((SpinnerAdapter) new C12060erA(requireActivity, R.layout.2131559353, C2883amx.d()));
spinner.setOnItemSelectedListener(new HBt(this, IeS.YEAR));
Spinner spinner2 = lmF2.a.b;
C14957gcv.c(spinner2, "");
spinner2.setAdapter((SpinnerAdapter) new C12060erA(requireActivity(), getResources().getStringArray(R.array.f1342130903062)));
spinner2.setOnItemSelectedListener(new HBt(this, IeS.MONTH));
}
@Override // o.InterfaceC8999dbT.RVV
public final void e() {
LmF lmF = this.d;
C14957gcv.e(lmF);
lmF.b.setVisibility(8);
lmF.f.setVisibility(8);
lmF.e.setButtonEnabled(true);
RVV rvv = this.i;
if (rvv != null) {
rvv.f();
}
}
@Override // o.InterfaceC8999dbT.RVV
public final void a() {
InterfaceC8956dad interfaceC8956dad = this.j;
if (interfaceC8956dad != null) {
interfaceC8956dad.c("OTP_MOBILE_LIST_FRAGMENT_TAG", null, null);
}
}
@Override // o.InterfaceC8999dbT.RVV
public final void c() {
RVV rvv = this.i;
if (rvv != null) {
rvv.h();
}
}
public static /* synthetic */ void c(CardActivationFragment cardActivationFragment) {
C14957gcv.e(cardActivationFragment, "");
final C2883amx c2883amx = cardActivationFragment.presenter;
if (c2883amx == null) {
C14957gcv.a("");
c2883amx = null;
}
ZI.IeS ieS = new ZI.IeS(c2883amx) { // from class: o.amw
private C2883amx c;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2883amx.d(this.c, (InterfaceC8999dbT.RVV) obj);
}
{
this.c = c2883amx;
}
};
if (c2883amx.f != 0) {
ieS.e(c2883amx.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.2131559480, viewGroup, false);
int i = R.id.bottom_view;
LinearLayout linearLayout = (LinearLayout) qeC.e(inflate, R.id.bottom_view);
if (linearLayout != null) {
i = R.id.btn_activate;
DefaultButton defaultButton = (DefaultButton) qeC.e(inflate, R.id.btn_activate);
if (defaultButton != null) {
i = R.id.date_container;
LinearLayout linearLayout2 = (LinearLayout) qeC.e(inflate, R.id.date_container);
if (linearLayout2 != null) {
i = R.id.divider1;
View e = qeC.e(inflate, R.id.divider1);
if (e != null) {
i = R.id.divider2;
View e2 = qeC.e(inflate, R.id.divider2);
if (e2 != null) {
i = R.id.divider3;
View e3 = qeC.e(inflate, R.id.divider3);
if (e3 != null) {
i = R.id.layout_card;
View e4 = qeC.e(inflate, R.id.layout_card);
if (e4 != null) {
AIb c2 = AIb.c(e4);
i = R.id.layout_spinner_month;
View e5 = qeC.e(inflate, R.id.layout_spinner_month);
if (e5 != null) {
GlE c3 = GlE.c(e5);
i = R.id.layout_spinner_year;
View e6 = qeC.e(inflate, R.id.layout_spinner_year);
if (e6 != null) {
GlE c4 = GlE.c(e6);
i = R.id.ll_layout_expiry_date;
LinearLayout linearLayout3 = (LinearLayout) qeC.e(inflate, R.id.ll_layout_expiry_date);
if (linearLayout3 != null) {
i = R.id.tv_activate_detail;
TextView textView = (TextView) qeC.e(inflate, R.id.tv_activate_detail);
if (textView != null) {
i = R.id.txv_card_info;
TextView textView2 = (TextView) qeC.e(inflate, R.id.txv_card_info);
if (textView2 != null) {
i = R.id.txv_expiry_date;
TextView textView3 = (TextView) qeC.e(inflate, R.id.txv_expiry_date);
if (textView3 != null) {
LmF lmF = new LmF((ScrollView) inflate, linearLayout, defaultButton, linearLayout2, e, e2, e3, c2, c3, c4, linearLayout3, textView, textView2, textView3);
this.d = lmF;
C14957gcv.e(lmF);
ScrollView scrollView = lmF.h;
C14957gcv.c(scrollView, "");
return scrollView;
}
}
}
}
}
}
}
}
}
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
}