what-the-bank/sources/com/scb/phone/view/fragment/registration/onboarding/RegistrationEmailSetupFragm...

229 lines
8.6 KiB
Java

package com.scb.phone.view.fragment.registration.onboarding;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
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.CustomInputDialog;
import com.scb.phone.view.fragment.registration.onboarding.RegistrationEmailSetupFragment;
import o.C16565pPd;
import o.C5836cAs;
import o.C5838cAu;
import o.C6583cXR;
import o.C8132dC;
import o.InterfaceC13391fZD;
import o.InterfaceC9602dmo;
import o.SRc;
import o.ZI;
import o.eBM;
import o.fJA;
/* loaded from: classes5.dex */
public class RegistrationEmailSetupFragment extends Hilt_RegistrationEmailSetupFragment implements InterfaceC9602dmo {
private fJA c;
private CustomInputDialog d;
private C16565pPd j = new C16565pPd();
@InterfaceC13391fZD
public C5836cAs registrationEmailSetupPresenter;
public static RegistrationEmailSetupFragment i() {
return new RegistrationEmailSetupFragment();
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.registration.onboarding.Hilt_RegistrationEmailSetupFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof fJA) {
this.c = (fJA) context;
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559860, viewGroup, false);
ButterKnife.c(this, inflate);
this.registrationEmailSetupPresenter.e((C5836cAs) this);
C16565pPd c16565pPd = this.j;
if (getActivity() != null) {
c16565pPd.c(((BaseActivity) getActivity()).scbAnalytics, "registration_set_email");
}
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.registrationEmailSetupPresenter.w_();
super.onDestroy();
}
@Override // o.InterfaceC9602dmo
public final void c(int i) {
String string;
if (i == 1) {
string = getString(R.string.onboarding_registration_email_mailinator_error);
} else if (i == 2) {
string = getString(R.string.onboarding_registration_email_net_error);
} else {
string = getString(R.string.onboarding_registration_email_error);
}
i(string);
}
@Override // o.InterfaceC9602dmo
public final void d() {
CustomInputDialog b = CustomInputDialog.b(getContext());
this.d = b;
b.mEditTextView.setFilters(new InputFilter[]{new InputFilter.LengthFilter(100)});
this.d.mEditTextView.addTextChangedListener(new TextWatcher(this) { // from class: com.scb.phone.view.fragment.registration.onboarding.RegistrationEmailSetupFragment.4
private RegistrationEmailSetupFragment a;
@Override // android.text.TextWatcher
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
{
this.a = this;
}
@Override // android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
this.a.d.mErrorTextView.setVisibility(8);
}
});
this.d.c();
CustomInputDialog customInputDialog = this.d;
String string = getString(R.string.onboarding_registration_email_dialog_title);
if (string != null) {
customInputDialog.mTitleTextView.setVisibility(0);
customInputDialog.mTitleTextView.setText(string);
}
CustomInputDialog customInputDialog2 = this.d;
String string2 = getString(R.string.onboarding_registration_email_dialog_sub_title);
if (string2 != null) {
customInputDialog2.mTextTextView.setVisibility(0);
customInputDialog2.mTextTextView.setText(string2);
}
this.d.setCanceledOnTouchOutside(false);
this.d.mEditTextView.setHint(getString(R.string.onboarding_registration_email_dialog_hint));
this.d.mEditTextView.setVisibility(0);
this.d.apc_(R.string.onboarding_registration_button_cancel, new DialogInterface.OnClickListener() { // from class: o.fwL
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
CustomInputDialog customInputDialog3 = this.d;
String string3 = getString(R.string.ok);
DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener(this) { // from class: o.fwJ
private RegistrationEmailSetupFragment e;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
RegistrationEmailSetupFragment.b(this.e);
}
{
this.e = this;
}
};
if (string3 != null) {
customInputDialog3.mPositiveButton.setText(string3);
customInputDialog3.mPositiveButton.setOnClickListener(new eBM(customInputDialog3, onClickListener, true));
}
customInputDialog3.show();
}
@Override // o.InterfaceC9602dmo
public final void b() {
fJA fja = this.c;
if (fja != null) {
fja.e("RegistrationEmailSetupFragment");
}
}
public static /* synthetic */ void b(RegistrationEmailSetupFragment registrationEmailSetupFragment) {
C16565pPd c16565pPd = registrationEmailSetupFragment.j;
if (registrationEmailSetupFragment.getActivity() != null) {
c16565pPd.c(((BaseActivity) registrationEmailSetupFragment.getActivity()).scbAnalytics, "registration_emailsetup");
}
C5836cAs c5836cAs = registrationEmailSetupFragment.registrationEmailSetupPresenter;
String valueOf = String.valueOf(registrationEmailSetupFragment.d.mEditTextView.getText());
if (TextUtils.isEmpty(valueOf) || !C6583cXR.b("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$", valueOf)) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.cAq
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9602dmo) obj).c(0);
}
};
if (c5836cAs.f != 0) {
ieS.e(c5836cAs.f);
return;
}
return;
}
if (valueOf.contains("mailinator.com")) {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.cAw
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9602dmo) obj).c(1);
}
};
if (c5836cAs.f != 0) {
ieS2.e(c5836cAs.f);
return;
}
return;
}
if (c5836cAs.f != 0) {
c5836cAs.f.y();
}
SRc sRc = c5836cAs.a;
C8132dC b = C8132dC.b();
b.b = valueOf;
sRc.d(b);
SRc sRc2 = c5836cAs.a;
sRc2.d(sRc2.i, new C5836cAs.AnonymousClass3(c5836cAs));
}
/* JADX INFO: Access modifiers changed from: package-private */
@OnClick
public void onNotNow() {
C5836cAs c5836cAs = this.registrationEmailSetupPresenter;
C5838cAu c5838cAu = new C5838cAu();
if (c5836cAs.f != 0) {
c5838cAu.e(c5836cAs.f);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
@OnClick
public void onSetupEmail() {
C5836cAs c5836cAs = this.registrationEmailSetupPresenter;
ZI.IeS ieS = new ZI.IeS() { // from class: o.cAt
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9602dmo) obj).d();
}
};
if (c5836cAs.f != 0) {
ieS.e(c5836cAs.f);
}
}
}