what-the-bank/sources/com/scb/phone/view/fragment/bankingagent/BankingAgentSelectedFragmen...

397 lines
13 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.bankingagent;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Editable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.custom.common.AmountEditText;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.bankingagent.BankingAgentSelectedFragment;
import com.scb.phone.view.fragment.bankingagent.BaseBankingAgentsFragment;
import o.C12891fKc;
import o.C14957gcv;
import o.C2528agM;
import o.FE;
import o.InterfaceC13391fZD;
import o.InterfaceC16541pFg;
import o.InterfaceC6625cYc;
import o.gdZ;
import o.nMh;
/* loaded from: classes5.dex */
public final class BankingAgentSelectedFragment extends Hilt_BankingAgentSelectedFragment implements InterfaceC6625cYc.LWm {
public static final LWm d = new LWm(0);
@BindView
public ImageView agentIcon;
@BindView
public TextView agentName;
@BindView
public TextView amountError;
@BindView
public TextView amountNeedToBeDivisibleText;
@BindView
public AmountEditText amountText;
private final AmountEditText.IeS c = new AmountEditText.IeS(this) { // from class: o.eHd
private BankingAgentSelectedFragment d;
@Override // com.scb.phone.view.custom.common.AmountEditText.IeS
public final void e() {
BankingAgentSelectedFragment.c(this.d);
}
{
this.d = this;
}
};
@BindView
public TextView dailyLimitText;
@BindView
public TextView feeText;
private HBt i;
@InterfaceC13391fZD
public C2528agM presenter;
/* loaded from: classes5.dex */
public interface HBt {
void c(double d);
void j();
}
@OnClick
public final void onCloseClicked() {
HBt hBt = this.i;
if (hBt == null) {
C14957gcv.a("");
hBt = null;
}
hBt.j();
}
/* loaded from: classes5.dex */
public static final class LWm {
private LWm() {
}
public /* synthetic */ LWm(byte b) {
this();
}
}
@Override // com.scb.phone.view.fragment.bankingagent.Hilt_BankingAgentSelectedFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public final void onAttach(Context context) {
C14957gcv.e(context, "");
super.onAttach(context);
if (getParentFragment() instanceof BaseBankingAgentsFragment.HBt) {
InterfaceC16541pFg parentFragment = getParentFragment();
C14957gcv.d(parentFragment, "");
this.i = (HBt) parentFragment;
}
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
FE fe;
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559457, viewGroup, false);
((BaseFragment) this).a = ButterKnife.c(this, inflate);
C2528agM c2528agM = this.presenter;
AmountEditText amountEditText = null;
if (c2528agM == null) {
C14957gcv.a("");
c2528agM = null;
}
c2528agM.e((C2528agM) this);
Bundle arguments = getArguments();
if (arguments != null && (fe = (FE) arguments.getParcelable("com.scb.phone.EXTRA_BANKING_AGENT_TAG")) != null) {
C2528agM c2528agM2 = this.presenter;
if (c2528agM2 == null) {
C14957gcv.a("");
c2528agM2 = null;
}
Bundle arguments2 = getArguments();
String string = arguments2 != null ? arguments2.getString("com.scb.phone.EXTRA_POSTING_TYPE") : null;
if (string == null) {
string = "";
}
C2528agM.b(new Object[]{c2528agM2, string, fe}, -1455860535, 1455860536, System.identityHashCode(c2528agM2));
}
AmountEditText amountEditText2 = this.amountText;
if (amountEditText2 == null) {
C14957gcv.a("");
amountEditText2 = null;
}
amountEditText2.setOnAmountChangeListener(new Sts(this));
AmountEditText amountEditText3 = this.amountText;
if (amountEditText3 == null) {
C14957gcv.a("");
amountEditText3 = null;
}
amountEditText3.setOnFocusChangeListener(new View.OnFocusChangeListener(this) { // from class: o.eHb
private BankingAgentSelectedFragment b;
@Override // android.view.View.OnFocusChangeListener
public final void onFocusChange(View view, boolean z) {
BankingAgentSelectedFragment.d(this.b);
}
{
this.b = this;
}
});
AmountEditText amountEditText4 = this.amountText;
if (amountEditText4 != null) {
amountEditText = amountEditText4;
} else {
C14957gcv.a("");
}
amountEditText.setOnHandleDismissKeyboardListener(this.c);
return inflate;
}
/* loaded from: classes5.dex */
public static final class Sts implements AmountEditText.RVV {
private BankingAgentSelectedFragment b;
Sts(BankingAgentSelectedFragment bankingAgentSelectedFragment) {
this.b = bankingAgentSelectedFragment;
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void b(double d) {
C2528agM c2528agM = this.b.presenter;
if (c2528agM == null) {
C14957gcv.a("");
c2528agM = null;
}
c2528agM.e(d);
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void a() {
this.b.aN_();
}
}
@Override // o.InterfaceC6625cYc.LWm
public final void d(String str, FE fe) {
ImageView imageView;
C14957gcv.e(str, "");
C14957gcv.e(fe, "");
TextView textView = this.agentName;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(fe.h);
AmountEditText amountEditText = this.amountText;
if (amountEditText == null) {
C14957gcv.a("");
amountEditText = null;
}
amountEditText.setHint(getString(R.string.banking_amount_max_min, fe.j, fe.g));
TextView textView2 = this.dailyLimitText;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setText(getString(gdZ.a(str, "D", true) ? R.string.banking_deposit_daily_limit : R.string.banking_withdrawal_daily_limit, fe.c));
TextView textView3 = this.feeText;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView3.setText(getString(gdZ.a(str, "D", true) ? R.string.banking_deposits_fee_text : R.string.banking_withdrawal_fee_text));
Context context = getContext();
if (context != null) {
Drawable drawable = nMh.getDrawable(context, R.drawable.biller_place_holder);
ImageView imageView2 = this.agentIcon;
if (imageView2 != null) {
imageView = imageView2;
} else {
C14957gcv.a("");
imageView = null;
}
C12891fKc.azg_(context, drawable, imageView, fe.b, context.getResources().getDimensionPixelOffset(R.dimen.f15212131165285), nMh.getColor(context, R.color.f3092131099816));
}
}
@Override // o.InterfaceC6625cYc.LWm
public final void e(String str) {
C14957gcv.e(str, "");
AmountEditText amountEditText = this.amountText;
TextView textView = null;
if (amountEditText == null) {
C14957gcv.a("");
amountEditText = null;
}
amountEditText.setInvalidAmount(true);
TextView textView2 = this.amountError;
if (textView2 != null) {
textView = textView2;
} else {
C14957gcv.a("");
}
textView.setVisibility(0);
textView.setText(getString(R.string.banking_amount_error_divisible_by, str));
}
@Override // o.InterfaceC6625cYc.LWm
public final void a(String str) {
C14957gcv.e(str, "");
TextView textView = this.amountNeedToBeDivisibleText;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setVisibility(0);
textView.setText(getString(R.string.banking_amount_need_to_be_divisible_by, str));
}
@Override // o.InterfaceC6625cYc.LWm
public final void b() {
String string;
AmountEditText amountEditText = this.amountText;
TextView textView = null;
if (amountEditText == null) {
C14957gcv.a("");
amountEditText = null;
}
amountEditText.setInvalidAmount(true);
TextView textView2 = this.amountError;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setVisibility(0);
TextView textView3 = this.amountError;
if (textView3 != null) {
textView = textView3;
} else {
C14957gcv.a("");
}
Bundle arguments = getArguments();
textView.setText(getString((arguments == null || (string = arguments.getString("com.scb.phone.EXTRA_POSTING_TYPE")) == null || !string.equals("D")) ? R.string.banking_amount_error_decimals_withdraw : R.string.banking_amount_error_decimals));
}
@Override // o.InterfaceC6625cYc.LWm
public final void d(String str, String str2) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
AmountEditText amountEditText = this.amountText;
TextView textView = null;
if (amountEditText == null) {
C14957gcv.a("");
amountEditText = null;
}
amountEditText.setInvalidAmount(true);
TextView textView2 = this.amountError;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setVisibility(0);
TextView textView3 = this.amountError;
if (textView3 != null) {
textView = textView3;
} else {
C14957gcv.a("");
}
textView.setText(getString(R.string.banking_amount_error_range, str, str2));
}
@Override // o.InterfaceC6625cYc.LWm
public final void a() {
AmountEditText amountEditText = this.amountText;
TextView textView = null;
if (amountEditText == null) {
C14957gcv.a("");
amountEditText = null;
}
amountEditText.setInvalidAmount(false);
TextView textView2 = this.amountError;
if (textView2 != null) {
textView = textView2;
} else {
C14957gcv.a("");
}
textView.setVisibility(8);
}
@Override // o.InterfaceC6625cYc.LWm
public final void a(double d2) {
HBt hBt = this.i;
if (hBt == null) {
C14957gcv.a("");
hBt = null;
}
hBt.c(d2);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroy() {
C2528agM c2528agM = this.presenter;
if (c2528agM == null) {
C14957gcv.a("");
c2528agM = null;
}
c2528agM.w_();
super.onDestroy();
}
public static /* synthetic */ void c(BankingAgentSelectedFragment bankingAgentSelectedFragment) {
C14957gcv.e(bankingAgentSelectedFragment, "");
AmountEditText amountEditText = bankingAgentSelectedFragment.amountText;
if (amountEditText == null) {
C14957gcv.a("");
amountEditText = null;
}
amountEditText.clearFocus();
}
public static /* synthetic */ void d(BankingAgentSelectedFragment bankingAgentSelectedFragment) {
C14957gcv.e(bankingAgentSelectedFragment, "");
AmountEditText amountEditText = bankingAgentSelectedFragment.amountText;
if (amountEditText != null) {
AmountEditText amountEditText2 = null;
if (amountEditText == null) {
C14957gcv.a("");
amountEditText = null;
}
Editable text = amountEditText.getText();
if (text == null || text.length() <= 0) {
return;
}
C2528agM c2528agM = bankingAgentSelectedFragment.presenter;
if (c2528agM == null) {
C14957gcv.a("");
c2528agM = null;
}
AmountEditText amountEditText3 = bankingAgentSelectedFragment.amountText;
if (amountEditText3 != null) {
amountEditText2 = amountEditText3;
} else {
C14957gcv.a("");
}
c2528agM.b(amountEditText2.e);
}
}
}