what-the-bank/sources/com/scb/phone/view/fragment/pointx/PointXPaymentOptionPointWit...

529 lines
19 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.pointx;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.scb.phone.R;
import com.scb.phone.view.custom.common.CustomEditText;
import com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment;
import com.scb.phone.view.fragment.pointx.PointXPaymentOptionPointWithMoneyFragment;
import com.scb.phone.view.fragment.pointx.PointXPointPurchaseFragment;
import java.util.ArrayList;
import java.util.Arrays;
import o.C0367Fb;
import o.C1202Xx;
import o.C14957gcv;
import o.C6583cXR;
import o.C7290clW;
import o.C7293clZ;
import o.C7359cmm;
import o.C7364cmr;
import o.InterfaceC13391fZD;
import o.InterfaceC16541pFg;
import o.InterfaceC9541dlg;
import o.InterfaceC9547dlm;
import o.TZ;
import o.WW;
import o.ZI;
import o.gcH;
import o.gcV;
import o.gdZ;
import o.nMh;
/* loaded from: classes5.dex */
public final class PointXPaymentOptionPointWithMoneyFragment extends Hilt_PointXPaymentOptionPointWithMoneyFragment implements InterfaceC9541dlg, PointXPointPurchaseFragment.Sts {
public static final RVV d = new RVV(0);
@InterfaceC13391fZD
public C7290clW pointWithMoneyPresenter;
/* loaded from: classes5.dex */
public static final class RVV {
private RVV() {
}
public /* synthetic */ RVV(byte b) {
this();
}
}
@Override // com.scb.phone.view.fragment.pointx.Hilt_PointXPaymentOptionPointWithMoneyFragment, 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 PointXPaymentOptionFragment.Sts) {
InterfaceC16541pFg parentFragment = getParentFragment();
C14957gcv.d(parentFragment, "");
b((PointXPaymentOptionFragment.Sts) parentFragment);
}
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void C() {
C7290clW c7290clW = this.pointWithMoneyPresenter;
if (c7290clW == null) {
C14957gcv.a("");
c7290clW = null;
}
c7290clW.e((C7290clW) this);
final CustomEditText customEditText = s().d;
customEditText.clearFocus();
customEditText.setOnBackListener(new CustomEditText.LWm(customEditText) { // from class: o.fsv
private CustomEditText d;
@Override // com.scb.phone.view.custom.common.CustomEditText.LWm
public final void a() {
PointXPaymentOptionPointWithMoneyFragment.a(this.d);
}
{
this.d = customEditText;
}
});
customEditText.addTextChangedListener(new IeS(customEditText, this));
customEditText.setOnEditorActionListener(new TextView.OnEditorActionListener(this) { // from class: o.fsu
private PointXPaymentOptionPointWithMoneyFragment a;
@Override // android.widget.TextView.OnEditorActionListener
public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
return PointXPaymentOptionPointWithMoneyFragment.d(this.a, i);
}
{
this.a = this;
}
});
customEditText.setOnFocusChangeListener(new View.OnFocusChangeListener(this, customEditText) { // from class: o.fsA
private PointXPaymentOptionPointWithMoneyFragment b;
private CustomEditText c;
@Override // android.view.View.OnFocusChangeListener
public final void onFocusChange(View view, boolean z) {
PointXPaymentOptionPointWithMoneyFragment.d(this.b, this.c, z);
}
{
this.b = this;
this.c = customEditText;
}
});
}
/* loaded from: classes5.dex */
public static final class IeS implements TextWatcher {
private PointXPaymentOptionPointWithMoneyFragment d;
private CustomEditText e;
@Override // android.text.TextWatcher
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
IeS(CustomEditText customEditText, PointXPaymentOptionPointWithMoneyFragment pointXPaymentOptionPointWithMoneyFragment) {
this.e = customEditText;
this.d = pointXPaymentOptionPointWithMoneyFragment;
}
@Override // android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
IeS ieS = this;
this.e.removeTextChangedListener(ieS);
String a = gdZ.a(gdZ.b((CharSequence) String.valueOf(editable)).toString(), ",", "");
C7290clW c7290clW = this.d.pointWithMoneyPresenter;
if (c7290clW == null) {
C14957gcv.a("");
c7290clW = null;
}
c7290clW.e(a);
this.e.addTextChangedListener(ieS);
}
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void D() {
InterfaceC16541pFg parentFragment = getParentFragment();
if (parentFragment == null || !(parentFragment instanceof InterfaceC9547dlm.HBt)) {
return;
}
C7293clZ c7293clZ = this.presenter;
if (c7293clZ == null) {
C14957gcv.a("");
c7293clZ = null;
}
c7293clZ.D = ((InterfaceC9547dlm.HBt) parentFragment).l();
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void E() {
gcV s = s();
s.d.setEnabled(false);
LinearLayout linearLayout = s.j;
C14957gcv.c(linearLayout, "");
LinearLayout linearLayout2 = linearLayout;
C14957gcv.e(linearLayout2, "");
linearLayout2.setVisibility(8);
LinearLayout linearLayout3 = s.n;
C14957gcv.c(linearLayout3, "");
LinearLayout linearLayout4 = linearLayout3;
C14957gcv.e(linearLayout4, "");
linearLayout4.setVisibility(8);
TextView textView = s.p;
C14957gcv.c(textView, "");
TextView textView2 = textView;
C14957gcv.e(textView2, "");
textView2.setVisibility(8);
LinearLayout linearLayout5 = s.b;
C14957gcv.c(linearLayout5, "");
LinearLayout linearLayout6 = linearLayout5;
C14957gcv.e(linearLayout6, "");
linearLayout6.setVisibility(0);
s.t.setText(getString(R.string.pay_with_hybrid_point_insufficient_other));
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void z() {
gcV s = s();
s.d.setEnabled(false);
LinearLayout linearLayout = s.m;
C14957gcv.c(linearLayout, "");
LinearLayout linearLayout2 = linearLayout;
C14957gcv.e(linearLayout2, "");
linearLayout2.setVisibility(8);
ConstraintLayout constraintLayout = s.a;
C14957gcv.c(constraintLayout, "");
ConstraintLayout constraintLayout2 = constraintLayout;
C14957gcv.e(constraintLayout2, "");
constraintLayout2.setVisibility(0);
LinearLayout linearLayout3 = s.i;
C14957gcv.c(linearLayout3, "");
LinearLayout linearLayout4 = linearLayout3;
C14957gcv.e(linearLayout4, "");
linearLayout4.setVisibility(8);
TextView textView = s.l;
C14957gcv.c(textView, "");
TextView textView2 = textView;
C14957gcv.e(textView2, "");
textView2.setVisibility(8);
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void a(double d2) {
TextView textView = s().z;
C14957gcv.c(textView, "");
TextView textView2 = textView;
C14957gcv.e(textView2, "");
textView2.setVisibility(0);
textView.getPaint().setShader(null);
gcH gch = gcH.d;
String string = getString(R.string.point_exchange_rate);
C14957gcv.c((Object) string, "");
String format = String.format(string, Arrays.copyOf(new Object[]{(String) C6583cXR.c(new Object[]{Double.valueOf(d2)}, 1329802197, -1329802186, (int) System.currentTimeMillis())}, 1));
C14957gcv.c((Object) format, "");
textView.setText(format);
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void b(double d2) {
TextView textView = s().z;
C14957gcv.c(textView, "");
TextView textView2 = textView;
C14957gcv.e(textView2, "");
textView2.setVisibility(0);
textView.getPaint().setShader(new LinearGradient(1.0f, 1.0f, textView.getMeasuredWidth(), textView.getTextSize(), new int[]{nMh.getColor(requireContext(), R.color.f2902131099797), nMh.getColor(requireContext(), R.color.f2892131099796), nMh.getColor(requireContext(), R.color.f2882131099795)}, (float[]) null, Shader.TileMode.CLAMP));
gcH gch = gcH.d;
String string = getString(R.string.point_event_exchange_rate);
C14957gcv.c((Object) string, "");
String format = String.format(string, Arrays.copyOf(new Object[]{(String) C6583cXR.c(new Object[]{Double.valueOf(d2)}, 1329802197, -1329802186, (int) System.currentTimeMillis())}, 1));
C14957gcv.c((Object) format, "");
textView.setText(format);
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void I() {
gcV s = s();
TextView textView = s.z;
C14957gcv.c(textView, "");
TextView textView2 = textView;
C14957gcv.e(textView2, "");
textView2.setVisibility(8);
s.d.setEnabled(false);
}
@Override // o.InterfaceC12863fJg
public final void d(double d2) {
C7293clZ c7293clZ = this.presenter;
if (c7293clZ == null) {
C14957gcv.a("");
c7293clZ = null;
}
c7293clZ.a = d2;
C7359cmm c7359cmm = new C7359cmm(c7293clZ);
if (c7293clZ.f != 0) {
c7359cmm.e(c7293clZ.f);
}
}
@Override // o.InterfaceC9541dlg
public final void a(final int i) {
final C7293clZ c7293clZ = this.presenter;
if (c7293clZ == null) {
C14957gcv.a("");
c7293clZ = null;
}
ZI.IeS ieS = new ZI.IeS(c7293clZ, i) { // from class: o.cmB
private int c;
private C7293clZ d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C7293clZ.d(this.d, this.c, (InterfaceC9536dlb) obj);
}
{
this.d = c7293clZ;
this.c = i;
}
};
if (c7293clZ.f != 0) {
ieS.e(c7293clZ.f);
}
}
@Override // o.InterfaceC9541dlg
public final void e(String str) {
C14957gcv.e(str, "");
CustomEditText customEditText = s().d;
customEditText.setText(str);
Editable text = customEditText.getText();
if (text != null) {
customEditText.setSelection(text.length());
}
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void F() {
C7290clW c7290clW = this.pointWithMoneyPresenter;
C7293clZ c7293clZ = null;
if (c7290clW == null) {
C14957gcv.a("");
c7290clW = null;
}
C7293clZ c7293clZ2 = this.presenter;
if (c7293clZ2 != null) {
c7293clZ = c7293clZ2;
} else {
C14957gcv.a("");
}
c7290clW.a(c7293clZ.x);
}
@Override // o.InterfaceC9541dlg
public final void c() {
s().d.setEnabled(false);
}
@Override // o.InterfaceC9541dlg
public final void b() {
gcV s = s();
s.B.setText("");
s.u.setText("");
LinearLayout linearLayout = s.b;
C14957gcv.c(linearLayout, "");
LinearLayout linearLayout2 = linearLayout;
C14957gcv.e(linearLayout2, "");
linearLayout2.setVisibility(8);
TextView textView = s.p;
C14957gcv.c(textView, "");
TextView textView2 = textView;
C14957gcv.e(textView2, "");
textView2.setVisibility(8);
CustomEditText customEditText = s.d;
customEditText.setText("");
customEditText.setBackgroundTintList(ColorStateList.valueOf(nMh.getColor(customEditText.getContext(), R.color.f13772131100885)));
}
@Override // o.InterfaceC9541dlg
public final void e() {
s().d.setText("");
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void a(boolean z, WW ww, C0367Fb c0367Fb, String str, String str2) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
PointXPaymentOptionFragment.Sts B = B();
if (B != null) {
B.b(z, ww, c0367Fb, str, str2);
}
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void d(boolean z, boolean z2, ArrayList<WW> arrayList, ArrayList<C0367Fb> arrayList2) {
C14957gcv.e(arrayList, "");
C14957gcv.e(arrayList2, "");
PointXPaymentOptionFragment.Sts B = B();
if (B != null) {
B.e(z, z2, arrayList, arrayList2);
}
}
@Override // o.InterfaceC12863fJg
public final void b(boolean z, WW ww, C0367Fb c0367Fb, String str, String str2) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
C7293clZ c7293clZ = this.presenter;
if (c7293clZ == null) {
C14957gcv.a("");
c7293clZ = null;
}
c7293clZ.c(z, ww, c0367Fb, str, str2);
}
@Override // o.InterfaceC12863fJg
public final void a(boolean z, boolean z2, ArrayList<WW> arrayList, ArrayList<C0367Fb> arrayList2) {
C14957gcv.e(arrayList, "");
C14957gcv.e(arrayList2, "");
C7293clZ c7293clZ = this.presenter;
if (c7293clZ == null) {
C14957gcv.a("");
c7293clZ = null;
}
c7293clZ.d(z, z2, arrayList, arrayList2);
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void d(boolean z, String str, C1202Xx c1202Xx, String str2) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
PointXPaymentOptionFragment.Sts B = B();
if (B != null) {
B.e(z, str, c1202Xx);
B.n(str2);
}
}
@Override // o.InterfaceC9541dlg
public final void d() {
C7293clZ c7293clZ = this.presenter;
if (c7293clZ == null) {
C14957gcv.a("");
c7293clZ = null;
}
C7364cmr c7364cmr = new C7364cmr(c7293clZ);
if (c7293clZ.f != 0) {
c7364cmr.e(c7293clZ.f);
}
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void a(boolean z, boolean z2, double d2, int i, double d3, double d4, boolean z3, WW ww, C0367Fb c0367Fb, boolean z4, boolean z5, double d5, String str) {
C14957gcv.e(str, "");
C7290clW c7290clW = this.pointWithMoneyPresenter;
if (c7290clW == null) {
C14957gcv.a("");
c7290clW = null;
}
c7290clW.b(z, z2, d2, i, d3, d4, z3, ww, c0367Fb, z4, z5, d5, str);
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void G() {
PointXPaymentOptionFragment.Sts B = B();
if (B != null) {
B.I();
}
}
@Override // o.InterfaceC9541dlg
public final void b(TZ tz) {
C14957gcv.e(tz, "");
C7293clZ c7293clZ = this.presenter;
if (c7293clZ == null) {
C14957gcv.a("");
c7293clZ = null;
}
PointXPaymentOptionFragment.Sts B = B();
if (B != null) {
B.e(c7293clZ.w, c7293clZ.h, tz);
}
}
@Override // o.InterfaceC9541dlg
public final void a() {
PointXPaymentOptionFragment.Sts B = B();
if (B != null) {
C7293clZ c7293clZ = this.presenter;
if (c7293clZ == null) {
C14957gcv.a("");
c7293clZ = null;
}
B.e(c7293clZ.w, false, (TZ) null);
}
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroyView() {
C7290clW c7290clW = this.pointWithMoneyPresenter;
if (c7290clW == null) {
C14957gcv.a("");
c7290clW = null;
}
c7290clW.w_();
super.onDestroyView();
}
public static /* synthetic */ void a(CustomEditText customEditText) {
C14957gcv.e(customEditText, "");
customEditText.clearFocus();
}
public static /* synthetic */ void d(PointXPaymentOptionPointWithMoneyFragment pointXPaymentOptionPointWithMoneyFragment, CustomEditText customEditText, boolean z) {
C14957gcv.e(pointXPaymentOptionPointWithMoneyFragment, "");
C14957gcv.e(customEditText, "");
if (!z) {
C7290clW c7290clW = pointXPaymentOptionPointWithMoneyFragment.pointWithMoneyPresenter;
if (c7290clW == null) {
C14957gcv.a("");
c7290clW = null;
}
c7290clW.c(String.valueOf(customEditText.getText()));
return;
}
if (pointXPaymentOptionPointWithMoneyFragment.w()) {
return;
}
customEditText.setBackgroundTintList(ColorStateList.valueOf(nMh.getColor(customEditText.getContext(), R.color.f2112131099717)));
}
public static /* synthetic */ boolean d(PointXPaymentOptionPointWithMoneyFragment pointXPaymentOptionPointWithMoneyFragment, int i) {
C14957gcv.e(pointXPaymentOptionPointWithMoneyFragment, "");
if (i != 5 && i != 6) {
return false;
}
pointXPaymentOptionPointWithMoneyFragment.aN_();
pointXPaymentOptionPointWithMoneyFragment.s().d.clearFocus();
return true;
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void H() {
s().d.setEnabled(false);
}
@Override // com.scb.phone.view.fragment.pointx.PointXPaymentOptionFragment
public final void K() {
s().d.setEnabled(false);
}
}