what-the-bank/sources/com/scb/phone/view/fragment/sme/gifting/GiftRecipientFragment.java

279 lines
9.4 KiB
Java

package com.scb.phone.view.fragment.sme.gifting;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.scb.phone.R;
import com.scb.phone.view.custom.common.DefaultButton;
import o.C0531Iw;
import o.C15602gz;
import o.C6159cKj;
import o.InterfaceC13391fZD;
import o.InterfaceC6673cZp;
import o.WG;
import o.ZI;
/* loaded from: classes5.dex */
public class GiftRecipientFragment extends Hilt_GiftRecipientFragment implements InterfaceC6673cZp.ojQ {
@InterfaceC13391fZD
public C6159cKj giftingSelectRecipientFromPromptPayPresenter;
public static GiftRecipientFragment c(String str) {
GiftRecipientFragment giftRecipientFragment = new GiftRecipientFragment();
Bundle bundle = new Bundle();
bundle.putString("RECIPIENT_TYPE", str);
giftRecipientFragment.setArguments(bundle);
return giftRecipientFragment;
}
@Override // com.scb.phone.view.fragment.transferandpay.transfer.TransferToPromptPayStep1Fragment, androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View onCreateView = super.onCreateView(layoutInflater, viewGroup, bundle);
this.giftingSelectRecipientFromPromptPayPresenter.e((C6159cKj) this);
if (getArguments() != null) {
C6159cKj c6159cKj = this.giftingSelectRecipientFromPromptPayPresenter;
c6159cKj.e = getArguments().getString("RECIPIENT_TYPE");
if ("money".equalsIgnoreCase(c6159cKj.e)) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.cKr
@Override // o.ZI.IeS
public final void e(Object obj) {
C6159cKj.h((InterfaceC6673cZp.ojQ) obj);
}
};
if (c6159cKj.f != 0) {
ieS.e(c6159cKj.f);
}
} else {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.cKp
@Override // o.ZI.IeS
public final void e(Object obj) {
C6159cKj.f((InterfaceC6673cZp.ojQ) obj);
}
};
if (c6159cKj.f != 0) {
ieS2.e(c6159cKj.f);
}
}
}
if (this.mContinueButton != null) {
this.mContinueButton.setText(getString(R.string.confirm));
}
return onCreateView;
}
@Override // o.InterfaceC6673cZp.ojQ
public final void b(int i) {
int i2;
if (i == 0) {
i2 = R.string.select_recipient_gift_promptpay;
} else {
if (i != 1) {
throw new IllegalArgumentException("Illegal promptpay hint");
}
i2 = R.string.gift_send_recipient_hint;
}
this.mCustomProxyNumber.setProxyHint(getString(i2));
}
@Override // o.InterfaceC6673cZp.ojQ
public final void e(int i) {
this.mCustomProxyNumber.setMaxLength(i);
}
@Override // o.InterfaceC6673cZp.ojQ
public final void b() {
this.mCustomProxyNumber.setProxyLabel(getString(R.string.gift_send_recipient_gift_to));
}
@Override // o.InterfaceC6673cZp.ojQ
public final void d() {
this.mCustomProxyNumber.setErrorValidationVisibility(8);
}
@Override // o.InterfaceC6673cZp.ojQ
public final void a(int i) {
int i2;
if (i == 0) {
i2 = R.string.incomplete_information;
} else if (i == 1) {
i2 = R.string.error_prompt_pay_validation;
} else {
if (i != 2) {
throw new IllegalArgumentException("Illegal promptpay error");
}
i2 = R.string.error_prompt_pay_mobile_validation;
}
this.mCustomProxyNumber.setErrorInLine(i2);
this.mCustomProxyNumber.setErrorValidationVisibility(0);
}
@Override // com.scb.phone.view.fragment.transferandpay.transfer.TransferToPromptPayStep1Fragment, o.InterfaceC12866fJj
public final void t_(String str) {
final int i;
C6159cKj c6159cKj = this.giftingSelectRecipientFromPromptPayPresenter;
String a = this.mCustomProxyNumber.a();
String d = this.mCustomProxyNumber.d();
if (TextUtils.isEmpty(a)) {
i = 0;
} else {
if (!C15602gz.a(a) || !C15602gz.b(a)) {
if ("money".equalsIgnoreCase(c6159cKj.e)) {
if (!C15602gz.a(a) && !C15602gz.b(a)) {
i = 1;
}
} else if (!C15602gz.a(a)) {
i = 2;
}
}
i = -1;
}
if (i >= 0) {
ZI.IeS ieS = new ZI.IeS(i) { // from class: o.cKt
private int d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C6159cKj.c(this.d, (InterfaceC6673cZp.ojQ) obj);
}
{
this.d = i;
}
};
if (c6159cKj.f != 0) {
ieS.e(c6159cKj.f);
return;
}
return;
}
c6159cKj.b(a, d);
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.cKq
@Override // o.ZI.IeS
public final void e(Object obj) {
C6159cKj.i((InterfaceC6673cZp.ojQ) obj);
}
};
if (c6159cKj.f != 0) {
ieS2.e(c6159cKj.f);
}
}
@Override // o.InterfaceC6673cZp.jbe
public final void d(WG wg) {
Intent intent = new Intent();
intent.putExtra("GIFT_RECIPIENT_INFO", wg);
getActivity().setResult(-1, intent);
getActivity().finish();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
super.onDestroyView();
this.giftingSelectRecipientFromPromptPayPresenter.w_();
}
@Override // o.InterfaceC6673cZp.ojQ
public final void e(boolean z) {
DefaultButton defaultButton = this.mContinueButton;
if (defaultButton != null) {
defaultButton.setButtonEnabled(z);
}
}
@Override // com.scb.phone.view.fragment.transferandpay.transfer.TransferToPromptPayStep1Fragment, o.InterfaceC12866fJj
public final void a(C0531Iw c0531Iw) {
this.giftingSelectRecipientFromPromptPayPresenter.d = c0531Iw;
}
@Override // com.scb.phone.view.fragment.transferandpay.transfer.TransferToPromptPayStep1Fragment
public void onNextButtonClick() {
final C6159cKj c6159cKj = this.giftingSelectRecipientFromPromptPayPresenter;
ZI.IeS ieS = new ZI.IeS(c6159cKj) { // from class: o.cKu
private C6159cKj b;
@Override // o.ZI.IeS
public final void e(Object obj) {
C6159cKj.b(this.b, (InterfaceC6673cZp.ojQ) obj);
}
{
this.b = c6159cKj;
}
};
if (c6159cKj.f != 0) {
ieS.e(c6159cKj.f);
}
}
@Override // com.scb.phone.view.fragment.transferandpay.transfer.TransferToPromptPayStep1Fragment, o.InterfaceC12866fJj
public final void d(String str) {
C6159cKj c6159cKj = this.giftingSelectRecipientFromPromptPayPresenter;
if (TextUtils.isEmpty(str)) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.cKs
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6673cZp.ojQ) obj).e(false);
}
};
if (c6159cKj.f != 0) {
ieS.e(c6159cKj.f);
return;
}
return;
}
if ("money".equalsIgnoreCase(c6159cKj.e)) {
if (!C15602gz.a(str) && !C15602gz.b(str)) {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.cKv
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6673cZp.ojQ) obj).e(false);
}
};
if (c6159cKj.f != 0) {
ieS2.e(c6159cKj.f);
return;
}
return;
}
ZI.IeS ieS3 = new ZI.IeS() { // from class: o.cKx
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6673cZp.ojQ) obj).e(true);
}
};
if (c6159cKj.f != 0) {
ieS3.e(c6159cKj.f);
}
c6159cKj.b(str, (String) null);
return;
}
if (!C15602gz.a(str)) {
ZI.IeS ieS4 = new ZI.IeS() { // from class: o.cKw
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6673cZp.ojQ) obj).e(false);
}
};
if (c6159cKj.f != 0) {
ieS4.e(c6159cKj.f);
return;
}
return;
}
ZI.IeS ieS5 = new ZI.IeS() { // from class: o.cKy
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6673cZp.ojQ) obj).e(true);
}
};
if (c6159cKj.f != 0) {
ieS5.e(c6159cKj.f);
}
c6159cKj.b(str, (String) null);
}
}