package com.scb.phone.view.fragment.closeaccount; import android.os.Bundle; import android.text.Editable; import android.view.KeyEvent; 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 butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.closeaccount.CloseAccountReviewActivity; import com.scb.phone.view.custom.common.CommonInputViewGroup; import com.scb.phone.view.custom.common.CustomEditText; import com.scb.phone.view.fragment.closeaccount.CloseAccountSelectionOtherFragment; import java.util.Objects; import o.C0690Mh; import o.C12891fKc; import o.C3478ayM; import o.InterfaceC13391fZD; import o.InterfaceC9126ddo; import o.TPf; import o.ZI; import o.fJJ; import o.iyt; import o.nMh; import o.pug; import o.wRi; /* loaded from: classes5.dex */ public class CloseAccountSelectionOtherFragment extends Hilt_CloseAccountSelectionOtherFragment implements InterfaceC9126ddo { @BindView CommonInputViewGroup accountNumberInput; @BindView Button button; @BindView ImageView icon; @InterfaceC13391fZD public C3478ayM presenter; public static CloseAccountSelectionOtherFragment d() { return new CloseAccountSelectionOtherFragment(); } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559510, viewGroup, false); ButterKnife.c(this, inflate); this.presenter.e((C3478ayM) this); C12891fKc.azh_(nMh.getDrawable(getContext(), R.drawable.bankicon_scb), this.icon, R.drawable.bankicon_scb, getContext().getResources().getDimensionPixelOffset(R.dimen.f15212131165285)); CommonInputViewGroup commonInputViewGroup = this.accountNumberInput; fJJ fjj = new fJJ(this) { // from class: com.scb.phone.view.fragment.closeaccount.CloseAccountSelectionOtherFragment.2 private CloseAccountSelectionOtherFragment b; { this.b = this; } @Override // o.fJJ, android.text.TextWatcher public final void afterTextChanged(Editable editable) { C3478ayM c3478ayM = this.b.presenter; final String obj = editable.toString(); c3478ayM.a = obj; ZI.IeS ieS = new ZI.IeS(obj) { // from class: o.ayR private String a; @Override // o.ZI.IeS public final void e(Object obj2) { C3478ayM.a(this.a, (InterfaceC9126ddo) obj2); } { this.a = obj; } }; if (c3478ayM.f != 0) { ieS.e(c3478ayM.f); } } }; commonInputViewGroup.mEditText.addTextChangedListener(fjj); commonInputViewGroup.d.add(fjj); this.accountNumberInput.setErrorText(getString(R.string.incomplete_information)); final CommonInputViewGroup commonInputViewGroup2 = this.accountNumberInput; Objects.requireNonNull(commonInputViewGroup2); commonInputViewGroup2.setOnBackListener(new CustomEditText.LWm(commonInputViewGroup2) { // from class: o.eNo private CommonInputViewGroup d; @Override // com.scb.phone.view.custom.common.CustomEditText.LWm public final void a() { this.d.clearFocus(); } { this.d = commonInputViewGroup2; } }); this.accountNumberInput.setOnEditorActionListener(new TextView.OnEditorActionListener(this) { // from class: o.eNv private CloseAccountSelectionOtherFragment a; @Override // android.widget.TextView.OnEditorActionListener public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { return CloseAccountSelectionOtherFragment.e(this.a, i); } { this.a = this; } }); return inflate; } @Override // o.InterfaceC9126ddo public final void a(boolean z) { this.button.setEnabled(z); } @OnClick public void onButtonClick() { c("close_acct_input", new pug("subtype", "other scb")); C3478ayM c3478ayM = this.presenter; if (c3478ayM.f != 0) { c3478ayM.f.y(); } c3478ayM.e.c(c3478ayM.a, "3RD"); iyt iytVar = c3478ayM.e; iytVar.d(iytVar.i, new wRi.LWm(c3478ayM) { // from class: o.ayM.4 private C3478ayM e; { this.e = c3478ayM; } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final /* synthetic */ void onNext(Object obj) { C3478ayM.e(this.e); C3478ayM c3478ayM2 = this.e; ZI.IeS ieS = new ZI.IeS() { // from class: o.ayN @Override // o.ZI.IeS public final void e(Object obj2) { ((InterfaceC9126ddo) obj2).e(); } }; if (c3478ayM2.f != 0) { ieS.e(c3478ayM2.f); } } @Override // o.wRi.LWm, o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.e.i(th)) { return; } C3478ayM.c(this.e, th, C0690Mh.IeS.JUST_DISMISS); } }); } @Override // o.InterfaceC9126ddo public final void e(boolean z) { if (z) { this.accountNumberInput.c(); } else { this.accountNumberInput.e(); } } @Override // o.InterfaceC9126ddo public final void e() { CloseAccountReviewActivity.e(getContext(), "CLOSE_ACCOUNT_OTHERS_FRAGMENT"); c("close_acct_review", new pug("source", "select_receiving_account")); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { this.presenter.w_(); super.onDestroy(); } public static /* synthetic */ boolean e(CloseAccountSelectionOtherFragment closeAccountSelectionOtherFragment, int i) { if (i != 6) { return false; } closeAccountSelectionOtherFragment.button.setFocusable(true); closeAccountSelectionOtherFragment.button.setFocusableInTouchMode(true); closeAccountSelectionOtherFragment.button.requestFocus(); closeAccountSelectionOtherFragment.aN_(); return true; } }