346 lines
11 KiB
Java
346 lines
11 KiB
Java
|
package com.scb.phone.view.fragment.easycash;
|
||
|
|
||
|
import android.content.Intent;
|
||
|
import android.text.TextUtils;
|
||
|
import android.view.View;
|
||
|
import android.widget.LinearLayout;
|
||
|
import android.widget.TextView;
|
||
|
import butterknife.BindView;
|
||
|
import com.google.android.material.textfield.TextInputLayout;
|
||
|
import com.scb.phone.R;
|
||
|
import com.scb.phone.view.activity.BaseActivity;
|
||
|
import com.scb.phone.view.activity.easycash.EasycashCreditPowerInputActivity;
|
||
|
import com.scb.phone.view.activity.easycash.EasycashLandingActivity;
|
||
|
import com.scb.phone.view.activity.easycash.NTBEasycashLandingActivity;
|
||
|
import com.scb.phone.view.activity.prelogin.PinLoginActivity;
|
||
|
import com.scb.phone.view.activity.privacypolicy.ScbPrivacyPolicyActivity;
|
||
|
import com.scb.phone.view.custom.common.AmountEditText;
|
||
|
import com.scb.phone.view.custom.common.DefaultButton;
|
||
|
import com.scb.phone.view.custom.common.InputText;
|
||
|
import com.scb.phone.view.custom.easycash.CustomEmail;
|
||
|
import com.scb.phone.view.custom.easycash.CustomPhone;
|
||
|
import com.scb.phone.view.fragment.BaseFragment;
|
||
|
import com.scb.phone.view.fragment.easycash.BaseEasycashReferralSendFragment;
|
||
|
import com.scb.phone.view.fragment.easycash.EasycashSuccessDialogFragment;
|
||
|
import java.util.concurrent.TimeUnit;
|
||
|
import java.util.regex.Pattern;
|
||
|
import o.AbstractC13163fSk;
|
||
|
import o.C0596Kg;
|
||
|
import o.C10965eUa;
|
||
|
import o.C13417fZt;
|
||
|
import o.C3172asW;
|
||
|
import o.C6583cXR;
|
||
|
import o.InterfaceC10373eCZ;
|
||
|
import o.InterfaceC13391fZD;
|
||
|
import o.InterfaceC6621cYR;
|
||
|
import o.LT;
|
||
|
import o.LW;
|
||
|
import o.Lld;
|
||
|
import o.YHs;
|
||
|
import o.ZI;
|
||
|
import o.aPY;
|
||
|
import o.fLM;
|
||
|
import o.fRR;
|
||
|
import o.fSJ;
|
||
|
import o.fSQ;
|
||
|
import o.lUI;
|
||
|
import o.nMh;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public abstract class BaseEasycashReferralSendFragment extends BaseFragment implements InterfaceC6621cYR.jNh, EasycashSuccessDialogFragment.HBt {
|
||
|
|
||
|
@BindView
|
||
|
protected AmountEditText amountEditText;
|
||
|
|
||
|
@BindView
|
||
|
protected DefaultButton buttonSend;
|
||
|
private aPY c;
|
||
|
private fSJ d;
|
||
|
|
||
|
@BindView
|
||
|
protected CustomEmail emailEditText;
|
||
|
|
||
|
@BindView
|
||
|
protected TextInputLayout errorAmount;
|
||
|
|
||
|
@BindView
|
||
|
protected TextView headerInfo;
|
||
|
|
||
|
@BindView
|
||
|
protected InputText loansDetails;
|
||
|
|
||
|
@BindView
|
||
|
protected TextView name;
|
||
|
|
||
|
@BindView
|
||
|
protected CustomPhone phoneEditText;
|
||
|
|
||
|
@BindView
|
||
|
protected TextView remainingLimit;
|
||
|
|
||
|
@BindView
|
||
|
protected TextView remainingLimitError;
|
||
|
|
||
|
@BindView
|
||
|
protected LinearLayout remainingLimitLinearLayout;
|
||
|
|
||
|
@BindView
|
||
|
protected TextView textRemainingLimit;
|
||
|
|
||
|
@BindView
|
||
|
protected TextView titleName;
|
||
|
|
||
|
@InterfaceC13391fZD
|
||
|
public Lld tracker;
|
||
|
|
||
|
@BindView
|
||
|
protected TextView tvPrivacyNotice;
|
||
|
|
||
|
@BindView
|
||
|
protected View vPrivacyNotice;
|
||
|
|
||
|
public abstract void n();
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||
|
public void onDestroy() {
|
||
|
super.onDestroy();
|
||
|
this.c.w_();
|
||
|
fSJ fsj = this.d;
|
||
|
if (fsj == null || fsj.isDisposed()) {
|
||
|
return;
|
||
|
}
|
||
|
this.d.dispose();
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void i() {
|
||
|
this.vPrivacyNotice.setVisibility(8);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void aV_() {
|
||
|
this.buttonSend.setButtonEnabled(false);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void d() {
|
||
|
this.amountEditText.setHandleDismissKeyboard(new AmountEditText.LWm(this) { // from class: o.eSK
|
||
|
private BaseEasycashReferralSendFragment e;
|
||
|
|
||
|
@Override // com.scb.phone.view.custom.common.AmountEditText.LWm
|
||
|
public final void d() {
|
||
|
this.e.aN_();
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.e = this;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void o() {
|
||
|
this.buttonSend.setButtonEnabled(!r0.isEnabled());
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public void a() {
|
||
|
this.loansDetails.setOnInputChangeListener(new InputText.RVV(this) { // from class: o.eSH
|
||
|
private BaseEasycashReferralSendFragment e;
|
||
|
|
||
|
@Override // com.scb.phone.view.custom.common.InputText.RVV
|
||
|
public final void b(String str) {
|
||
|
this.e.c.d(str);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.e = this;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void g() {
|
||
|
this.loansDetails.b(getResources().getString(R.string.favorite_invalid_character));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void h() {
|
||
|
InputText inputText = this.loansDetails;
|
||
|
inputText.errorText.setVisibility(8);
|
||
|
inputText.inputEditText.setBackground(nMh.getDrawable(inputText.getContext(), R.drawable.shape_gray_rounded_rectangle));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void b() {
|
||
|
startActivityForResult(new Intent(getContext(), (Class<?>) PinLoginActivity.class), 7134);
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.easycash.EasycashSuccessDialogFragment.HBt
|
||
|
public final void aW_() {
|
||
|
startActivity(EasycashCreditPowerInputActivity.aep_(getContext()));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void c() {
|
||
|
EasycashLandingActivity.c(getContext());
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void e() {
|
||
|
NTBEasycashLandingActivity.a(getContext());
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ boolean e(BaseEasycashReferralSendFragment baseEasycashReferralSendFragment, String str) {
|
||
|
boolean z;
|
||
|
aPY apy = baseEasycashReferralSendFragment.c;
|
||
|
apy.b = str;
|
||
|
if (!TextUtils.isEmpty(str)) {
|
||
|
lUI lui = apy.h;
|
||
|
if (str != null && Pattern.compile("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$").matcher(str).matches()) {
|
||
|
z = true;
|
||
|
apy.c = z;
|
||
|
return z;
|
||
|
}
|
||
|
}
|
||
|
z = false;
|
||
|
apy.c = z;
|
||
|
return z;
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ boolean d(BaseEasycashReferralSendFragment baseEasycashReferralSendFragment, String str) {
|
||
|
aPY apy = baseEasycashReferralSendFragment.c;
|
||
|
return C6583cXR.e(str);
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ boolean a(BaseEasycashReferralSendFragment baseEasycashReferralSendFragment, String str) {
|
||
|
baseEasycashReferralSendFragment.startActivity(ScbPrivacyPolicyActivity.akT_(baseEasycashReferralSendFragment.requireContext(), str));
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public void d(LW lw) {
|
||
|
this.name.setText(lw.c);
|
||
|
this.phoneEditText.setNecessaryInfo(lw.j, getString(R.string.easycash_invalid_format), new InterfaceC10373eCZ(this) { // from class: o.eSJ
|
||
|
private BaseEasycashReferralSendFragment c;
|
||
|
|
||
|
@Override // o.InterfaceC10373eCZ
|
||
|
public final boolean e(String str) {
|
||
|
return BaseEasycashReferralSendFragment.d(this.c, str);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.c = this;
|
||
|
}
|
||
|
});
|
||
|
this.emailEditText.setNecessaryInfo(lw.a, getString(R.string.easycash_invalid_format), new InterfaceC10373eCZ(this) { // from class: o.eSL
|
||
|
private BaseEasycashReferralSendFragment e;
|
||
|
|
||
|
@Override // o.InterfaceC10373eCZ
|
||
|
public final boolean e(String str) {
|
||
|
return BaseEasycashReferralSendFragment.e(this.e, str);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.e = this;
|
||
|
}
|
||
|
});
|
||
|
this.d = AbstractC13163fSk.interval(1L, TimeUnit.SECONDS).observeOn(fRR.e()).subscribeOn(C13417fZt.c()).subscribe(new fSQ(this) { // from class: o.eSP
|
||
|
private BaseEasycashReferralSendFragment e;
|
||
|
|
||
|
@Override // o.fSQ
|
||
|
public final void c(Object obj) {
|
||
|
this.e.n();
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.e = this;
|
||
|
}
|
||
|
}, new fSQ() { // from class: o.eSO
|
||
|
@Override // o.fSQ
|
||
|
public final void c(Object obj) {
|
||
|
guQ.a((Throwable) obj);
|
||
|
}
|
||
|
});
|
||
|
AmountEditText amountEditText = this.amountEditText;
|
||
|
amountEditText.setCurrencyFormattingTextWatcher(new fLM(amountEditText, this.errorAmount, 9.9999999999E8d, lw.d.doubleValue(), getResources().getString(R.string.easycash_invalid_amount), null, getResources().getString(R.string.easycash_invalid_amount_transfer_input)));
|
||
|
this.amountEditText.setOnPasteListener(new AmountEditText.HBt());
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.easycash.EasycashSuccessDialogFragment.HBt
|
||
|
public final void j() {
|
||
|
aPY apy = this.c;
|
||
|
if (apy.d.b.b() != null) {
|
||
|
ZI.IeS ieS = new ZI.IeS() { // from class: o.aPV
|
||
|
@Override // o.ZI.IeS
|
||
|
public final void e(Object obj) {
|
||
|
((InterfaceC6621cYR.jNh) obj).e();
|
||
|
}
|
||
|
};
|
||
|
if (apy.f != 0) {
|
||
|
ieS.e(apy.f);
|
||
|
return;
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.aQc
|
||
|
@Override // o.ZI.IeS
|
||
|
public final void e(Object obj) {
|
||
|
((InterfaceC6621cYR.jNh) obj).c();
|
||
|
}
|
||
|
};
|
||
|
if (apy.f != 0) {
|
||
|
ieS2.e(apy.f);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void c(LT lt) {
|
||
|
this.tvPrivacyNotice.setText(C3172asW.qI_(lt.c, 0));
|
||
|
this.tvPrivacyNotice.setMovementMethod(new C10965eUa(new C10965eUa.RVV(this) { // from class: o.eSI
|
||
|
private BaseEasycashReferralSendFragment a;
|
||
|
|
||
|
@Override // o.C10965eUa.RVV
|
||
|
public final boolean b(String str) {
|
||
|
return BaseEasycashReferralSendFragment.a(this.a, str);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.a = this;
|
||
|
}
|
||
|
}));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6621cYR.jNh
|
||
|
public final void f() {
|
||
|
String str;
|
||
|
Lld lld = this.tracker;
|
||
|
if (getActivity() != null) {
|
||
|
lld.c(((BaseActivity) getActivity()).scbAnalytics, "apply_loan_referral_confirmation");
|
||
|
}
|
||
|
C0596Kg.Sts sts = new C0596Kg.Sts();
|
||
|
sts.a = getString(R.string.easycash_success_done);
|
||
|
aPY apy = this.c;
|
||
|
if (apy.d.b.b() == null) {
|
||
|
YHs yHs = apy.a;
|
||
|
if (yHs.d.a() != null && yHs.d.a().r != null && yHs.d.a().r.j) {
|
||
|
str = getString(R.string.easycash_success_dialog_second_button);
|
||
|
sts.b = str;
|
||
|
sts.f = getString(R.string.easycash_success_title);
|
||
|
sts.d = getString(R.string.easycash_success_subtitle);
|
||
|
EasycashSuccessDialogFragment.a(new C0596Kg(sts, (byte) 0)).show(getChildFragmentManager().a(), "referral_dialog");
|
||
|
}
|
||
|
}
|
||
|
str = null;
|
||
|
sts.b = str;
|
||
|
sts.f = getString(R.string.easycash_success_title);
|
||
|
sts.d = getString(R.string.easycash_success_subtitle);
|
||
|
EasycashSuccessDialogFragment.a(new C0596Kg(sts, (byte) 0)).show(getChildFragmentManager().a(), "referral_dialog");
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public final void b(aPY apy) {
|
||
|
this.c = apy;
|
||
|
}
|
||
|
}
|