what-the-bank/sources/com/scb/phone/view/fragment/emailverification/ManageEmailVerificationFrag...

294 lines
10 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.emailverification;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.presentation.presenter.emailverification.EmailOtpPresenter;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.emailverification.ManageEmailVerificationSuccessActivity;
import com.scb.phone.view.activity.hml.HmlVerifyEmailSuccessfulActivity;
import com.scb.phone.view.custom.login.CustomKeypad;
import com.scb.phone.view.custom.login.CustomPinTextInput;
import com.scb.phone.view.fragment.emailverification.ManageEmailVerificationFragment;
import o.C0695Ml;
import o.C13846fhy;
import o.C15715hv;
import o.C17046tXv;
import o.C5331bqy;
import o.InterfaceC10433eDx;
import o.InterfaceC13391fZD;
import o.MoA;
import o.ZI;
import o.cZQ;
import o.zCz;
/* loaded from: classes5.dex */
public class ManageEmailVerificationFragment extends Hilt_ManageEmailVerificationFragment implements cZQ.HBt, InterfaceC10433eDx {
public LWm c;
@BindView
CustomKeypad customKeypad;
@BindView
CustomPinTextInput customPinInput;
@BindView
TextView didNotReceiveTextView;
@InterfaceC13391fZD
public EmailOtpPresenter emailOtpPresenter;
@BindView
public TextView enterOtpMessage;
@BindView
TextView errorMessage;
private C13846fhy g;
private boolean h;
@BindView
public TextView refCodeTextView;
private boolean j = false;
private boolean d = false;
/* loaded from: classes5.dex */
public interface LWm {
void c(String str);
void d(String str);
}
@Override // o.InterfaceC10433eDx
public final void T_() {
}
@Override // androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (getActivity() != null) {
getActivity().getWindow().setSoftInputMode(2);
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559633, viewGroup, false);
ButterKnife.c(this, inflate);
this.c = (LWm) getActivity();
this.emailOtpPresenter.e((EmailOtpPresenter) this);
C13846fhy c13846fhy = new C13846fhy();
this.g = c13846fhy;
if (getActivity() != null) {
c13846fhy.c(((BaseActivity) getActivity()).scbAnalytics, "emailverification_verify");
}
if (getArguments() != null) {
Bundle arguments = getArguments();
String string = arguments.getString("BUNDLE_EMAIL");
String string2 = arguments.getString("BUNDLE_UUID");
String string3 = arguments.getString("BUNDLE_REFCODE");
this.j = arguments.getBoolean("FLOW", false);
this.d = arguments.getBoolean("FROM_NOTI", false);
this.h = arguments.getBoolean("EXTRA_IS_REQUESTED_FOR_RESULT", false);
final EmailOtpPresenter emailOtpPresenter = this.emailOtpPresenter;
Boolean valueOf = Boolean.valueOf(this.j);
emailOtpPresenter.e = string;
emailOtpPresenter.g = string2;
emailOtpPresenter.h = string3;
emailOtpPresenter.b = valueOf.booleanValue();
ZI.IeS ieS = new ZI.IeS(emailOtpPresenter) { // from class: o.beU
private EmailOtpPresenter a;
@Override // o.ZI.IeS
public final void e(Object obj) {
((cZQ.HBt) obj).c(r0.e, this.a.h);
}
{
this.a = emailOtpPresenter;
}
};
if (emailOtpPresenter.f != 0) {
ieS.e(emailOtpPresenter.f);
}
}
aa();
this.customPinInput.setPinInputListener(this);
this.customPinInput.e();
this.customKeypad.setKeypadListener(this.customPinInput);
this.errorMessage.setText("");
e(getString(R.string.manage_email_verification_didnt_receive_message));
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.emailOtpPresenter.w_();
super.onDestroy();
}
@Override // com.scb.phone.view.fragment.BaseFragment
public final void aa() {
String string;
super.aa();
Y();
if (this.j) {
string = getString(R.string.manage_email_verification_title_hml);
} else {
string = getString(R.string.manage_email_verification_title);
}
u(string);
}
/* JADX INFO: Access modifiers changed from: protected */
public final void e(String str) {
StringBuilder sb = new StringBuilder(" ");
sb.append(getString(R.string.manage_email_otp_resend));
this.didNotReceiveTextView.setText(C17046tXv.Qo_(str, sb.toString(), getResources(), new C17046tXv.HBt(this) { // from class: o.eYf
private ManageEmailVerificationFragment b;
@Override // o.C17046tXv.HBt
public final void e() {
ManageEmailVerificationFragment.c(this.b);
}
{
this.b = this;
}
}, false, 1, C15715hv.LWm.scb_purple));
this.didNotReceiveTextView.setMovementMethod(LinkMovementMethod.getInstance());
this.didNotReceiveTextView.setHighlightColor(0);
}
@Override // o.cZQ.HBt
public final void c(String str, String str2) {
a(str, str2);
}
protected void a(String str, String str2) {
this.refCodeTextView.setText(getString(R.string.manage_email_otp_reference_code, str2));
this.enterOtpMessage.setText(getString(R.string.manage_email_verification_input_message, str));
this.errorMessage.setText("");
}
@Override // o.cZQ.HBt
public final void d(String str) {
this.errorMessage.setText(str);
}
@Override // o.cZQ.HBt
public void b(String str) {
this.c.c(getString(R.string.manage_email_verification_resend_otp_description));
}
@Override // o.cZQ.HBt
public final void a(String str) {
this.customPinInput.e();
this.c.d(str);
}
@Override // o.cZQ.HBt
public final void c(C0695Ml c0695Ml) {
if (this.h) {
startActivityForResult(ManageEmailVerificationSuccessActivity.afe_(getActivity(), c0695Ml), 10001);
} else {
startActivity(ManageEmailVerificationSuccessActivity.afd_(getActivity(), c0695Ml, this.d));
}
}
@Override // o.cZQ.HBt
public void c(String str) {
startActivity(HmlVerifyEmailSuccessfulActivity.agu_(getContext(), str));
}
@Override // o.InterfaceC10433eDx
public final void S_() {
this.errorMessage.setText("");
}
@Override // o.InterfaceC10433eDx
public final void o_(String str) {
this.customPinInput.e();
EmailOtpPresenter emailOtpPresenter = this.emailOtpPresenter;
if (emailOtpPresenter.f != 0) {
emailOtpPresenter.f.y();
}
byte b = 0;
if (emailOtpPresenter.b) {
emailOtpPresenter.a.d(emailOtpPresenter.e, emailOtpPresenter.g, str);
C5331bqy c5331bqy = emailOtpPresenter.a;
c5331bqy.d(c5331bqy.i, new EmailOtpPresenter.IeS(emailOtpPresenter, b));
return;
}
emailOtpPresenter.d.d(emailOtpPresenter.g, str);
MoA moA = emailOtpPresenter.d;
moA.d(moA.i, new EmailOtpPresenter.HBt(emailOtpPresenter, b));
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
FragmentActivity activity = getActivity();
if (i != 10001 || activity == null) {
return;
}
activity.setResult(i2, intent);
activity.finish();
}
public static /* synthetic */ void c(ManageEmailVerificationFragment manageEmailVerificationFragment) {
C13846fhy c13846fhy = manageEmailVerificationFragment.g;
if (manageEmailVerificationFragment.getActivity() != null) {
c13846fhy.c(((BaseActivity) manageEmailVerificationFragment.getActivity()).scbAnalytics, "emailverification_resend_otp");
}
final EmailOtpPresenter emailOtpPresenter = manageEmailVerificationFragment.emailOtpPresenter;
final FragmentActivity activity = manageEmailVerificationFragment.getActivity();
if (SystemClock.elapsedRealtime() - emailOtpPresenter.i < 60000) {
ZI.IeS ieS = new ZI.IeS(emailOtpPresenter, activity) { // from class: o.beM
private Context c;
private EmailOtpPresenter d;
@Override // o.ZI.IeS
public final void e(Object obj) {
cZQ.HBt hBt = (cZQ.HBt) obj;
hBt.d(String.format(this.c.getString(C15715hv.tOB.opt_delay), String.valueOf((60000 - (SystemClock.elapsedRealtime() - this.d.i)) / 1000)));
}
{
this.d = emailOtpPresenter;
this.c = activity;
}
};
if (emailOtpPresenter.f != 0) {
ieS.e(emailOtpPresenter.f);
return;
}
return;
}
emailOtpPresenter.i = SystemClock.elapsedRealtime();
emailOtpPresenter.i = SystemClock.elapsedRealtime();
if (emailOtpPresenter.f != 0) {
emailOtpPresenter.f.y();
}
byte b = 0;
if (emailOtpPresenter.b) {
emailOtpPresenter.c.e();
zCz zcz = emailOtpPresenter.c;
zcz.d(zcz.i, new EmailOtpPresenter.LWm(emailOtpPresenter, b));
return;
}
MoA moA = emailOtpPresenter.d;
MoA moA2 = emailOtpPresenter.d;
moA2.d(moA2.i, new EmailOtpPresenter.RVV(emailOtpPresenter, b));
}
}