what-the-bank/sources/com/scb/phone/view/fragment/transferandpay/transfer/TransferToPromptPayStep1Fra...

311 lines
11 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.transferandpay.transfer;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.FragmentActivity;
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.custom.common.CustomDialog;
import com.scb.phone.view.custom.common.CustomProxyNumber;
import com.scb.phone.view.custom.common.DefaultButton;
import com.scb.phone.view.custom.common.ScbEditText;
import o.C0531Iw;
import o.C10457eEr;
import o.C1238Ys;
import o.C1245Yu;
import o.C12784fHK;
import o.C15602gz;
import o.C6579cXC;
import o.C6583cXR;
import o.EL;
import o.EnumC8951daY;
import o.InterfaceC12866fJj;
import o.InterfaceC13391fZD;
import o.InterfaceC15577gud;
import o.InterfaceC9010dbe;
import o.PWw;
import o.YF;
import o.ZI;
/* loaded from: classes5.dex */
public class TransferToPromptPayStep1Fragment extends Hilt_TransferToPromptPayStep1Fragment implements InterfaceC9010dbe.AgY, InterfaceC12866fJj {
@BindView
public DefaultButton mContinueButton;
@BindView
public CustomProxyNumber mCustomProxyNumber;
@InterfaceC13391fZD
public C6579cXC presenter;
public static TransferToPromptPayStep1Fragment j() {
return new TransferToPromptPayStep1Fragment();
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559972, viewGroup, false);
ButterKnife.c(this, inflate);
this.presenter.e((C6579cXC) this);
final C6579cXC c6579cXC = this.presenter;
if (c6579cXC.d != null) {
if (PWw.MOB.name().equals(c6579cXC.d.x)) {
ZI.IeS ieS = new ZI.IeS(c6579cXC) { // from class: o.cXB
private C6579cXC d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C6579cXC.c(this.d, (InterfaceC9010dbe.AgY) obj);
}
{
this.d = c6579cXC;
}
};
if (c6579cXC.f != 0) {
ieS.e(c6579cXC.f);
}
} else if (PWw.CID.name().equals(c6579cXC.d.x)) {
ZI.IeS ieS2 = new ZI.IeS(c6579cXC) { // from class: o.cXK
private C6579cXC a;
@Override // o.ZI.IeS
public final void e(Object obj) {
C6579cXC.e(this.a, (InterfaceC9010dbe.AgY) obj);
}
{
this.a = c6579cXC;
}
};
if (c6579cXC.f != 0) {
ieS2.e(c6579cXC.f);
}
}
}
DefaultButton defaultButton = this.mContinueButton;
if (defaultButton != null) {
defaultButton.setVisibility(0);
}
this.mCustomProxyNumber.setProxyLabel(getString(R.string.transfer_prompt_pay_input_text));
this.mCustomProxyNumber.setProxyHint(getString(R.string.transfer_prompt_pay_input_hint));
this.mCustomProxyNumber.setOnProxyNumberListener(this);
this.mCustomProxyNumber.setOnPasteListener(new ScbEditText.HBt());
setUserVisibleHint(false);
C12784fHK.a(this);
return inflate;
}
@Override // androidx.fragment.app.Fragment
public void setUserVisibleHint(boolean z) {
super.setUserVisibleHint(z);
if (getActivity() != null) {
if (z) {
C12784fHK.a(this);
} else {
aN_();
}
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.presenter.w_();
super.onDestroy();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
this.mCustomProxyNumber.apo_(i, i2, intent);
}
private void a(C0531Iw c0531Iw, PWw pWw, boolean z) {
Intent intent;
EL el = this.presenter.c;
YF yf = (YF) EL.b(c0531Iw, pWw);
c(yf.d);
String a = this.mCustomProxyNumber.a();
if (C15602gz.a(a) || C15602gz.b(a) || z) {
if (z) {
intent = new Intent("com.scb.phone/BROADCAST_TRANSFER_NEXT_FAVOURITE_STEP");
} else {
intent = new Intent("com.scb.phone/BROADCAST_TRANSFER_NEXT_STEP");
}
intent.putExtra("com.scb.phone.EXTRA_TRANSFER_TARGET_DATA", yf);
C10457eEr.aqd_(this, intent);
}
}
@OnClick
public void onContactsButtonClick() {
Intent intent = new Intent("android.intent.action.PICK", Uri.parse("content://contacts"));
intent.setType("vnd.android.cursor.dir/phone_v2");
startActivityForResult(intent, 347);
}
@OnClick
public void onNextButtonClick() {
String a = this.mCustomProxyNumber.a();
c(a);
if (C15602gz.a(a) || C15602gz.b(a)) {
b(a);
}
}
@Override // o.InterfaceC9010dbe.AgY
public final void b(C0531Iw c0531Iw) {
if (c0531Iw instanceof C1245Yu) {
a(c0531Iw, PWw.MOB, true);
} else if (c0531Iw instanceof C1238Ys) {
a(c0531Iw, PWw.CID, true);
}
}
private void c(String str) {
if (((Boolean) C15602gz.b(new Object[]{str}, -396693817, 396693819, (int) System.currentTimeMillis())).booleanValue()) {
if (C15602gz.a(str)) {
DefaultButton defaultButton = this.mContinueButton;
if (defaultButton != null) {
defaultButton.setButtonEnabled(true);
}
this.mCustomProxyNumber.setErrorValidationVisibility(8);
return;
}
this.mCustomProxyNumber.setErrorInLine(R.string.error_prompt_pay_mobile_validation);
this.mCustomProxyNumber.setErrorValidationVisibility(0);
return;
}
if (C15602gz.b(str)) {
if (C15602gz.b(str)) {
this.mCustomProxyNumber.setErrorValidationVisibility(8);
DefaultButton defaultButton2 = this.mContinueButton;
if (defaultButton2 != null) {
defaultButton2.setButtonEnabled(true);
return;
}
return;
}
return;
}
this.mCustomProxyNumber.setErrorInLine(R.string.error_prompt_pay_validation);
this.mCustomProxyNumber.setErrorValidationVisibility(0);
}
protected void b(String str) {
if (C15602gz.a(str)) {
String str2 = (String) C6583cXR.c(new Object[]{false, true, str}, -1092823629, 1092823630, (int) System.currentTimeMillis());
C1245Yu c1245Yu = new C1245Yu();
c1245Yu.d = "";
c1245Yu.b = str2;
a(c1245Yu, PWw.MOB, false);
return;
}
if (C15602gz.b(str)) {
String str3 = (String) C6583cXR.c(new Object[]{false, false, str}, -1092823629, 1092823630, (int) System.currentTimeMillis());
C1238Ys c1238Ys = new C1238Ys();
c1238Ys.b = str3;
a(c1238Ys, PWw.CID, false);
}
}
public void t_(String str) {
c(str);
}
@Override // o.InterfaceC12866fJj
public final void bp_() {
aN_();
}
@Override // o.InterfaceC12866fJj
public final void f() {
aN_();
}
public void a(C0531Iw c0531Iw) {
a(c0531Iw, c0531Iw instanceof C1238Ys ? PWw.CID : PWw.MOB, false);
}
public void d(String str) {
DefaultButton defaultButton;
if (!C15602gz.e(str) || (defaultButton = this.mContinueButton) == null) {
return;
}
defaultButton.setButtonEnabled(true);
}
public void g() {
CustomProxyNumber customProxyNumber = this.mCustomProxyNumber;
CustomProxyNumber.b(new Object[]{customProxyNumber}, -59289781, 59289781, System.identityHashCode(customProxyNumber));
}
public void b(final InterfaceC15577gud interfaceC15577gud) {
if (getUserVisibleHint()) {
((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(getContext()).c(R.string.permission_read_contacts_title).d(R.string.permission_read_contacts).aoT_(R.string.permission_allow, new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.fHD
private InterfaceC15577gud e;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.e.c();
}
{
this.e = interfaceC15577gud;
}
}), Integer.valueOf(R.string.permission_deny), new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.fHB
private InterfaceC15577gud b;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.b.e();
}
{
this.b = interfaceC15577gud;
}
}})).show();
}
}
public void i() {
if (getUserVisibleHint()) {
EnumC8951daY enumC8951daY = EnumC8951daY.ERROR;
FragmentActivity activity = getActivity();
if (activity != null) {
String string = getString(R.string.permission_read_contacts_denied);
if (getActivity() != null) {
BaseActivity.a(new Object[]{(BaseActivity) getActivity(), activity, Integer.valueOf(R.id.view_group_root), string, enumC8951daY}, 855668825, -855668822, R.id.view_group_root);
}
}
}
}
public void h() {
if (getUserVisibleHint()) {
EnumC8951daY enumC8951daY = EnumC8951daY.ERROR;
FragmentActivity activity = getActivity();
if (activity != null) {
String string = getString(R.string.permission_read_contacts_never_ask_again);
if (getActivity() != null) {
BaseActivity.a(new Object[]{(BaseActivity) getActivity(), activity, Integer.valueOf(R.id.view_group_root), string, enumC8951daY}, 855668825, -855668822, R.id.view_group_root);
}
}
}
}
@Override // androidx.fragment.app.Fragment
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
C12784fHK.e(this, i, iArr);
}
}