package com.scb.phone.view.fragment.ntb.selectaccount; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.Spinner; import android.widget.SpinnerAdapter; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.BaseActivity; import java.util.List; import o.C14806gBo; import o.C6995cft; import o.InterfaceC13391fZD; import o.InterfaceC8954dab; import o.QKH; import o.ZI; import o.fIY; /* loaded from: classes5.dex */ public class SelectPurposeFragment extends Hilt_SelectPurposeFragment implements InterfaceC8954dab.vUG { private fIY.saX c; private InterfaceC8954dab.jbe d; @BindView Spinner purposeSpinner; @BindView protected Button selectButton; @InterfaceC13391fZD public C6995cft selectPurposePresenter; /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.ntb.selectaccount.Hilt_SelectPurposeFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public void onAttach(Context context) { super.onAttach(context); if (getParentFragment() instanceof fIY.saX) { this.c = (fIY.saX) getParentFragment(); } else if (context instanceof fIY.saX) { this.c = (fIY.saX) context; } if (context instanceof InterfaceC8954dab.jbe) { this.d = (InterfaceC8954dab.jbe) context; } } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { byte b = 0; View inflate = layoutInflater.inflate(R.layout.2131559911, viewGroup, false); ButterKnife.c(this, inflate); this.selectPurposePresenter.e((C6995cft) this); C6995cft c6995cft = this.selectPurposePresenter; ZI.IeS ieS = new ZI.IeS() { // from class: o.cfw @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8954dab.vUG) obj).e(); } }; if (c6995cft.f != 0) { ieS.e(c6995cft.f); } if (c6995cft.f != 0) { c6995cft.f.y(); } c6995cft.b.c(); C14806gBo c14806gBo = c6995cft.b; c14806gBo.d(c14806gBo.i, new C6995cft.Sts(c6995cft, b)); QKH qkh = new QKH(); InterfaceC8954dab.jbe jbeVar = this.d; if (jbeVar != null) { qkh.e(jbeVar.e()); } if (getActivity() != null) { qkh.c(((BaseActivity) getActivity()).scbAnalytics, "purpose_account_opening_screen"); } return inflate; } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { super.onDestroy(); this.selectPurposePresenter.w_(); } @Override // o.InterfaceC8954dab.vUG public final void e() { this.selectButton.setEnabled(false); } @Override // o.InterfaceC8954dab.vUG public final void a() { this.selectButton.setEnabled(true); } @Override // o.InterfaceC8954dab.vUG public final void d(String str) { this.c.e(str); } @Override // o.InterfaceC8954dab.vUG public final void d(List list) { this.purposeSpinner.setAdapter((SpinnerAdapter) new ArrayAdapter(getContext(), R.layout.2131559352, list)); this.purposeSpinner.setSelection(0); this.purposeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(this) { // from class: com.scb.phone.view.fragment.ntb.selectaccount.SelectPurposeFragment.2 private SelectPurposeFragment c; @Override // android.widget.AdapterView.OnItemSelectedListener public final void onNothingSelected(AdapterView adapterView) { } { this.c = this; } @Override // android.widget.AdapterView.OnItemSelectedListener public final void onItemSelected(AdapterView adapterView, View view, int i, long j) { C6995cft c6995cft = this.c.selectPurposePresenter; if (i < 0 || i >= c6995cft.d.size()) { return; } c6995cft.c = c6995cft.d.get(i); } }); } @OnClick public void onSelectClick() { final C6995cft c6995cft = this.selectPurposePresenter; ZI.IeS ieS = new ZI.IeS(c6995cft) { // from class: o.cfu private C6995cft e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8954dab.vUG) obj).d(this.e.c.e); } { this.e = c6995cft; } }; if (c6995cft.f != 0) { ieS.e(c6995cft.f); } } }