package com.scb.phone.view.fragment.hml.promptpay; import android.content.Context; 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.ImageView; import android.widget.TextView; import androidx.fragment.app.FragmentActivity; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.activity.BaseActivity; import com.scb.phone.view.activity.hml.HmlNTBOccupationInfoActivity; import com.scb.phone.view.activity.hml.promptpay.HmlPromptPayAboutActivity; import com.scb.phone.view.custom.common.CustomEditText; import com.scb.phone.view.custom.hml.CustomDecimalAmountVerification; import com.scb.phone.view.fragment.hml.promptpay.HmlPromptpayEnterCodeFragment; import kotlin.NoWhenBranchMatchedException; import o.AbstractC13163fSk; import o.C0571Jsh; import o.C14866gag; import o.C14957gcv; import o.C5655bxE; import o.EnumC8951daY; import o.InterfaceC13391fZD; import o.InterfaceC9315dhS; import o.ZI; /* loaded from: classes5.dex */ public final class HmlPromptpayEnterCodeFragment extends Hilt_HmlPromptpayEnterCodeFragment implements InterfaceC9315dhS { public static final HBt c = new HBt(0); @BindView public ImageView aboutImg; @BindView public TextView errorText; @BindView public CustomDecimalAmountVerification firstCode; @InterfaceC13391fZD public C5655bxE presenter; @BindView public CustomDecimalAmountVerification secondCode; @BindView public CustomDecimalAmountVerification thirdCode; @BindView public Button verifyBtn; /* loaded from: classes5.dex */ public static final class HBt { private HBt() { } public /* synthetic */ HBt(byte b) { this(); } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); View inflate = layoutInflater.inflate(R.layout.2131559841, viewGroup, false); ButterKnife.c(this, inflate); C5655bxE c5655bxE = this.presenter; C5655bxE c5655bxE2 = null; if (c5655bxE == null) { C14957gcv.a(""); c5655bxE = null; } c5655bxE.e((C5655bxE) this); C5655bxE c5655bxE3 = this.presenter; if (c5655bxE3 != null) { c5655bxE2 = c5655bxE3; } else { C14957gcv.a(""); } ZI.IeS ieS = new ZI.IeS() { // from class: o.bxN @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9315dhS) obj).a(); } }; if (c5655bxE2.f != 0) { ieS.e(c5655bxE2.f); } return inflate; } @Override // o.InterfaceC9315dhS public final void a() { C5655bxE.IeS ieS = C5655bxE.IeS.FIRST; CustomDecimalAmountVerification customDecimalAmountVerification = this.firstCode; Button button = null; if (customDecimalAmountVerification == null) { C14957gcv.a(""); customDecimalAmountVerification = null; } CustomDecimalAmountVerification customDecimalAmountVerification2 = this.secondCode; if (customDecimalAmountVerification2 == null) { C14957gcv.a(""); customDecimalAmountVerification2 = null; } customDecimalAmountVerification.setInputCodeListener(new LWm(this, ieS, customDecimalAmountVerification2, customDecimalAmountVerification)); C5655bxE.IeS ieS2 = C5655bxE.IeS.SECOND; CustomDecimalAmountVerification customDecimalAmountVerification3 = this.secondCode; if (customDecimalAmountVerification3 == null) { C14957gcv.a(""); customDecimalAmountVerification3 = null; } CustomDecimalAmountVerification customDecimalAmountVerification4 = this.thirdCode; if (customDecimalAmountVerification4 == null) { C14957gcv.a(""); customDecimalAmountVerification4 = null; } customDecimalAmountVerification3.setInputCodeListener(new LWm(this, ieS2, customDecimalAmountVerification4, customDecimalAmountVerification3)); C5655bxE.IeS ieS3 = C5655bxE.IeS.THIRD; CustomDecimalAmountVerification customDecimalAmountVerification5 = this.thirdCode; if (customDecimalAmountVerification5 == null) { C14957gcv.a(""); customDecimalAmountVerification5 = null; } customDecimalAmountVerification5.setInputCodeListener(new LWm(this, ieS3, null, customDecimalAmountVerification5)); ImageView imageView = this.aboutImg; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setOnClickListener(new View.OnClickListener(this) { // from class: o.feV private HmlPromptpayEnterCodeFragment a; @Override // android.view.View.OnClickListener public final void onClick(View view) { HmlPromptpayEnterCodeFragment.d(this.a); } { this.a = this; } }); Button button2 = this.verifyBtn; if (button2 != null) { button = button2; } else { C14957gcv.a(""); } button.setOnClickListener(new View.OnClickListener(this) { // from class: o.feX private HmlPromptpayEnterCodeFragment b; @Override // android.view.View.OnClickListener public final void onClick(View view) { HmlPromptpayEnterCodeFragment.c(this.b); } { this.b = this; } }); } /* loaded from: classes5.dex */ public static final class LWm implements CustomDecimalAmountVerification.IeS { private HmlPromptpayEnterCodeFragment b; private C5655bxE.IeS c; private CustomDecimalAmountVerification d; private CustomDecimalAmountVerification e; LWm(HmlPromptpayEnterCodeFragment hmlPromptpayEnterCodeFragment, C5655bxE.IeS ieS, CustomDecimalAmountVerification customDecimalAmountVerification, CustomDecimalAmountVerification customDecimalAmountVerification2) { this.b = hmlPromptpayEnterCodeFragment; this.c = ieS; this.e = customDecimalAmountVerification; this.d = customDecimalAmountVerification2; } @Override // com.scb.phone.view.custom.hml.CustomDecimalAmountVerification.IeS public final void d(String str, boolean z) { CustomDecimalAmountVerification customDecimalAmountVerification; C14957gcv.e(str, ""); C5655bxE c5655bxE = this.b.presenter; CustomEditText customEditText = null; if (c5655bxE == null) { C14957gcv.a(""); c5655bxE = null; } C5655bxE.IeS ieS = this.c; C14957gcv.e(ieS, ""); C14957gcv.e(str, ""); int i = C5655bxE.Sts.d[ieS.ordinal()]; if (i == 1) { c5655bxE.a = str; C14866gag c14866gag = C14866gag.c; } else if (i == 2) { c5655bxE.e = str; C14866gag c14866gag2 = C14866gag.c; } else { if (i != 3) { throw new NoWhenBranchMatchedException(); } c5655bxE.d = str; C14866gag c14866gag3 = C14866gag.c; } if (z) { c5655bxE.b(); } if (!z || (customDecimalAmountVerification = this.e) == null) { return; } CustomEditText customEditText2 = customDecimalAmountVerification.editText; if (customEditText2 != null) { customEditText = customEditText2; } else { C14957gcv.a(""); } customEditText.requestFocus(); } @Override // com.scb.phone.view.custom.hml.CustomDecimalAmountVerification.IeS public final void c() { C5655bxE c5655bxE = this.b.presenter; if (c5655bxE == null) { C14957gcv.a(""); c5655bxE = null; } C5655bxE.IeS ieS = this.c; C14957gcv.e(ieS, ""); c5655bxE.c = ieS; this.d.c(false); HmlPromptpayEnterCodeFragment hmlPromptpayEnterCodeFragment = this.b; if (hmlPromptpayEnterCodeFragment.getActivity() == null || !hmlPromptpayEnterCodeFragment.isAdded()) { return; } ((BaseActivity) hmlPromptpayEnterCodeFragment.getActivity()).ag(); } @Override // com.scb.phone.view.custom.hml.CustomDecimalAmountVerification.IeS public final void e(boolean z) { String str; if (z) { return; } C5655bxE c5655bxE = this.b.presenter; if (c5655bxE == null) { C14957gcv.a(""); c5655bxE = null; } C5655bxE.IeS ieS = this.c; C14957gcv.e(ieS, ""); int i = C5655bxE.Sts.d[ieS.ordinal()]; if (i == 1) { String str2 = c5655bxE.a; if (str2 == null || str2 == null || str2.length() != 2) { ZI.IeS ieS2 = new ZI.IeS() { // from class: o.bxG @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9315dhS) obj).e(true, C5655bxE.IeS.FIRST); } }; if (c5655bxE.f != 0) { ieS2.e(c5655bxE.f); } } } else if (i != 2) { if (i == 3 && ((str = c5655bxE.d) == null || str == null || str.length() != 2)) { ZI.IeS ieS3 = new ZI.IeS() { // from class: o.bxD @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9315dhS) obj).e(true, C5655bxE.IeS.THIRD); } }; if (c5655bxE.f != 0) { ieS3.e(c5655bxE.f); } } } else { String str3 = c5655bxE.e; if (str3 == null || str3 == null || str3.length() != 2) { ZI.IeS ieS4 = new ZI.IeS() { // from class: o.bxH @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9315dhS) obj).e(true, C5655bxE.IeS.SECOND); } }; if (c5655bxE.f != 0) { ieS4.e(c5655bxE.f); } } } ZI.IeS ieS5 = new ZI.IeS() { // from class: o.bxM @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9315dhS) obj).e(true); } }; if (c5655bxE.f != 0) { ieS5.e(c5655bxE.f); } } @Override // com.scb.phone.view.custom.hml.CustomDecimalAmountVerification.IeS public final void d() { ImageView imageView = this.b.aboutImg; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.requestFocus(); this.b.aN_(); C5655bxE c5655bxE = this.b.presenter; if (c5655bxE == null) { C14957gcv.a(""); c5655bxE = null; } if (c5655bxE.a == null) { c5655bxE.a = ""; } if (c5655bxE.e == null) { c5655bxE.e = ""; } if (c5655bxE.d == null) { c5655bxE.d = ""; } c5655bxE.c = null; c5655bxE.b(); } } @Override // o.InterfaceC9315dhS public final void e(boolean z, C5655bxE.IeS ieS) { C14957gcv.e(ieS, ""); int i = RVV.d[ieS.ordinal()]; CustomDecimalAmountVerification customDecimalAmountVerification = null; if (i == 1) { CustomDecimalAmountVerification customDecimalAmountVerification2 = this.firstCode; if (customDecimalAmountVerification2 != null) { customDecimalAmountVerification = customDecimalAmountVerification2; } else { C14957gcv.a(""); } customDecimalAmountVerification.c(z); return; } if (i == 2) { CustomDecimalAmountVerification customDecimalAmountVerification3 = this.secondCode; if (customDecimalAmountVerification3 != null) { customDecimalAmountVerification = customDecimalAmountVerification3; } else { C14957gcv.a(""); } customDecimalAmountVerification.c(z); return; } if (i != 3) { throw new NoWhenBranchMatchedException(); } CustomDecimalAmountVerification customDecimalAmountVerification4 = this.thirdCode; if (customDecimalAmountVerification4 != null) { customDecimalAmountVerification = customDecimalAmountVerification4; } else { C14957gcv.a(""); } customDecimalAmountVerification.c(z); } @Override // o.InterfaceC9315dhS public final void e(boolean z) { TextView textView = this.errorText; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setVisibility(z ? 0 : 8); } @Override // o.InterfaceC9315dhS public final void c(boolean z) { Button button = this.verifyBtn; if (button == null) { C14957gcv.a(""); button = null; } button.setEnabled(z); } @Override // o.InterfaceC9315dhS public final void d() { HmlNTBOccupationInfoActivity.RVV rvv = HmlNTBOccupationInfoActivity.b; Context requireContext = requireContext(); C14957gcv.c(requireContext, ""); C14957gcv.e(requireContext, ""); startActivity(new Intent(requireContext, (Class) HmlNTBOccupationInfoActivity.class)); C14866gag c14866gag = C14866gag.c; FragmentActivity activity = getActivity(); if (activity != null) { activity.finish(); } } @Override // o.InterfaceC9315dhS public final void b() { HmlPromptPayAboutActivity.RVV rvv = HmlPromptPayAboutActivity.k; Context requireContext = requireContext(); C14957gcv.c(requireContext, ""); C14957gcv.e(requireContext, ""); startActivity(new Intent(requireContext, (Class) HmlPromptPayAboutActivity.class)); } @Override // o.InterfaceC9315dhS public final void e() { FragmentActivity requireActivity = requireActivity(); String string = getString(R.string.hml_promptpay_verification_snackbar_incorrect); EnumC8951daY enumC8951daY = EnumC8951daY.ERROR; if (getActivity() != null) { BaseActivity.a(new Object[]{(BaseActivity) getActivity(), requireActivity, Integer.valueOf(R.id.view_group_root), string, enumC8951daY}, 855668825, -855668822, R.id.view_group_root); } } @Override // o.InterfaceC9315dhS public final void c() { FragmentActivity requireActivity = requireActivity(); String string = getString(R.string.hml_promptpay_verification_snackbar_expired); EnumC8951daY enumC8951daY = EnumC8951daY.ERROR; if (getActivity() != null) { BaseActivity.a(new Object[]{(BaseActivity) getActivity(), requireActivity, Integer.valueOf(R.id.view_group_root), string, enumC8951daY}, 855668825, -855668822, R.id.view_group_root); } } @Override // o.InterfaceC9315dhS public final void f() { FragmentActivity requireActivity = requireActivity(); String string = getString(R.string.hml_promptpay_verification_snackbar_max_attemp); EnumC8951daY enumC8951daY = EnumC8951daY.ERROR; if (getActivity() != null) { BaseActivity.a(new Object[]{(BaseActivity) getActivity(), requireActivity, Integer.valueOf(R.id.view_group_root), string, enumC8951daY}, 855668825, -855668822, R.id.view_group_root); } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C5655bxE c5655bxE = this.presenter; if (c5655bxE == null) { C14957gcv.a(""); c5655bxE = null; } c5655bxE.w_(); super.onDestroy(); } public static /* synthetic */ void d(HmlPromptpayEnterCodeFragment hmlPromptpayEnterCodeFragment) { C14957gcv.e(hmlPromptpayEnterCodeFragment, ""); C5655bxE c5655bxE = hmlPromptpayEnterCodeFragment.presenter; if (c5655bxE == null) { C14957gcv.a(""); c5655bxE = null; } ZI.IeS ieS = new ZI.IeS() { // from class: o.bxJ @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9315dhS) obj).b(); } }; if (c5655bxE.f != 0) { ieS.e(c5655bxE.f); } } public static /* synthetic */ void c(HmlPromptpayEnterCodeFragment hmlPromptpayEnterCodeFragment) { C14957gcv.e(hmlPromptpayEnterCodeFragment, ""); C5655bxE c5655bxE = hmlPromptpayEnterCodeFragment.presenter; if (c5655bxE == null) { C14957gcv.a(""); c5655bxE = null; } C0571Jsh c0571Jsh = c5655bxE.b; String str = c5655bxE.a; C14957gcv.e(str); String concat = "0.".concat(String.valueOf(str)); String str2 = c5655bxE.e; C14957gcv.e(str2); String concat2 = "0.".concat(String.valueOf(str2)); String str3 = c5655bxE.d; C14957gcv.e(str3); AbstractC13163fSk d = c0571Jsh.d(new String[]{concat, concat2, "0.".concat(String.valueOf(str3))}); if (c5655bxE.f != 0) { c5655bxE.f.y(); } c5655bxE.b.d(d, new C5655bxE.LWm(c5655bxE)); } /* loaded from: classes5.dex */ public final /* synthetic */ class RVV { public static final int[] d; static { int[] iArr = new int[C5655bxE.IeS.values().length]; try { iArr[C5655bxE.IeS.FIRST.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { iArr[C5655bxE.IeS.SECOND.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { iArr[C5655bxE.IeS.THIRD.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } d = iArr; } } }