what-the-bank/sources/com/scb/phone/view/fragment/easycash/issuer/EasycashIssuerInputFragment...

245 lines
8.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.easycash.issuer;
import android.content.Context;
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 android.widget.Button;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.google.android.material.textfield.TextInputLayout;
import com.scb.phone.R;
import com.scb.phone.view.activity.easycash.EasycashIssuerSearchActivity;
import com.scb.phone.view.custom.common.AmountEditText;
import com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle;
import com.scb.phone.view.custom.investment.onboarding.CustomTextViewNavigation;
import com.scb.phone.view.fragment.easycash.issuer.EasycashIssuerInputFragment;
import java.util.List;
import o.C0639Le;
import o.C15715hv;
import o.C6583cXR;
import o.InterfaceC13391fZD;
import o.InterfaceC1903aRj;
import o.InterfaceC6621cYR;
import o.MYp;
import o.ZI;
import o.aWE;
import o.uWm;
/* loaded from: classes5.dex */
public class EasycashIssuerInputFragment extends Hilt_EasycashIssuerInputFragment implements InterfaceC6621cYR.AGo {
@BindView
protected AmountEditText amountEditText;
@BindView
protected TextInputLayout amountInputLayout;
@BindView
protected Button buttonDone;
@BindView
protected CustomTextViewNavigation customSelectIssuer;
@BindView
public CustomSpinnerWithTitle customSpinnerLoadType;
private InterfaceC1903aRj d;
@InterfaceC13391fZD
public aWE inputPresenter;
private CustomSpinnerWithTitle.LWm c = new CustomSpinnerWithTitle.LWm(this) { // from class: com.scb.phone.view.fragment.easycash.issuer.EasycashIssuerInputFragment.5
private EasycashIssuerInputFragment a;
{
this.a = this;
}
@Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm
public final void bn_() {
aWE awe = this.a.inputPresenter;
if (awe.f != 0) {
awe.f.y();
}
awe.c.b();
uWm uwm = awe.c;
uwm.d(uwm.i, new aWE.HBt(awe, (byte) 0));
}
@Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm
public final void bo_() {
this.a.g();
}
};
private CustomTextViewNavigation.RVV h = new CustomTextViewNavigation.RVV(this) { // from class: o.eVy
private EasycashIssuerInputFragment e;
@Override // com.scb.phone.view.custom.investment.onboarding.CustomTextViewNavigation.RVV
public final void b() {
this.e.f();
}
{
this.e = this;
}
};
@Override // o.InterfaceC9713dpA.HBt
public final boolean p() {
return true;
}
@Override // o.InterfaceC9713dpA.HBt
public final int t() {
return 1;
}
@Override // o.InterfaceC9713dpA.HBt
public final String q() {
return getString(R.string.occupation_info_title);
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559600, viewGroup, false);
ButterKnife.c(this, inflate);
this.inputPresenter.e((aWE) this);
this.customSpinnerLoadType.setOnCustomSpinnerWithTitleCompletion(this.c);
this.customSelectIssuer.setOnClickDetailNavigationCompletion(this.h);
this.amountEditText.setOnAmountChangeListener(new AmountEditText.RVV(this) { // from class: com.scb.phone.view.fragment.easycash.issuer.EasycashIssuerInputFragment.1
private EasycashIssuerInputFragment e;
{
this.e = this;
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void b(double d) {
aWE awe = this.e.inputPresenter;
String obj = this.e.amountEditText.getText().toString();
awe.e = d;
if (TextUtils.isEmpty(obj) || d == 0.0d) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.aWB
@Override // o.ZI.IeS
public final void e(Object obj2) {
((InterfaceC6621cYR.AGo) obj2).b(C15715hv.tOB.incorrect_amount);
}
};
if (awe.f != 0) {
ieS.e(awe.f);
}
} else {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.aWI
@Override // o.ZI.IeS
public final void e(Object obj2) {
((InterfaceC6621cYR.AGo) obj2).d();
}
};
if (awe.f != 0) {
ieS2.e(awe.f);
}
}
this.e.g();
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void a() {
this.e.aN_();
}
});
return inflate;
}
/* JADX INFO: Access modifiers changed from: private */
public void g() {
boolean z = (TextUtils.isEmpty(this.amountEditText.getText()) || C6583cXR.q(this.amountEditText.getText().toString()) || TextUtils.isEmpty(this.customSelectIssuer.textViewDesc.getText().toString()) || ((MYp) this.customSpinnerLoadType.c.e()).c.getSelectedItemPosition() <= 0) ? false : true;
if (this.buttonDone.isEnabled() != z) {
this.buttonDone.setEnabled(z);
}
}
@Override // o.InterfaceC6621cYR.AGo
public final void e(List<String> list) {
this.customSpinnerLoadType.setItemsWithPlaceholder(list, true);
this.customSpinnerLoadType.setMandatory(true);
}
@Override // o.InterfaceC6621cYR.AGo
public final void b(int i) {
this.amountInputLayout.setError(getString(i));
}
@Override // o.InterfaceC6621cYR.AGo
public final void d() {
this.amountInputLayout.setError(null);
}
public void f() {
startActivityForResult(EasycashIssuerSearchActivity.aer_(getContext()), 107);
}
@Override // o.InterfaceC6621cYR.AGo
public final void e(String str) {
this.customSelectIssuer.setDescriptionText(str);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
if (i2 == -1 && i == 107) {
final C0639Le c0639Le = (C0639Le) intent.getParcelableExtra("EXTRA_RESULT_ISSUER_SEARCH");
final aWE awe = this.inputPresenter;
awe.b = c0639Le;
ZI.IeS ieS = new ZI.IeS(awe, c0639Le) { // from class: o.aWJ
private C0639Le b;
private aWE d;
@Override // o.ZI.IeS
public final void e(Object obj) {
aWE.d(this.d, this.b, (InterfaceC6621cYR.AGo) obj);
}
{
this.d = awe;
this.b = c0639Le;
}
};
if (awe.f != 0) {
ieS.e(awe.f);
}
g();
}
}
@OnClick
public void onDoneButtonClick() {
j();
}
@Override // o.InterfaceC6621cYR.AGo
public void a() {
this.d.s();
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.easycash.issuer.Hilt_EasycashIssuerInputFragment, com.scb.phone.view.fragment.etb.BreadcrumbFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof InterfaceC1903aRj) {
this.d = (InterfaceC1903aRj) context;
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.d = null;
super.onDestroy();
}
protected void j() {
this.inputPresenter.c(((MYp) this.customSpinnerLoadType.c.e()).c.getSelectedItemPosition() - 1, this.d.e(), false);
}
}