package o; import android.content.Context; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.Spinner; import android.widget.SpinnerAdapter; import android.widget.TextView; import com.scb.phone.view.activity.mwpartner.MwBusinessDetailsActivity; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Objects; import o.PRA; import o.dXX; /* loaded from: classes5.dex */ public final class dXX extends BaseAdapter { private final String a; final IeS c; Context e; private final Sts f; private final ArrayAdapter g; final List b = new ArrayList(); public boolean d = false; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes5.dex */ public interface IeS { void e(T t); } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes5.dex */ public interface Sts { String a(T t); } @Override // android.widget.BaseAdapter, android.widget.ListAdapter public final boolean isEnabled(int i) { return i != 0; } public dXX(Context context, String str, Sts sts, IeS ieS) { ArrayAdapter arrayAdapter = new ArrayAdapter(this, context, context) { // from class: o.dXX.2 private Context c; private dXX e; { this.e = this; this.c = context; } @Override // android.widget.ArrayAdapter, android.widget.BaseAdapter, android.widget.SpinnerAdapter public final View getDropDownView(int i, View view, ViewGroup viewGroup) { View dropDownView = super.getDropDownView(i, view, viewGroup); TextView textView = (TextView) dropDownView; if (i == 0) { textView.setTextColor(-3553587); } else { textView.setTextColor(-13290951); } return dropDownView; } @Override // android.widget.ArrayAdapter, android.widget.Adapter public final View getView(int i, View view, ViewGroup viewGroup) { View view2 = super.getView(i, view, viewGroup); TextView textView = (TextView) view2; if (i == 0) { textView.setTextColor(-3553587); } else { textView.setTextColor(-13290951); } return view2; } }; this.g = arrayAdapter; arrayAdapter.setDropDownViewResource(com.scb.phone.R.layout.2131559352); this.a = str; this.f = sts; this.c = ieS; this.e = context; } public final void aif_(Spinner spinner) { this.g.addAll(this.a); spinner.setAdapter((SpinnerAdapter) this); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(this) { // from class: o.dXX.1 private dXX e; @Override // android.widget.AdapterView.OnItemSelectedListener public final void onNothingSelected(AdapterView adapterView) { } { this.e = this; } @Override // android.widget.AdapterView.OnItemSelectedListener public final void onItemSelected(AdapterView adapterView, View view, int i, long j) { if (this.e.c == null || i <= 0) { return; } this.e.c.e(this.e.b.get(i - 1)); } }); spinner.setOnTouchListener(new View.OnTouchListener(this) { // from class: o.dYb private dXX e; @Override // android.view.View.OnTouchListener public final boolean onTouch(View view, MotionEvent motionEvent) { dXX dxx = this.e; view.performClick(); dxx.d = true; ((MwBusinessDetailsActivity) dxx.e).aN_(); return false; } { this.e = this; } }); } public final void d(Collection collection) { this.b.clear(); this.b.addAll(collection); YKU yku = new YKU(this.b); final Sts sts = this.f; Objects.requireNonNull(sts); List list = (List) new YKU(yku.a, new wxK(yku.b, new InterfaceC1244Ytw(sts) { // from class: o.dXY private dXX.Sts a; @Override // o.InterfaceC1244Ytw public final Object d(Object obj) { return this.a.a(obj); } { this.a = sts; } })).a(new PRA.Sts(new PRA.AnonymousClass4(), new PRA.AnonymousClass8())); list.add(0, this.a); this.g.clear(); this.g.addAll(list); notifyDataSetChanged(); } @Override // android.widget.Adapter public final int getCount() { return this.g.getCount(); } @Override // android.widget.Adapter public final T getItem(int i) { return this.b.get(i); } @Override // android.widget.Adapter public final long getItemId(int i) { return this.g.getItemId(i); } @Override // android.widget.Adapter public final View getView(int i, View view, ViewGroup viewGroup) { return this.g.getView(i, view, viewGroup); } }