what-the-bank/sources/com/scb/phone/view/fragment/transferandpay/BaseTargetSelectedFragment....

208 lines
7.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.transferandpay;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.scb.phone.R;
import com.scb.phone.view.activity.transferandpay.ReviewActivity;
import com.scb.phone.view.custom.ScbEditText;
import com.scb.phone.view.custom.ScbTextInputLayout;
import com.scb.phone.view.custom.common.AmountEditText;
import com.scb.phone.view.custom.common.DefaultButton;
import com.scb.phone.view.custom.common.NoteEditText;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPayBiller;
import com.scb.phone.view.fragment.transferandpay.AccountSourceSelectFragment;
import com.scb.phone.view.fragment.transferandpay.BaseTargetSelectedFragment;
import java.util.concurrent.TimeUnit;
import o.AbstractC1181Xh;
import o.AbstractC13163fSk;
import o.C10457eEr;
import o.C1189Xo;
import o.C1226Yl;
import o.C13417fZt;
import o.C6583cXR;
import o.InterfaceC12846fIu;
import o.InterfaceC9011dbf;
import o.WW;
import o.fLM;
import o.fRR;
import o.fSJ;
import o.fSQ;
/* loaded from: classes5.dex */
public abstract class BaseTargetSelectedFragment extends Hilt_BaseTargetSelectedFragment implements InterfaceC9011dbf, InterfaceC12846fIu, AccountSourceSelectFragment.Sts {
public String g;
public C1226Yl h;
public String j;
public Integer k;
public fSJ l;
public boolean m;
@BindView
public ScbTextInputLayout mAmountInputLayout;
@BindView
public AmountEditText mAmountValue;
@BindView
public DefaultButton mButton;
@BindView
public CustomTransferAndPayBiller mCustomTransferAndPayBiller;
@BindView
public View mDivider;
@BindView
protected ViewGroup mLimitProgress;
@BindView
public RecyclerView mRecyclerView;
@BindView
public ScbEditText mReferenceEditText1;
@BindView
public ScbEditText mReferenceEditText2;
@BindView
public ScbEditText mReferenceEditText3;
@BindView
public TextView mReferenceTextView1;
@BindView
public TextView mReferenceTextView2;
@BindView
public TextView mReferenceTextView3;
@BindView
public TextView mRemainingLimit;
@BindView
public NoteEditText noteEditText;
@BindView
public TextView tvRemarkMinAmount;
public Double c = Double.valueOf(-1.0d);
public boolean f = false;
public boolean i = false;
protected abstract void b(WW ww);
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
this.l = AbstractC13163fSk.interval(1L, TimeUnit.SECONDS).subscribeOn(C13417fZt.c()).observeOn(fRR.e()).subscribe(new fSQ(this) { // from class: o.fCN
private BaseTargetSelectedFragment a;
@Override // o.fSQ
public final void c(Object obj) {
BaseTargetSelectedFragment.a(this.a);
}
{
this.a = this;
}
}, new fSQ() { // from class: o.fCS
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
AmountEditText amountEditText = this.mAmountValue;
amountEditText.setCurrencyFormattingTextWatcher(new fLM(amountEditText, this.mAmountInputLayout, 9.9999999999E8d, 0.0d, getResources().getString(R.string.error_limit), getResources().getString(R.string.not_enough_funds_on_selected_account)));
this.mAmountValue.setOnPasteListener(new AmountEditText.HBt());
this.mAmountValue.setOnAmountChangeListener(new AmountEditText.RVV(this) { // from class: com.scb.phone.view.fragment.transferandpay.BaseTargetSelectedFragment.2
private BaseTargetSelectedFragment a;
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void b(double d) {
}
{
this.a = this;
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void a() {
this.a.aN_();
}
});
this.mAmountValue.setHandleDismissKeyboard(new AmountEditText.LWm(this) { // from class: o.fCO
private BaseTargetSelectedFragment e;
@Override // com.scb.phone.view.custom.common.AmountEditText.LWm
public final void d() {
this.e.aN_();
}
{
this.e = this;
}
});
return null;
}
protected boolean G() {
return (this.mReferenceEditText1.getText() == null || this.mReferenceEditText1.getText().toString().isEmpty()) ? false : true;
}
public boolean F() {
String str = this.j;
return (str == null || str.isEmpty() || this.mAmountInputLayout.f6485o.c || C6583cXR.q(this.mAmountValue.getText().toString())) ? false : true;
}
protected void i(C1189Xo c1189Xo) {
Intent intent = new Intent(getActivity(), (Class<?>) ReviewActivity.class);
intent.putExtra("com.scb.phone.EXTRA_REVIEW", c1189Xo);
startActivity(intent);
ar_();
}
public void b(AbstractC1181Xh abstractC1181Xh) {
this.mCustomTransferAndPayBiller.setTitle(abstractC1181Xh.e());
this.mCustomTransferAndPayBiller.setAvatar(abstractC1181Xh.c());
this.mCustomTransferAndPayBiller.setOnCustomTransferAndPayItemListener(this);
}
@Override // o.InterfaceC12846fIu
public void aT_() {
C10457eEr.aqd_(this, new Intent(this.g));
}
public final void E() {
ViewGroup viewGroup = this.mLimitProgress;
if (viewGroup != null) {
viewGroup.setVisibility(0);
}
}
public final void H() {
ViewGroup viewGroup = this.mLimitProgress;
if (viewGroup != null) {
viewGroup.setVisibility(8);
}
}
@Override // com.scb.phone.view.fragment.transferandpay.AccountSourceSelectFragment.Sts
public final void a(WW ww) {
b(ww);
}
public static /* synthetic */ void a(BaseTargetSelectedFragment baseTargetSelectedFragment) {
boolean z;
boolean z2;
C1226Yl c1226Yl = baseTargetSelectedFragment.h;
boolean z3 = c1226Yl == null || !"PREPAID".equalsIgnoreCase(c1226Yl.s) ? baseTargetSelectedFragment.G() && baseTargetSelectedFragment.F() && ((!(z = baseTargetSelectedFragment.f) || baseTargetSelectedFragment.k != null) && (!z || baseTargetSelectedFragment.i)) : !(baseTargetSelectedFragment.mReferenceEditText1.getText() == null || baseTargetSelectedFragment.mReferenceEditText1.getText().toString().length() != 16 || !baseTargetSelectedFragment.F() || (((z2 = baseTargetSelectedFragment.f) && baseTargetSelectedFragment.k == null) || (z2 && !baseTargetSelectedFragment.i)));
if (baseTargetSelectedFragment.mButton.isEnabled() != z3) {
baseTargetSelectedFragment.mButton.setButtonEnabled(z3);
}
}
}