package com.scb.phone.view.fragment.ccrredemption.mileage; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.Spinner; import android.widget.SpinnerAdapter; import android.widget.TextView; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.ccrredemption.mileage.MileageAirlineMembershipDetailsActivity; import com.scb.phone.view.fragment.ccrredemption.mileage.MileageQuantitySelectionFragment; import o.C0469Hf; import o.C0471Hh; import o.C12075erP; import o.C16316nR; import o.C3175asZ; import o.InterfaceC13391fZD; import o.InterfaceC9036dcD; import o.InterfaceC9044dcL; import o.ZI; /* loaded from: classes5.dex */ public class MileageQuantitySelectionFragment extends Hilt_MileageQuantitySelectionFragment implements InterfaceC9036dcD { private Spinner c; private AdapterView.OnItemSelectedListener d = new AdapterView.OnItemSelectedListener(this) { // from class: com.scb.phone.view.fragment.ccrredemption.mileage.MileageQuantitySelectionFragment.2 private MileageQuantitySelectionFragment d; @Override // android.widget.AdapterView.OnItemSelectedListener public final void onNothingSelected(AdapterView adapterView) { } { this.d = this; } @Override // android.widget.AdapterView.OnItemSelectedListener public final void onItemSelected(AdapterView adapterView, View view, int i, long j) { this.d.h.setSelection(i); } }; private AdapterView.OnItemSelectedListener g = new AdapterView.OnItemSelectedListener(this) { // from class: com.scb.phone.view.fragment.ccrredemption.mileage.MileageQuantitySelectionFragment.5 private MileageQuantitySelectionFragment b; @Override // android.widget.AdapterView.OnItemSelectedListener public final void onNothingSelected(AdapterView adapterView) { } { this.b = this; } @Override // android.widget.AdapterView.OnItemSelectedListener public final void onItemSelected(AdapterView adapterView, View view, int i, long j) { this.b.c.setSelection(i); } }; private Spinner h; private C0471Hh j; @InterfaceC13391fZD public C3175asZ presenter; @BindView TextView txvPointsToMiles; @BindView ViewGroup vgMiles; @BindView ViewGroup vgPoints; @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559849, viewGroup, false); ButterKnife.c(this, inflate); C0471Hh c0471Hh = (C0471Hh) getActivity().getIntent().getParcelableExtra("com.scb.phone.presentation.view.activity.ccr_redemption.KEY_REWARD_PRODUCT_DTO"); this.j = c0471Hh; c0471Hh.n.y = new C16316nR(getResources()); this.presenter.e((C3175asZ) this); C3175asZ c3175asZ = this.presenter; final C0471Hh c0471Hh2 = this.j; ZI.IeS ieS = new ZI.IeS(c0471Hh2) { // from class: o.atc private C0471Hh c; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9036dcD) obj).e(this.c.n.d()); } { this.c = c0471Hh2; } }; if (c3175asZ.f != 0) { ieS.e(c3175asZ.f); } final int parseInt = Integer.parseInt(c0471Hh2.l.replace(",", "")) / c0471Hh2.n.q.intValue(); ZI.IeS ieS2 = new ZI.IeS(parseInt) { // from class: o.ata private int b; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9036dcD) obj).a(this.b); } { this.b = parseInt; } }; if (c3175asZ.f != 0) { ieS2.e(c3175asZ.f); } return inflate; } @Override // o.InterfaceC9036dcD public final void e(String str) { this.txvPointsToMiles.setText(str); } @Override // o.InterfaceC9036dcD public final void a(C0469Hf c0469Hf) { startActivityForResult(MileageAirlineMembershipDetailsActivity.ZO_(getActivity(), c0469Hf), 104); } /* JADX INFO: Access modifiers changed from: package-private */ @OnClick public void onNextClick() { C3175asZ c3175asZ = this.presenter; C0471Hh c0471Hh = this.j; int selectedItemPosition = this.c.getSelectedItemPosition(); String obj = this.c.getSelectedItem().toString(); String obj2 = this.h.getSelectedItem().toString(); final C0469Hf c0469Hf = new C0469Hf(); c0469Hf.b = c0471Hh.d; c0469Hf.e = c0471Hh.b; c0469Hf.j = c0471Hh.i; c0469Hf.f = c0471Hh.k; c0469Hf.h = c0471Hh.l; c0469Hf.i = c0471Hh.n; c0469Hf.a = selectedItemPosition + 1; c0469Hf.f8198o = obj; c0469Hf.k = obj2; c0469Hf.m = c0471Hh.n.u; ZI.IeS ieS = new ZI.IeS(c0469Hf) { // from class: o.ate private C0469Hf d; @Override // o.ZI.IeS public final void e(Object obj3) { ((InterfaceC9036dcD) obj3).a(this.d); } { this.d = c0469Hf; } }; if (c3175asZ.f != 0) { ieS.e(c3175asZ.f); } } @Override // o.InterfaceC9036dcD public final void a(int i) { this.c = (Spinner) this.vgMiles.findViewById(R.id.spinner); C12075erP c12075erP = new C12075erP(requireContext(), i); this.c.setAdapter((SpinnerAdapter) c12075erP); c12075erP.e = new InterfaceC9044dcL(this) { // from class: o.eKY private MileageQuantitySelectionFragment a; @Override // o.InterfaceC9044dcL public final String d(int i2) { return MileageQuantitySelectionFragment.b(this.a, i2); } { this.a = this; } }; this.c.setOnItemSelectedListener(this.d); this.h = (Spinner) this.vgPoints.findViewById(R.id.spinner); C12075erP c12075erP2 = new C12075erP(getActivity(), i); this.h.setAdapter((SpinnerAdapter) c12075erP2); c12075erP2.e = new InterfaceC9044dcL(this) { // from class: o.eLa private MileageQuantitySelectionFragment d; @Override // o.InterfaceC9044dcL public final String d(int i2) { return MileageQuantitySelectionFragment.e(this.d, i2); } { this.d = this; } }; this.h.setOnItemSelectedListener(this.g); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onActivityResult(int i, int i2, Intent intent) { if (i == 104 && intent != null) { getActivity().setResult(-1, intent); getActivity().finish(); } super.onActivityResult(i, i2, intent); } public static /* synthetic */ String b(MileageQuantitySelectionFragment mileageQuantitySelectionFragment, int i) { C3175asZ c3175asZ = mileageQuantitySelectionFragment.presenter; return C3175asZ.d(i, mileageQuantitySelectionFragment.j); } public static /* synthetic */ String e(MileageQuantitySelectionFragment mileageQuantitySelectionFragment, int i) { C3175asZ c3175asZ = mileageQuantitySelectionFragment.presenter; return C3175asZ.e(i, mileageQuantitySelectionFragment.j); } }