what-the-bank/sources/com/scb/phone/view/fragment/requesttopay/EnterProxyFragment.java

194 lines
6.8 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.requesttopay;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.FragmentActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.requesttopay.InputDetailsActivity;
import com.scb.phone.view.custom.common.CustomProxyNumber;
import com.scb.phone.view.custom.common.DefaultButton;
import o.C0531Iw;
import o.C1238Ys;
import o.C14787fzm;
import o.C15602gz;
import o.C5967cEk;
import o.EL;
import o.EnumC8951daY;
import o.InterfaceC12866fJj;
import o.InterfaceC13391fZD;
import o.InterfaceC8934daH;
import o.PWw;
import o.YF;
/* loaded from: classes5.dex */
public class EnterProxyFragment extends Hilt_EnterProxyFragment implements InterfaceC12866fJj, InterfaceC8934daH {
@BindView
DefaultButton buttonNext;
@BindView
protected CustomProxyNumber customProxyNumber;
@InterfaceC13391fZD
public C5967cEk presenter;
@Override // o.InterfaceC12866fJj
public final void bp_() {
}
public static EnterProxyFragment c(String str) {
EnterProxyFragment enterProxyFragment = new EnterProxyFragment();
Bundle bundle = new Bundle();
bundle.putString("source", str);
enterProxyFragment.setArguments(bundle);
return enterProxyFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559887, viewGroup, false);
ButterKnife.c(this, inflate);
this.presenter.e((C5967cEk) this);
super.aa();
Y();
Z();
u(getString(R.string.request_new_request));
this.customProxyNumber.setProxyLabel(getString(R.string.request_money_from));
this.customProxyNumber.setProxyHint(getString(R.string.request_to_pay_input_hint));
this.customProxyNumber.setProxyNumberFieldColor(R.color.f1852131099685);
this.customProxyNumber.setOnProxyNumberListener(this);
C14787fzm.a(this);
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment
public final void aa() {
super.aa();
Y();
Z();
u(getString(R.string.request_new_request));
}
@Override // o.InterfaceC12866fJj
public final void t_(String str) {
a(str);
}
private void a(String str) {
if (((Boolean) C15602gz.b(new Object[]{str}, -396693817, 396693819, (int) System.currentTimeMillis())).booleanValue()) {
if (C15602gz.a(str)) {
DefaultButton defaultButton = this.buttonNext;
if (defaultButton != null) {
defaultButton.setButtonEnabled(true);
}
this.customProxyNumber.setErrorValidationVisibility(8);
return;
}
this.customProxyNumber.setErrorInLine(R.string.error_prompt_pay_mobile_validation);
this.customProxyNumber.setErrorValidationVisibility(0);
return;
}
if (C15602gz.b(str)) {
if (C15602gz.b(str)) {
DefaultButton defaultButton2 = this.buttonNext;
if (defaultButton2 != null) {
defaultButton2.setButtonEnabled(true);
}
this.customProxyNumber.setErrorValidationVisibility(8);
return;
}
return;
}
this.customProxyNumber.setErrorInLine(R.string.error_prompt_pay_validation);
this.customProxyNumber.setErrorValidationVisibility(0);
}
@Override // o.InterfaceC12866fJj
public final void f() {
aN_();
}
@Override // o.InterfaceC12866fJj
public final void a(C0531Iw c0531Iw) {
PWw pWw = PWw.MOB;
if (c0531Iw instanceof C1238Ys) {
pWw = PWw.CID;
}
EL el = this.presenter.d;
YF yf = (YF) EL.b(c0531Iw, pWw);
a(yf.d);
if (C15602gz.a(yf.d) || C15602gz.b(yf.d)) {
Intent intent = new Intent(getContext(), (Class<?>) InputDetailsActivity.class);
intent.putExtra("EXTRA_PROXY_NUMBER", this.customProxyNumber.a());
intent.putExtra("EXTRA_PROXY_NAME", this.customProxyNumber.d());
startActivity(intent);
}
}
@Override // o.InterfaceC12866fJj
public final void d(String str) {
DefaultButton defaultButton;
if (!C15602gz.e(str) || (defaultButton = this.buttonNext) == null) {
return;
}
defaultButton.setButtonEnabled(true);
}
@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);
this.customProxyNumber.apo_(i, i2, intent);
}
@OnClick
public void onReviewButtonClick() {
a(this.customProxyNumber.a());
if (C15602gz.a(this.customProxyNumber.a()) || C15602gz.b(this.customProxyNumber.a())) {
Intent intent = new Intent(getContext(), (Class<?>) InputDetailsActivity.class);
intent.putExtra("source", Q());
intent.putExtra("EXTRA_PROXY_NUMBER", this.customProxyNumber.a());
intent.putExtra("EXTRA_PROXY_NAME", this.customProxyNumber.d());
startActivity(intent);
}
}
@Override // androidx.fragment.app.Fragment
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
C14787fzm.e(this, i, iArr);
}
public final void j() {
CustomProxyNumber customProxyNumber = this.customProxyNumber;
CustomProxyNumber.b(new Object[]{customProxyNumber}, -59289781, 59289781, System.identityHashCode(customProxyNumber));
}
public final void e(int i, EnumC8951daY enumC8951daY) {
FragmentActivity activity = getActivity();
if (activity != null) {
String string = getString(i);
if (getActivity() != null) {
BaseActivity.a(new Object[]{(BaseActivity) getActivity(), activity, Integer.valueOf(R.id.enter_proxy_view_container), string, enumC8951daY}, 855668825, -855668822, R.id.enter_proxy_view_container);
}
}
}
public final void g() {
CustomProxyNumber customProxyNumber = this.customProxyNumber;
if (customProxyNumber != null) {
customProxyNumber.setProxyNumber("");
}
DefaultButton defaultButton = this.buttonNext;
if (defaultButton != null) {
defaultButton.setEnabled(false);
}
}
}