what-the-bank/sources/com/scb/phone/view/fragment/ntb/touchpoint/TouchPointInputCidFragment....

365 lines
12 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.ntb.touchpoint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.text.method.DigitsKeyListener;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.activity.ntb.ReviewInfoResultActivity;
import com.scb.phone.view.activity.ntb.touchpoint.TouchPointPinActivity;
import com.scb.phone.view.custom.common.CommonInputViewGroup;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.ntb.touchpoint.TouchPointInputCidFragment;
import o.C0996Tg;
import o.C0997Th;
import o.C14218fp;
import o.C14957gcv;
import o.C15602gz;
import o.C16014kV;
import o.C6956cfG;
import o.Ezz;
import o.InterfaceC13391fZD;
import o.InterfaceC9460dkE;
import o.MEY;
import o.fJB;
import o.fKJ;
import o.fLJ;
/* loaded from: classes5.dex */
public final class TouchPointInputCidFragment extends Hilt_TouchPointInputCidFragment implements InterfaceC9460dkE.RVV {
public static final Sts d = new Sts(0);
@BindView
public Button buttonNext;
@BindView
public CommonInputViewGroup ivpNationalIdNumber;
@InterfaceC13391fZD
public C6956cfG presenter;
@BindView
public ViewGroup root;
/* loaded from: classes5.dex */
public static final class Sts {
private Sts() {
}
public /* synthetic */ Sts(byte b) {
this();
}
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559956, viewGroup, false);
((BaseFragment) this).a = ButterKnife.c(this, inflate);
return inflate;
}
@Override // androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
String string;
C14957gcv.e(view, "");
super.onViewCreated(view, bundle);
C6956cfG c6956cfG = this.presenter;
CommonInputViewGroup commonInputViewGroup = null;
if (c6956cfG == null) {
C14957gcv.a("");
c6956cfG = null;
}
c6956cfG.e((C6956cfG) this);
Bundle arguments = getArguments();
if (arguments != null && (string = arguments.getString("EXTRA_MOBILE_NUMBER")) != null) {
C6956cfG c6956cfG2 = this.presenter;
if (c6956cfG2 == null) {
C14957gcv.a("");
c6956cfG2 = null;
}
C14957gcv.e(string, "");
c6956cfG2.d = string;
}
Button button = this.buttonNext;
if (button != null) {
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setOnClickListener(new View.OnClickListener(this) { // from class: o.frs
private TouchPointInputCidFragment b;
@Override // android.view.View.OnClickListener
public final void onClick(View view2) {
TouchPointInputCidFragment.e(this.b);
}
{
this.b = this;
}
});
}
CommonInputViewGroup commonInputViewGroup2 = this.ivpNationalIdNumber;
if (commonInputViewGroup2 != null) {
if (commonInputViewGroup2 != null) {
commonInputViewGroup = commonInputViewGroup2;
} else {
C14957gcv.a("");
}
commonInputViewGroup.mEditText.setCustomSelectionActionModeCallback(new fKJ());
commonInputViewGroup.mEditText.setLongClickable(false);
commonInputViewGroup.mEditText.setTextIsSelectable(false);
commonInputViewGroup.mEditText.setInputType(2);
commonInputViewGroup.mEditText.setKeyListener(DigitsKeyListener.getInstance("0123456789 "));
fLJ flj = new fLJ(commonInputViewGroup.mEditText, "X XXXX XXXXX XX X", new fLJ.Sts(this) { // from class: o.fru
private TouchPointInputCidFragment a;
@Override // o.fLJ.Sts
public final String c(String str) {
return TouchPointInputCidFragment.a(this.a, str);
}
{
this.a = this;
}
});
flj.b = new IeS(this, commonInputViewGroup);
flj.e = true;
fLJ flj2 = flj;
commonInputViewGroup.mEditText.addTextChangedListener(flj2);
commonInputViewGroup.d.add(flj2);
commonInputViewGroup.setOnEditorActionListener(new TextView.OnEditorActionListener(this) { // from class: o.frB
private TouchPointInputCidFragment c;
@Override // android.widget.TextView.OnEditorActionListener
public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
return TouchPointInputCidFragment.b(this.c, i);
}
{
this.c = this;
}
});
commonInputViewGroup.requestFocus();
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroyView() {
super.onDestroyView();
C6956cfG c6956cfG = this.presenter;
if (c6956cfG == null) {
C14957gcv.a("");
c6956cfG = null;
}
c6956cfG.w_();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroy() {
C6956cfG c6956cfG = this.presenter;
if (c6956cfG == null) {
C14957gcv.a("");
c6956cfG = null;
}
c6956cfG.w_();
super.onDestroy();
}
/* loaded from: classes5.dex */
public static final class IeS implements fLJ.IeS {
private CommonInputViewGroup a;
private TouchPointInputCidFragment e;
IeS(TouchPointInputCidFragment touchPointInputCidFragment, CommonInputViewGroup commonInputViewGroup) {
this.e = touchPointInputCidFragment;
this.a = commonInputViewGroup;
}
@Override // o.fLJ.IeS
public final void b(String str) {
C14957gcv.e(str, "");
C6956cfG c6956cfG = this.e.presenter;
if (c6956cfG == null) {
C14957gcv.a("");
c6956cfG = null;
}
c6956cfG.d(str, false);
}
@Override // o.fLJ.IeS
public final void e(String str) {
C14957gcv.e(str, "");
if (TextUtils.isEmpty(str)) {
CommonInputViewGroup commonInputViewGroup = this.a;
commonInputViewGroup.e = false;
commonInputViewGroup.mEditClearImageButton.setVisibility(8);
} else {
CommonInputViewGroup commonInputViewGroup2 = this.a;
commonInputViewGroup2.e = true;
commonInputViewGroup2.mEditClearImageButton.setVisibility(0);
}
C6956cfG c6956cfG = this.e.presenter;
if (c6956cfG == null) {
C14957gcv.a("");
c6956cfG = null;
}
c6956cfG.d(str, true);
}
}
@Override // o.InterfaceC9460dkE.RVV
public final void b(boolean z) {
CommonInputViewGroup commonInputViewGroup = null;
if (z) {
CommonInputViewGroup commonInputViewGroup2 = this.ivpNationalIdNumber;
if (commonInputViewGroup2 != null) {
commonInputViewGroup = commonInputViewGroup2;
} else {
C14957gcv.a("");
}
commonInputViewGroup.c();
return;
}
CommonInputViewGroup commonInputViewGroup3 = this.ivpNationalIdNumber;
if (commonInputViewGroup3 != null) {
commonInputViewGroup = commonInputViewGroup3;
} else {
C14957gcv.a("");
}
commonInputViewGroup.e();
}
@Override // o.InterfaceC9460dkE.RVV
public final void c() {
CommonInputViewGroup commonInputViewGroup = this.ivpNationalIdNumber;
if (commonInputViewGroup == null) {
C14957gcv.a("");
commonInputViewGroup = null;
}
commonInputViewGroup.mEditText.setText("");
}
@Override // o.InterfaceC9460dkE.RVV
public final void a(C0997Th c0997Th, boolean z) {
C14957gcv.e(c0997Th, "");
if (z) {
c0997Th.b = new fJB();
}
FragmentActivity activity = getActivity();
if (activity != null) {
activity.startActivity(ReviewInfoResultActivity.ajz_(activity, c0997Th));
}
}
@Override // o.InterfaceC9460dkE.RVV
public final void b(C0996Tg c0996Tg) {
C14957gcv.e(c0996Tg, "");
TouchPointPinActivity.LWm lWm = TouchPointPinActivity.k;
Context requireContext = requireContext();
C14957gcv.c(requireContext, "");
C14957gcv.e(requireContext, "");
C14957gcv.e(c0996Tg, "");
Intent putExtra = new Intent(requireContext, (Class<?>) TouchPointPinActivity.class).putExtra("EXTRA_INFO_DISPLAY", c0996Tg);
C14957gcv.c(putExtra, "");
startActivity(putExtra);
}
public static /* synthetic */ void e(TouchPointInputCidFragment touchPointInputCidFragment) {
C14957gcv.e(touchPointInputCidFragment, "");
C6956cfG c6956cfG = touchPointInputCidFragment.presenter;
String str = null;
if (c6956cfG == null) {
C14957gcv.a("");
c6956cfG = null;
}
String str2 = c6956cfG.e;
if (str2 != null) {
if (c6956cfG.f != 0) {
c6956cfG.f.y();
}
C16014kV c16014kV = c6956cfG.a;
C6956cfG.IeS ieS = new C6956cfG.IeS(c6956cfG, str2);
C6956cfG.HBt hBt = new C6956cfG.HBt(c6956cfG);
String str3 = c6956cfG.d;
if (str3 == null) {
C14957gcv.a("");
} else {
str = str3;
}
C14218fp c14218fp = new C14218fp(str2, str);
C14957gcv.e(ieS, "");
C14957gcv.e(hBt, "");
C14957gcv.e(c14218fp, "");
c16014kV.b.e(ieS, hBt, new MEY.HBt(c14218fp), c16014kV.a);
}
}
public static /* synthetic */ boolean b(TouchPointInputCidFragment touchPointInputCidFragment, int i) {
C14957gcv.e(touchPointInputCidFragment, "");
if (i != 6) {
return false;
}
touchPointInputCidFragment.aN_();
ViewGroup viewGroup = touchPointInputCidFragment.root;
ViewGroup viewGroup2 = null;
if (viewGroup == null) {
C14957gcv.a("");
viewGroup = null;
}
viewGroup.setFocusable(true);
ViewGroup viewGroup3 = touchPointInputCidFragment.root;
if (viewGroup3 == null) {
C14957gcv.a("");
viewGroup3 = null;
}
viewGroup3.setFocusableInTouchMode(true);
ViewGroup viewGroup4 = touchPointInputCidFragment.root;
if (viewGroup4 != null) {
viewGroup2 = viewGroup4;
} else {
C14957gcv.a("");
}
viewGroup2.requestFocus();
return true;
}
public static /* synthetic */ String a(TouchPointInputCidFragment touchPointInputCidFragment, String str) {
C14957gcv.e(touchPointInputCidFragment, "");
C6956cfG c6956cfG = touchPointInputCidFragment.presenter;
if (c6956cfG == null) {
C14957gcv.a("");
c6956cfG = null;
}
C14957gcv.c((Object) str, "");
C14957gcv.e(str, "");
Ezz ezz = c6956cfG.b;
String b = C15602gz.b(str, "[^0-9]", "X XXXX XXXXX XX X");
C14957gcv.c((Object) b, "");
return b;
}
@Override // o.InterfaceC9460dkE.RVV
public final void e(boolean z) {
Button button = this.buttonNext;
if (button != null) {
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(z);
}
}
}