what-the-bank/sources/com/scb/phone/view/fragment/fastpay/FastPayInputFragment.java

461 lines
17 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.fastpay;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
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.HomeActivity;
import com.scb.phone.view.activity.fastpay.FastPayBillPaymentReviewActivity;
import com.scb.phone.view.activity.fastpay.FastPayTransferReviewActivity;
import com.scb.phone.view.activity.prelogin.PinLoginActivity;
import com.scb.phone.view.activity.transferandpay.billpayment.BillPaymentReviewActivity;
import com.scb.phone.view.activity.transferandpay.transfer.TransferReviewActivity;
import com.scb.phone.view.custom.common.AmountEditText;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.custom.common.NoteEditText;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPayItem;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPaySource;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPayTarget;
import com.scb.phone.view.fragment.fastpay.FastPayInputFragment;
import o.C0910Ri;
import o.C1019Twi;
import o.C1189Xo;
import o.C1193Xr;
import o.C1203Xy;
import o.C17515xRi;
import o.C4938bjc;
import o.C6583cXR;
import o.InterfaceC13391fZD;
import o.InterfaceC6662cZe;
import o.JbU;
import o.MBB;
import o.REU;
import o.ZI;
import o.gjJ;
import o.qhK;
/* loaded from: classes5.dex */
public class FastPayInputFragment extends Hilt_FastPayInputFragment implements InterfaceC6662cZe.IeS {
@BindView
protected CustomTransferAndPaySource accountFrom;
@BindView
protected CustomTransferAndPayTarget accountTo;
@BindView
protected LinearLayout amountInputLayout;
@BindView
protected CustomTransferAndPayItem amountItem;
@BindView
protected Button buttonReview;
private Double c;
private HBt d;
@BindView
protected AmountEditText editAmount;
@InterfaceC13391fZD
public C4938bjc fastPayInputPresenter;
@BindView
protected TextInputLayout inputLayout;
@BindView
protected NoteEditText noteEditText;
@BindView
protected TextView remainingLimit;
@BindView
protected TextView remainingLimitError;
@BindView
protected LinearLayout remainingLimitLinearLayout;
@BindView
protected TextView textRemainingLimit;
/* loaded from: classes5.dex */
public interface HBt {
void d(MBB mbb, String str);
void d(C1193Xr c1193Xr, MBB mbb, String str, C0910Ri c0910Ri);
}
public static FastPayInputFragment a(C1203Xy c1203Xy, boolean z) {
Bundle bundle = new Bundle();
bundle.putParcelable("com.scb.phone.EXTRA_FASTPAY_DISPLAY", c1203Xy);
bundle.putBoolean("com.scb.phone.EXTRA_FASTPAY_FROM_SCAN_DEEP_LINK", z);
FastPayInputFragment fastPayInputFragment = new FastPayInputFragment();
fastPayInputFragment.setArguments(bundle);
return fastPayInputFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
byte b = 0;
View inflate = layoutInflater.inflate(R.layout.2131559648, viewGroup, false);
ButterKnife.c(this, inflate);
this.fastPayInputPresenter.e((C4938bjc) this);
Bundle arguments = getArguments();
C1203Xy c1203Xy = arguments != null ? (C1203Xy) arguments.getParcelable("com.scb.phone.EXTRA_FASTPAY_DISPLAY") : null;
boolean z = arguments != null && arguments.getBoolean("com.scb.phone.EXTRA_FASTPAY_FROM_SCAN_DEEP_LINK", false);
if (c1203Xy != null) {
this.fastPayInputPresenter.b = z;
C4938bjc c4938bjc = this.fastPayInputPresenter;
if (c4938bjc.f != 0) {
c4938bjc.f.y();
}
c4938bjc.i = c1203Xy;
c4938bjc.e.b();
JbU jbU = c4938bjc.e;
jbU.d(jbU.i, new C4938bjc.LWm(c4938bjc, c1203Xy));
C4938bjc c4938bjc2 = this.fastPayInputPresenter;
ZI.IeS ieS = new ZI.IeS() { // from class: o.bjf
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6662cZe.IeS) obj).h();
}
};
if (c4938bjc2.f != 0) {
ieS.e(c4938bjc2.f);
}
c4938bjc2.d.e("FASTPAY", "ALL");
REU reu = c4938bjc2.d;
reu.d(reu.i, new C4938bjc.RVV(c4938bjc2, b));
this.c = Double.valueOf(c1203Xy.c);
}
this.buttonReview.setEnabled(false);
return inflate;
}
@Override // o.InterfaceC6662cZe.IeS
public final void e(String str) {
this.accountFrom.setAvatar(C6583cXR.VS_(getContext(), R.drawable.bankicon_scb).toString());
this.accountFrom.setRightSpace(50);
this.accountFrom.setSourceName(str);
this.accountFrom.tvSourceAccount.setVisibility(8);
this.accountFrom.setOnClickListener(new View.OnClickListener(this) { // from class: o.eYN
private FastPayInputFragment e;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
FastPayInputFragment.b(this.e);
}
{
this.e = this;
}
});
}
@Override // o.InterfaceC6662cZe.IeS
public final void c(C1193Xr c1193Xr) {
this.accountTo.setAvatar(c1193Xr.c());
this.accountTo.setTargetName(c1193Xr.e());
this.accountTo.setReferenceNumbers(c1193Xr.h);
this.accountTo.setReferenceNo1(getString(R.string.ebill_selected_reference, c1193Xr.F, c1193Xr.K));
}
@Override // o.InterfaceC6662cZe.IeS
public final void c(String str, int i) {
this.accountTo.setAvatar(C6583cXR.VS_(getContext(), i).toString());
this.accountTo.setTargetName(str);
this.accountTo.setReferenceNumbersVisible(false);
}
@Override // o.InterfaceC6662cZe.IeS
public final void h() {
super.v();
a(false);
}
@Override // o.InterfaceC6662cZe.IeS
public final void i() {
this.textRemainingLimit.setText(R.string.limit_not_available);
a(true);
}
@Override // o.InterfaceC6662cZe.IeS
public final void a() {
super.aq_();
}
@Override // o.InterfaceC6662cZe.IeS
public final void c(String str) {
this.textRemainingLimit.setText(getString(R.string.remaining_fastpay_limit, str));
a(true);
}
private void a(boolean z) {
this.remainingLimitLinearLayout.setVisibility(z ? 0 : 8);
this.remainingLimitError.setVisibility(z ? 8 : 0);
this.textRemainingLimit.setVisibility(z ? 0 : 8);
this.remainingLimit.setVisibility(z ? 0 : 8);
}
@Override // o.InterfaceC6662cZe.IeS
public final void d(String str) {
this.amountItem.setVisibility(0);
this.amountItem.setValue(str);
this.amountItem.mDividerView.setVisibility(8);
this.amountInputLayout.setVisibility(8);
this.buttonReview.setEnabled(true);
}
@Override // o.InterfaceC6662cZe.IeS
public final void c() {
this.amountItem.setVisibility(8);
this.amountInputLayout.setVisibility(0);
this.editAmount.setHint(getString(R.string.transfer_to_account_amount_hint));
this.editAmount.setOnPasteListener(new AmountEditText.HBt());
this.editAmount.setOnAmountChangeListener(new AmountEditText.RVV(this) { // from class: com.scb.phone.view.fragment.fastpay.FastPayInputFragment.3
private FastPayInputFragment a;
{
this.a = this;
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void b(double d) {
this.a.c = Double.valueOf(d);
this.a.buttonReview.setEnabled(d > 0.0d);
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void a() {
this.a.aN_();
}
});
this.editAmount.setMaximumDecimalDigit(17);
}
@OnClick
public void onReviewButtonClick() {
this.fastPayInputPresenter.a(this.c.doubleValue(), this.noteEditText.mNoteEditText.getText().toString());
}
@Override // o.InterfaceC6662cZe.IeS
public final void a(final C1189Xo c1189Xo) {
CustomDialog c = CustomDialog.b(getContext()).c(R.string.credit_card_alert_information_title);
String string = getString(R.string.credit_card_alert_information_description);
if (gjJ.a(string)) {
c.mTextTextView.setVisibility(0);
c.mTextTextView.setText(string);
}
((CustomDialog) CustomDialog.e(new Object[]{c.aoT_(R.string.ok, new DialogInterface.OnClickListener(this, c1189Xo) { // from class: o.eYV
private C1189Xo b;
private FastPayInputFragment c;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
FastPayInputFragment.b(this.c, this.b);
}
{
this.c = this;
this.b = c1189Xo;
}
}), Integer.valueOf(R.string.cancel), new DialogInterface.OnClickListener() { // from class: o.eYQ
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}})).show();
}
@Override // o.InterfaceC6662cZe.IeS
public final void e(C1189Xo c1189Xo) {
Intent intent = new Intent(getActivity(), (Class<?>) FastPayBillPaymentReviewActivity.class);
intent.putExtra("com.scb.phone.EXTRA_REVIEW", c1189Xo);
startActivity(intent);
}
@Override // o.InterfaceC6662cZe.IeS
public final void e(final C1189Xo c1189Xo, final String str) {
CustomDialog c = CustomDialog.b(getContext()).c(R.string.credit_card_alert_information_title);
String string = getString(R.string.credit_card_alert_information_description);
if (gjJ.a(string)) {
c.mTextTextView.setVisibility(0);
c.mTextTextView.setText(string);
}
((CustomDialog) CustomDialog.e(new Object[]{c.aoT_(R.string.ok, new DialogInterface.OnClickListener(this, c1189Xo, str) { // from class: o.eYO
private String c;
private FastPayInputFragment d;
private C1189Xo e;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.d.a(this.e, this.c);
}
{
this.d = this;
this.e = c1189Xo;
this.c = str;
}
}), Integer.valueOf(R.string.cancel), new DialogInterface.OnClickListener() { // from class: o.eYW
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}})).show();
}
@Override // o.InterfaceC6662cZe.IeS
public final void a(C1189Xo c1189Xo, String str) {
Intent intent = new Intent(getActivity(), (Class<?>) BillPaymentReviewActivity.class);
intent.putExtra("com.scb.phone.EXTRA_REVIEW", c1189Xo);
intent.putExtra("subtype", "bill_payment");
intent.putExtra("source", str);
startActivity(intent);
}
@Override // o.InterfaceC6662cZe.IeS
public final void b(C1189Xo c1189Xo, qhK qhk, String str) {
startActivity(TransferReviewActivity.amP_(requireContext(), c1189Xo, qhk, str));
}
@Override // o.InterfaceC6662cZe.IeS
public final void b(C1189Xo c1189Xo, qhK qhk) {
Intent intent = new Intent(getContext(), (Class<?>) FastPayTransferReviewActivity.class);
intent.putExtra("com.scb.phone.EXTRA_REVIEW", c1189Xo);
intent.putExtra("com.scb.phone.EXTRA_TRANSFER_TYPE", qhk);
startActivity(intent);
}
@Override // o.InterfaceC6662cZe.IeS
public final void c(C1193Xr c1193Xr, MBB mbb, String str, C0910Ri c0910Ri) {
HBt hBt = this.d;
if (hBt != null) {
hBt.d(c1193Xr, mbb, str, c0910Ri);
}
}
@Override // o.InterfaceC6662cZe.IeS
public final void c(MBB mbb, String str) {
HBt hBt = this.d;
if (hBt != null) {
hBt.d(mbb, str);
}
}
@Override // o.InterfaceC6662cZe.IeS
public final void e() {
startActivityForResult(new Intent(getActivity(), (Class<?>) PinLoginActivity.class), 7000);
}
@Override // o.InterfaceC6662cZe.IeS
public final void b() {
this.noteEditText.d();
}
@Override // o.InterfaceC6662cZe.IeS
public final void d() {
startActivity((Intent) HomeActivity.e(new Object[]{getActivity()}, -1290522472, 1290522474, (int) System.currentTimeMillis()));
}
@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);
if (i == 7000 && i2 == -1) {
this.fastPayInputPresenter.a(this.c.doubleValue(), this.noteEditText.mNoteEditText.getText().toString());
}
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.fastpay.Hilt_FastPayInputFragment, com.scb.phone.view.fragment.transferandpay.Hilt_BaseDuplicatedTransferFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof HBt) {
this.d = (HBt) context;
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.fastPayInputPresenter.w_();
super.onDestroy();
}
public static /* synthetic */ void b(FastPayInputFragment fastPayInputFragment) {
final C4938bjc c4938bjc = fastPayInputFragment.fastPayInputPresenter;
double doubleValue = fastPayInputFragment.c.doubleValue();
String str = c4938bjc.i.i;
str.hashCode();
if (str.equals("FASTBP")) {
final C0910Ri a = C0910Ri.a();
a.d = c4938bjc.a.b;
a.a = c4938bjc.c.g;
a.b = (String) C6583cXR.c(new Object[]{Double.valueOf(doubleValue)}, -150997759, 150997764, (int) System.currentTimeMillis());
a.g = c4938bjc.c.K;
a.i = c4938bjc.c.J;
ZI.IeS ieS = new ZI.IeS(c4938bjc, a) { // from class: o.bji
private C0910Ri a;
private C4938bjc d;
@Override // o.ZI.IeS
public final void e(Object obj) {
InterfaceC6662cZe.IeS ieS2 = (InterfaceC6662cZe.IeS) obj;
ieS2.c(this.d.c, MBB.SCAN, r2.b ? "deeplink" : "scan", this.a);
}
{
this.d = c4938bjc;
this.a = a;
}
};
if (c4938bjc.f != 0) {
ieS.e(c4938bjc.f);
return;
}
return;
}
if (str.equals("FASTPP")) {
C17515xRi c17515xRi = c4938bjc.h;
C1019Twi n = c4938bjc.g.a.n();
n.h = doubleValue;
c17515xRi.e.d(n);
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.bjg
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6662cZe.IeS) obj).c(MBB.SCAN, "scan");
}
};
if (c4938bjc.f != 0) {
ieS2.e(c4938bjc.f);
}
}
}
public static /* synthetic */ void b(FastPayInputFragment fastPayInputFragment, C1189Xo c1189Xo) {
Intent intent = new Intent(fastPayInputFragment.getActivity(), (Class<?>) FastPayBillPaymentReviewActivity.class);
intent.putExtra("com.scb.phone.EXTRA_REVIEW", c1189Xo);
fastPayInputFragment.startActivity(intent);
}
@Override // o.InterfaceC6662cZe.IeS
public final void b(C1193Xr c1193Xr) {
this.accountTo.setReferenceNo3(getString(R.string.ebill_selected_reference, c1193Xr.L, c1193Xr.N));
}
@Override // o.InterfaceC6662cZe.IeS
public final void d(C1193Xr c1193Xr) {
this.accountTo.setReferenceNo2(getString(R.string.ebill_selected_reference, c1193Xr.M, c1193Xr.J));
}
}