what-the-bank/sources/com/scb/phone/view/fragment/debitcard/DebitCardActivationInputFra...

373 lines
12 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.debitcard;
import android.content.Context;
import android.os.Bundle;
import android.text.Editable;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.debitcard.DebitCardRefInformationActivity;
import com.scb.phone.view.custom.common.CustomEditText;
import com.scb.phone.view.custom.item.ItemIconCustom;
import com.scb.phone.view.custom.item.ItemSimpleCustom;
import com.scb.phone.view.fragment.debitcard.DebitCardActivationInputFragment;
import java.util.ArrayList;
import java.util.List;
import me.relex.circleindicator.CircleIndicator;
import o.C12126esN;
import o.C1406aDS;
import o.C14957gcv;
import o.InterfaceC13391fZD;
import o.InterfaceC9097ddL;
import o.KMA;
import o.QE;
import o.QK;
import o.QO;
import o.YE;
import o.ZI;
import o.fJJ;
import o.kOa;
import o.nMh;
/* loaded from: classes5.dex */
public class DebitCardActivationInputFragment extends Hilt_DebitCardActivationInputFragment implements InterfaceC9097ddL {
@BindView
ItemIconCustom accountCustomComponent;
@BindView
Button activateButton;
private C12126esN c = new C12126esN(new ArrayList());
@BindView
ItemSimpleCustom cardFormatCustomComponent;
@BindView
CustomEditText cardInputEditText;
@BindView
TextView cardInputError;
@BindView
ViewPager cardViewPager;
@BindView
CircleIndicator circleIndicator;
@BindView
Group contentDebitCardFormatGroup;
@BindView
Group contentDisplayStateGroup;
private fJJ d;
@BindView
Group emptyStateGroup;
private Sts f;
@BindView
ImageView ivHelp;
@InterfaceC13391fZD
public C1406aDS presenter;
@BindView
ConstraintLayout rootConstraint;
@BindView
TextView tvDebitCardInputTitle;
/* loaded from: classes5.dex */
public interface Sts {
void c(boolean z);
}
public static DebitCardActivationInputFragment j() {
return new DebitCardActivationInputFragment();
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559533, viewGroup, false);
ButterKnife.c(this, inflate);
this.presenter.e((C1406aDS) this);
C1406aDS c1406aDS = this.presenter;
if (c1406aDS.f != 0) {
c1406aDS.f.y();
}
c1406aDS.b.d(YE.DEBIT_CARD_FUNCTION.toString());
KMA kma = c1406aDS.b;
kma.d(kma.i, new C1406aDS.AnonymousClass2(c1406aDS));
this.cardViewPager.setAdapter(this.c);
this.cardViewPager.addOnPageChangeListener(new ViewPager.jbe(this) { // from class: com.scb.phone.view.fragment.debitcard.DebitCardActivationInputFragment.3
private DebitCardActivationInputFragment e;
{
this.e = this;
}
@Override // androidx.viewpager.widget.ViewPager.jbe, androidx.viewpager.widget.ViewPager.ojQ
public final void onPageSelected(final int i) {
final C1406aDS c1406aDS2 = this.e.presenter;
ZI.IeS ieS = new ZI.IeS(c1406aDS2, i) { // from class: o.aDQ
private int b;
private C1406aDS e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C1406aDS.b(this.e, this.b, (InterfaceC9097ddL) obj);
}
{
this.e = c1406aDS2;
this.b = i;
}
};
if (c1406aDS2.f != 0) {
ieS.e(c1406aDS2.f);
}
}
});
this.circleIndicator.setViewPager(this.cardViewPager);
this.c.registerDataSetObserver(this.circleIndicator.c);
this.d = new fJJ(this) { // from class: com.scb.phone.view.fragment.debitcard.DebitCardActivationInputFragment.4
private DebitCardActivationInputFragment c;
{
this.c = this;
}
@Override // o.fJJ, android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
final C1406aDS c1406aDS2 = this.c.presenter;
final String obj = editable.toString();
c1406aDS2.e = obj;
ZI.IeS ieS = new ZI.IeS(c1406aDS2, obj) { // from class: o.aDX
private C1406aDS a;
private String e;
@Override // o.ZI.IeS
public final void e(Object obj2) {
C1406aDS.c(this.e, (InterfaceC9097ddL) obj2);
}
{
this.a = c1406aDS2;
this.e = obj;
}
};
if (c1406aDS2.f != 0) {
ieS.e(c1406aDS2.f);
}
}
};
this.cardInputEditText.clearFocus();
this.cardInputEditText.addTextChangedListener(this.d);
this.cardInputEditText.setOnBackListener(new CustomEditText.LWm(this) { // from class: o.ePV
private DebitCardActivationInputFragment c;
@Override // com.scb.phone.view.custom.common.CustomEditText.LWm
public final void a() {
DebitCardActivationInputFragment.c(this.c);
}
{
this.c = this;
}
});
this.cardInputEditText.setOnEditorActionListener(new TextView.OnEditorActionListener(this) { // from class: o.ePT
private DebitCardActivationInputFragment c;
@Override // android.widget.TextView.OnEditorActionListener
public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
return DebitCardActivationInputFragment.e(this.c, i);
}
{
this.c = this;
}
});
this.cardInputEditText.setOnFocusChangeListener(new View.OnFocusChangeListener(this) { // from class: o.eQc
private DebitCardActivationInputFragment a;
@Override // android.view.View.OnFocusChangeListener
public final void onFocusChange(View view, boolean z) {
DebitCardActivationInputFragment.c(this.a, z);
}
{
this.a = this;
}
});
return inflate;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.debitcard.Hilt_DebitCardActivationInputFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof Sts) {
this.f = (Sts) context;
}
}
@Override // androidx.fragment.app.Fragment
public void onDetach() {
super.onDetach();
this.f = null;
}
@Override // o.InterfaceC9097ddL
public final void a(List<QE> list) {
C12126esN c12126esN = this.c;
C14957gcv.e(list, "");
c12126esN.b = list;
c12126esN.notifyDataSetChanged();
}
@Override // o.InterfaceC9097ddL
public final void c(QK qk) {
this.accountCustomComponent.setUpWithDisplay(qk);
this.cardInputEditText.setText("");
this.cardInputEditText.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_gray_rounded_rectangle));
this.cardInputError.setVisibility(8);
}
@Override // o.InterfaceC9097ddL
public final void d() {
this.emptyStateGroup.setVisibility(0);
}
@Override // o.InterfaceC9097ddL
public final void c(boolean z) {
this.contentDisplayStateGroup.setVisibility(0);
this.circleIndicator.setVisibility(z ? 0 : 8);
}
@Override // o.InterfaceC9097ddL
public final void a(String str) {
this.cardInputEditText.removeTextChangedListener(this.d);
this.cardInputEditText.setText(str);
this.cardInputEditText.setSelection(str.length());
this.cardInputEditText.addTextChangedListener(this.d);
}
@Override // o.InterfaceC9097ddL
public final void c(QO qo) {
this.contentDebitCardFormatGroup.setVisibility(0);
this.cardFormatCustomComponent.setUpWithDisplay(qo);
this.tvDebitCardInputTitle.setText(R.string.debit_card_activation_input_reference_title_label);
this.cardInputEditText.setHint(R.string.debit_card_activation_input_reference_hint_label);
this.ivHelp.setVisibility(0);
}
@Override // o.InterfaceC9097ddL
public final void a() {
this.contentDebitCardFormatGroup.setVisibility(8);
this.ivHelp.setVisibility(8);
this.tvDebitCardInputTitle.setText(R.string.debit_card_activation_input_title_label);
this.cardInputEditText.setHint(R.string.debit_card_activation_input_hint_label);
}
@Override // o.InterfaceC9097ddL
public final void b(boolean z) {
this.activateButton.setEnabled(z);
}
@Override // o.InterfaceC9097ddL
public final void a(boolean z) {
Sts sts = this.f;
if (sts != null) {
sts.c(z);
}
}
@Override // o.InterfaceC9097ddL
public final void e() {
this.cardInputEditText.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_gray_rounded_rectangle));
this.cardInputError.setVisibility(8);
}
@Override // o.InterfaceC9097ddL
public final void b() {
this.cardInputEditText.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_red_reounded_reactangle_border));
this.cardInputError.setVisibility(0);
this.cardInputError.setText(R.string.debit_card_activation_card_reference_number_error);
}
@Override // o.InterfaceC9097ddL
public final void c() {
this.cardInputEditText.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_red_reounded_reactangle_border));
this.cardInputError.setVisibility(0);
this.cardInputError.setText(R.string.debit_card_activation_card_number_error);
}
@OnClick
public void onActivateButtonClicked() {
C1406aDS c1406aDS = this.presenter;
int currentItem = this.cardViewPager.getCurrentItem();
String obj = this.cardInputEditText.getText().toString();
if (c1406aDS.f != 0) {
c1406aDS.f.y();
}
c1406aDS.g = currentItem;
c1406aDS.c.e(obj.replace(" ", ""), c1406aDS.a.get(currentItem).e);
kOa koa = c1406aDS.c;
koa.d(koa.i, new C1406aDS.HBt(c1406aDS));
}
@OnClick
public void navigateToHelp() {
Context context = getContext();
C1406aDS c1406aDS = this.presenter;
startActivity(DebitCardRefInformationActivity.abd_(context, c1406aDS.d.b_(c1406aDS.i)));
}
public static /* synthetic */ void c(DebitCardActivationInputFragment debitCardActivationInputFragment, boolean z) {
final C1406aDS c1406aDS = debitCardActivationInputFragment.presenter;
boolean z2 = !z;
ZI.IeS ieS = new ZI.IeS(c1406aDS) { // from class: o.aDT
private C1406aDS b;
@Override // o.ZI.IeS
public final void e(Object obj) {
C1406aDS.e(this.b, (InterfaceC9097ddL) obj);
}
{
this.b = c1406aDS;
}
};
if (!z2 || c1406aDS.f == 0) {
return;
}
ieS.e(c1406aDS.f);
}
public static /* synthetic */ boolean e(DebitCardActivationInputFragment debitCardActivationInputFragment, int i) {
if (i != 6) {
return false;
}
debitCardActivationInputFragment.cardInputEditText.clearFocus();
debitCardActivationInputFragment.rootConstraint.requestFocus();
debitCardActivationInputFragment.aN_();
return true;
}
public static /* synthetic */ void c(DebitCardActivationInputFragment debitCardActivationInputFragment) {
debitCardActivationInputFragment.cardInputEditText.clearFocus();
debitCardActivationInputFragment.rootConstraint.requestFocus();
}
}