what-the-bank/sources/com/scb/phone/view/fragment/hml/HmlETBPersonalInfoFragment....

220 lines
8.4 KiB
Java

package com.scb.phone.view.fragment.hml;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.hml.HmlMonthlyIncomeAboutActivity;
import com.scb.phone.view.custom.common.ClearableEditText;
import com.scb.phone.view.custom.common.CommonInputViewGroup;
import com.scb.phone.view.custom.common.CustomLaserIdInput;
import com.scb.phone.view.custom.common.CustomPhoneNumberInput;
import com.scb.phone.view.custom.common.DateInputText;
import com.scb.phone.view.fragment.hml.HmlETBPersonalInfoFragment;
import o.AbstractC5071bmC;
import o.C5087bmS;
import o.C5291bqK;
import o.InterfaceC9263dgT;
import o.NF;
import o.kVs;
import o.pug;
/* loaded from: classes5.dex */
public abstract class HmlETBPersonalInfoFragment extends Hilt_HmlETBPersonalInfoFragment implements InterfaceC9263dgT {
private C5291bqK c;
@BindView
TextView tvETBExpiryDateTitle;
/* JADX INFO: Access modifiers changed from: protected */
public abstract void C();
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
if (i == 1002 && i2 == -1 && intent != null) {
C5291bqK c5291bqK = this.c;
String stringExtra = intent.getStringExtra("com.scb.phone.EXTRA_RESULT_ADDRESS");
C5087bmS c5087bmS = new C5087bmS(stringExtra);
if (c5291bqK.f != 0) {
c5087bmS.e(c5291bqK.f);
}
c5291bqK.c(AbstractC5071bmC.HBt.MAILING_ADDRESS, !stringExtra.isEmpty(), TextUtils.isEmpty(stringExtra));
}
super.onActivityResult(i, i2, intent);
}
@Override // o.InterfaceC9249dgE
public final void c() {
this.c.c(this.firstNameView.mEditText.getText().toString(), this.lastNameView.mEditText.getText().toString(), this.mobileNumberView.mEditText.getText().toString(), this.emailView.mEditText.getText().toString(), this.income.getText().toString(), this.maritalStatusSpinner.d(), this.residentialStatusSpinner.d(), this.educationLevelSpinner.d(), this.baseExpiredDate.inputEditText.getText().toString(), this.laserIdInput.c());
c("p10x1_verification_personal_info", new pug("monthly_income", this.income.getText().toString()));
}
@Override // com.scb.phone.view.fragment.hml.HmlBasePersonalInfoFragment
protected final void B() {
this.baseExpiredDate.setDateUpdatedListener(new DateInputText.Sts(this) { // from class: o.fbU
private HmlETBPersonalInfoFragment d;
@Override // com.scb.phone.view.custom.common.DateInputText.Sts
public final void c(String str) {
HmlETBPersonalInfoFragment.b(this.d, str);
}
{
this.d = this;
}
});
this.baseExpiredDate.setValidateInputListener(new ClearableEditText.RVV(this) { // from class: o.fbV
private HmlETBPersonalInfoFragment e;
@Override // com.scb.phone.view.custom.common.ClearableEditText.RVV
public final boolean c(String str) {
boolean d;
d = this.e.c.d(str);
return d;
}
{
this.e = this;
}
});
}
@OnClick
public void onAboutClicked(View view) {
startActivity(HmlMonthlyIncomeAboutActivity.afV_(getContext()));
}
/* renamed from: com.scb.phone.view.fragment.hml.HmlETBPersonalInfoFragment$5, reason: invalid class name */
/* loaded from: classes5.dex */
static /* synthetic */ class AnonymousClass5 {
static final int[] b;
static {
int[] iArr = new int[AbstractC5071bmC.HBt.values().length];
b = iArr;
try {
iArr[AbstractC5071bmC.HBt.EXPIRY_DATE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
b[AbstractC5071bmC.HBt.LASER_ID.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
}
}
@Override // com.scb.phone.view.fragment.hml.HmlBasePersonalInfoFragment, o.InterfaceC9249dgE
public final void c(AbstractC5071bmC.HBt hBt) {
int i = AnonymousClass5.b[hBt.ordinal()];
if (i == 1) {
this.baseExpiredDate.setErrorText(getString(R.string.hml_personal_info_national_id_expired_date_error));
this.baseExpiredDate.setErrorVisible(true);
} else {
if (i == 2) {
this.laserIdInput.setError(getString(R.string.hml_personal_info_laser_id_invalid_error));
CustomLaserIdInput customLaserIdInput = this.laserIdInput;
customLaserIdInput.tvLaserIdError.setVisibility(0);
customLaserIdInput.d(false);
return;
}
super.c(hBt);
}
}
@Override // com.scb.phone.view.fragment.hml.HmlBasePersonalInfoFragment, o.InterfaceC9249dgE
public final void b(AbstractC5071bmC.HBt hBt) {
if (hBt == AbstractC5071bmC.HBt.EXPIRY_DATE) {
this.baseExpiredDate.setErrorVisible(false);
} else {
super.b(hBt);
}
}
@Override // com.scb.phone.view.fragment.hml.HmlBasePersonalInfoFragment, o.InterfaceC9249dgE
public final void a(AbstractC5071bmC.HBt hBt) {
int i = AnonymousClass5.b[hBt.ordinal()];
if (i == 1) {
this.baseExpiredDate.setErrorText(getString(R.string.hml_personal_info_date_of_expiry_format_error));
this.baseExpiredDate.setErrorVisible(true);
} else {
if (i == 2) {
this.laserIdInput.setError(getString(R.string.hml_personal_info_laser_id_wrong_format));
CustomLaserIdInput customLaserIdInput = this.laserIdInput;
customLaserIdInput.tvLaserIdError.setVisibility(0);
customLaserIdInput.d(false);
return;
}
super.a(hBt);
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.c.w_();
super.onDestroy();
}
public static /* synthetic */ void b(HmlETBPersonalInfoFragment hmlETBPersonalInfoFragment, String str) {
C5291bqK c5291bqK = hmlETBPersonalInfoFragment.c;
c5291bqK.c(AbstractC5071bmC.HBt.EXPIRY_DATE, c5291bqK.d(str), TextUtils.isEmpty(str));
}
public final void e(C5291bqK c5291bqK) {
this.c = c5291bqK;
((HmlBasePersonalInfoFragment) this).d = c5291bqK;
}
@Override // o.InterfaceC9263dgT
public final void c(NF nf) {
String str = nf.g;
CustomPhoneNumberInput customPhoneNumberInput = this.mobileNumberView;
if (str != null && !str.isEmpty()) {
customPhoneNumberInput.setText(str);
}
String str2 = nf.e;
CommonInputViewGroup commonInputViewGroup = this.emailView;
if (str2 != null && !str2.isEmpty()) {
commonInputViewGroup.setText(str2);
}
this.emailView.mEditText.setEnabled(nf.b);
if (!nf.b) {
this.emailView.mEditText.setTextColor(kVs.nX_(getResources(), R.color.f3092131099816, null));
ImageButton imageButton = this.emailView.mEditPencilImageButton;
if (imageButton != null) {
imageButton.setVisibility(0);
}
this.emailView.setPencilEditListener(new View.OnClickListener(this) { // from class: o.fbT
private HmlETBPersonalInfoFragment c;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
this.c.C();
}
{
this.c = this;
}
});
} else {
ImageButton imageButton2 = this.emailView.mEditPencilImageButton;
if (imageButton2 != null) {
imageButton2.setVisibility(8);
}
}
if (!TextUtils.isEmpty(nf.c)) {
this.income.setText(nf.c);
}
if (nf.a != null && !TextUtils.isEmpty(nf.a)) {
this.baseExpiredDate.setText(nf.a);
}
if (!TextUtils.isEmpty(nf.h)) {
this.laserIdInput.setLaserId(nf.h);
}
this.mailingView.setText(nf.f);
}
}