package o; import android.text.InputFilter; import android.text.method.DigitsKeyListener; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Spinner; import android.widget.SpinnerAdapter; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import com.scb.phone.view.adapter.easycash.viewholder.BusinessAndMaritalInfoHeaderViewHolder; import com.scb.phone.view.adapter.easycash.viewholder.BusinessAndMaritalInfoInputViewHolder; import com.scb.phone.view.adapter.easycash.viewholder.BusinessAndMaritalInfoNationalIdViewHolder; import com.scb.phone.view.adapter.easycash.viewholder.BusinessAndMaritalInfoRadioChoiceViewHolder; import com.scb.phone.view.adapter.easycash.viewholder.BusinessAndMaritalInfoSpouseSelectorViewHolder; import com.scb.phone.view.adapter.easycash.viewholder.BusinessAndMaritalInfoYearMonthSelectorViewHolder; import com.scb.phone.view.custom.common.CommonInputViewGroup; import com.scb.phone.view.custom.common.CustomEditText; import com.scb.phone.view.custom.easycash.CustomEasyCashSectionLabel; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import o.C12209etr; import o.fLJ; /* renamed from: o.etr, reason: case insensitive filesystem */ /* loaded from: classes5.dex */ public final class C12209etr extends RecyclerView.Sts { private final LWm a; public ArrayList e; /* renamed from: o.etr$LWm */ /* loaded from: classes5.dex */ public interface LWm { String a(String str); void a(); void b(); boolean b(C0620Kv c0620Kv); boolean b(C0625Kz c0625Kz); String c(String str); void d(); void d(String str); } public C12209etr(LWm lWm) { C14957gcv.e(lWm, ""); this.a = lWm; this.e = new ArrayList<>(); } /* renamed from: o.etr$RVV */ /* loaded from: classes5.dex */ public static final class RVV { private RVV() { } public /* synthetic */ RVV(byte b) { this(); } } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final int getItemViewType(int i) { AbstractC0624Ky abstractC0624Ky = this.e.get(i); if (abstractC0624Ky instanceof KB) { return 0; } if (abstractC0624Ky instanceof C0625Kz) { return 1; } if (abstractC0624Ky instanceof KE) { return 2; } if (abstractC0624Ky instanceof KD) { return 3; } if (abstractC0624Ky instanceof KC) { return 4; } if (abstractC0624Ky instanceof C0620Kv) { return 5; } return super.getItemViewType(i); } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final RecyclerView.zJl onCreateViewHolder(ViewGroup viewGroup, int i) { C14957gcv.e(viewGroup, ""); LayoutInflater from = LayoutInflater.from(viewGroup.getContext()); if (i == 1) { View inflate = from.inflate(com.scb.phone.R.layout.2131559082, viewGroup, false); C14957gcv.c(inflate, ""); return new BusinessAndMaritalInfoInputViewHolder(inflate); } if (i == 2) { View inflate2 = from.inflate(com.scb.phone.R.layout.2131559075, viewGroup, false); C14957gcv.c(inflate2, ""); return new BusinessAndMaritalInfoRadioChoiceViewHolder(inflate2); } if (i == 3) { View inflate3 = from.inflate(com.scb.phone.R.layout.2131559083, viewGroup, false); C14957gcv.c(inflate3, ""); return new BusinessAndMaritalInfoYearMonthSelectorViewHolder(inflate3); } if (i == 4) { View inflate4 = from.inflate(com.scb.phone.R.layout.2131559084, viewGroup, false); C14957gcv.c(inflate4, ""); return new BusinessAndMaritalInfoSpouseSelectorViewHolder(inflate4); } if (i == 5) { View inflate5 = from.inflate(com.scb.phone.R.layout.2131559082, viewGroup, false); C14957gcv.c(inflate5, ""); return new BusinessAndMaritalInfoNationalIdViewHolder(inflate5); } View inflate6 = from.inflate(com.scb.phone.R.layout.2131559081, viewGroup, false); C14957gcv.c(inflate6, ""); return new BusinessAndMaritalInfoHeaderViewHolder(inflate6); } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final void onBindViewHolder(RecyclerView.zJl zjl, int i) { Object obj; C14957gcv.e(zjl, ""); AbstractC0624Ky abstractC0624Ky = this.e.get(i); C14957gcv.c(abstractC0624Ky, ""); AbstractC0624Ky abstractC0624Ky2 = abstractC0624Ky; int itemViewType = getItemViewType(i); CustomEasyCashSectionLabel customEasyCashSectionLabel = null; CommonInputViewGroup commonInputViewGroup = null; CommonInputViewGroup commonInputViewGroup2 = null; CommonInputViewGroup commonInputViewGroup3 = null; CommonInputViewGroup commonInputViewGroup4 = null; if (itemViewType == 0) { KB kb = (KB) abstractC0624Ky2; C14957gcv.e(kb, ""); CustomEasyCashSectionLabel customEasyCashSectionLabel2 = ((BusinessAndMaritalInfoHeaderViewHolder) zjl).tvHeader; if (customEasyCashSectionLabel2 != null) { customEasyCashSectionLabel = customEasyCashSectionLabel2; } else { C14957gcv.a(""); } customEasyCashSectionLabel.setText(kb.e); return; } if (itemViewType == 1) { BusinessAndMaritalInfoInputViewHolder businessAndMaritalInfoInputViewHolder = (BusinessAndMaritalInfoInputViewHolder) zjl; C0625Kz c0625Kz = (C0625Kz) abstractC0624Ky2; LWm lWm = this.a; boolean c = c(i); C14957gcv.e(c0625Kz, ""); C14957gcv.e(lWm, ""); C14957gcv.e(c0625Kz, ""); businessAndMaritalInfoInputViewHolder.d = c0625Kz; C14957gcv.e(lWm, ""); businessAndMaritalInfoInputViewHolder.a = lWm; View view = businessAndMaritalInfoInputViewHolder.paddingBottom; if (view == null) { C14957gcv.a(""); view = null; } Integer num = c ? 0 : null; view.setVisibility(num != null ? num.intValue() : 8); CommonInputViewGroup commonInputViewGroup5 = businessAndMaritalInfoInputViewHolder.ivgInputField; if (commonInputViewGroup5 == null) { C14957gcv.a(""); commonInputViewGroup5 = null; } commonInputViewGroup5.b(); commonInputViewGroup5.setTitle(c0625Kz.e); commonInputViewGroup5.setHint(c0625Kz.j); commonInputViewGroup5.setErrorText(c0625Kz.a); CustomEditText customEditText = commonInputViewGroup5.mEditText; customEditText.setInputType(c0625Kz.c); customEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(c0625Kz.g)}); commonInputViewGroup5.setText(c0625Kz.h); BusinessAndMaritalInfoInputViewHolder.IeS ieS = businessAndMaritalInfoInputViewHolder.e; commonInputViewGroup5.mEditText.addTextChangedListener(ieS); commonInputViewGroup5.d.add(ieS); if (c0625Kz.d) { return; } LWm lWm2 = businessAndMaritalInfoInputViewHolder.a; if (lWm2 == null) { C14957gcv.a(""); lWm2 = null; } C0625Kz c0625Kz2 = businessAndMaritalInfoInputViewHolder.d; if (c0625Kz2 == null) { C14957gcv.a(""); c0625Kz2 = null; } if (lWm2.b(c0625Kz2)) { CommonInputViewGroup commonInputViewGroup6 = businessAndMaritalInfoInputViewHolder.ivgInputField; if (commonInputViewGroup6 != null) { commonInputViewGroup3 = commonInputViewGroup6; } else { C14957gcv.a(""); } commonInputViewGroup3.e(); return; } CommonInputViewGroup commonInputViewGroup7 = businessAndMaritalInfoInputViewHolder.ivgInputField; if (commonInputViewGroup7 != null) { commonInputViewGroup4 = commonInputViewGroup7; } else { C14957gcv.a(""); } commonInputViewGroup4.c(); return; } if (itemViewType == 2) { BusinessAndMaritalInfoRadioChoiceViewHolder businessAndMaritalInfoRadioChoiceViewHolder = (BusinessAndMaritalInfoRadioChoiceViewHolder) zjl; final KE ke = (KE) abstractC0624Ky2; final LWm lWm3 = this.a; boolean c2 = c(i); C14957gcv.e(ke, ""); C14957gcv.e(lWm3, ""); TextView textView = businessAndMaritalInfoRadioChoiceViewHolder.tvTitle; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(ke.e); final List list = ke.d; if (!list.isEmpty()) { int i2 = 0; for (Object obj2 : list) { if (i2 < 0) { throw new ArithmeticException("Index overflow has happened."); } KA ka = (KA) obj2; if (i2 == 0) { RadioButton radioButton = businessAndMaritalInfoRadioChoiceViewHolder.rbFirst; if (radioButton == null) { C14957gcv.a(""); radioButton = null; } radioButton.setText(ka.b); } else if (i2 == 1) { RadioButton radioButton2 = businessAndMaritalInfoRadioChoiceViewHolder.rbSecond; if (radioButton2 == null) { C14957gcv.a(""); radioButton2 = null; } radioButton2.setText(ka.b); } i2++; } } RadioGroup radioGroup = businessAndMaritalInfoRadioChoiceViewHolder.radioGroup; if (radioGroup == null) { C14957gcv.a(""); radioGroup = null; } radioGroup.setOnCheckedChangeListener(null); Iterator it = list.iterator(); while (true) { if (it.hasNext()) { obj = it.next(); if (C14957gcv.b((Object) ((KA) obj).a, (Object) ke.c)) { break; } } else { obj = null; break; } } C14957gcv.e(list, ""); int indexOf = list.indexOf(obj); if (indexOf == 0) { RadioGroup radioGroup2 = businessAndMaritalInfoRadioChoiceViewHolder.radioGroup; if (radioGroup2 == null) { C14957gcv.a(""); radioGroup2 = null; } radioGroup2.check(com.scb.phone.R.id.rb_first); } else if (indexOf == 1) { RadioGroup radioGroup3 = businessAndMaritalInfoRadioChoiceViewHolder.radioGroup; if (radioGroup3 == null) { C14957gcv.a(""); radioGroup3 = null; } radioGroup3.check(com.scb.phone.R.id.rb_second); } else { RadioGroup radioGroup4 = businessAndMaritalInfoRadioChoiceViewHolder.radioGroup; if (radioGroup4 == null) { C14957gcv.a(""); radioGroup4 = null; } radioGroup4.clearCheck(); } radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(list, ke, lWm3) { // from class: o.euh private List a; private C12209etr.LWm c; private KE e; @Override // android.widget.RadioGroup.OnCheckedChangeListener public final void onCheckedChanged(RadioGroup radioGroup5, int i3) { BusinessAndMaritalInfoRadioChoiceViewHolder.e(this.a, this.e, this.c, i3); } { this.a = list; this.e = ke; this.c = lWm3; } }); View view2 = businessAndMaritalInfoRadioChoiceViewHolder.paddingBottom; if (view2 == null) { C14957gcv.a(""); view2 = null; } Integer num2 = c2 ? 0 : null; view2.setVisibility(num2 != null ? num2.intValue() : 8); return; } if (itemViewType == 3) { ((BusinessAndMaritalInfoYearMonthSelectorViewHolder) zjl).c((KD) abstractC0624Ky2, this.a); return; } if (itemViewType == 4) { BusinessAndMaritalInfoSpouseSelectorViewHolder businessAndMaritalInfoSpouseSelectorViewHolder = (BusinessAndMaritalInfoSpouseSelectorViewHolder) zjl; KC kc = (KC) abstractC0624Ky2; LWm lWm4 = this.a; C14957gcv.e(kc, ""); C14957gcv.e(lWm4, ""); TextView textView2 = businessAndMaritalInfoSpouseSelectorViewHolder.tvTitle; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(kc.e); Spinner spinner = businessAndMaritalInfoSpouseSelectorViewHolder.spinnerSpouse; if (spinner == null) { C14957gcv.a(""); spinner = null; } spinner.setOnItemSelectedListener(null); ArrayList arrayList = new ArrayList(); arrayList.addAll(kc.d); String str = kc.a; arrayList.add(str != null ? str : ""); spinner.setAdapter((SpinnerAdapter) new BusinessAndMaritalInfoSpouseSelectorViewHolder.HBt(arrayList, kc, spinner.getContext())); int indexOf2 = kc.c.indexOf(kc.j); if (indexOf2 >= 0) { spinner.setSelection(indexOf2); } else { spinner.setSelection(spinner.getAdapter().getCount()); } spinner.setOnItemSelectedListener(new BusinessAndMaritalInfoSpouseSelectorViewHolder.RVV(kc, lWm4)); return; } if (itemViewType == 5) { final BusinessAndMaritalInfoNationalIdViewHolder businessAndMaritalInfoNationalIdViewHolder = (BusinessAndMaritalInfoNationalIdViewHolder) zjl; C0620Kv c0620Kv = (C0620Kv) abstractC0624Ky2; LWm lWm5 = this.a; C14957gcv.e(c0620Kv, ""); C14957gcv.e(lWm5, ""); C14957gcv.e(c0620Kv, ""); businessAndMaritalInfoNationalIdViewHolder.d = c0620Kv; C14957gcv.e(lWm5, ""); businessAndMaritalInfoNationalIdViewHolder.a = lWm5; View view3 = businessAndMaritalInfoNationalIdViewHolder.paddingBottom; if (view3 == null) { C14957gcv.a(""); view3 = null; } view3.setVisibility(8); CommonInputViewGroup commonInputViewGroup8 = businessAndMaritalInfoNationalIdViewHolder.ivgInputField; if (commonInputViewGroup8 == null) { C14957gcv.a(""); commonInputViewGroup8 = null; } commonInputViewGroup8.b(); commonInputViewGroup8.setTitle(c0620Kv.e); commonInputViewGroup8.setHint(c0620Kv.j); commonInputViewGroup8.setErrorText(c0620Kv.a); CustomEditText customEditText2 = commonInputViewGroup8.mEditText; customEditText2.setInputType(c0620Kv.h); customEditText2.setFilters(new InputFilter[]{new InputFilter.LengthFilter(c0620Kv.i)}); String str2 = c0620Kv.g; LWm lWm6 = businessAndMaritalInfoNationalIdViewHolder.a; if (lWm6 == null) { C14957gcv.a(""); lWm6 = null; } commonInputViewGroup8.setText(lWm6.a(str2)); commonInputViewGroup8.mEditText.setKeyListener(DigitsKeyListener.getInstance("0123456789-")); fLJ flj = new fLJ(commonInputViewGroup8.mEditText, "X-XXXX-XXXXX-XX-X", new fLJ.Sts(businessAndMaritalInfoNationalIdViewHolder) { // from class: o.eue private BusinessAndMaritalInfoNationalIdViewHolder a; @Override // o.fLJ.Sts public final String c(String str3) { return BusinessAndMaritalInfoNationalIdViewHolder.e(this.a, str3); } { this.a = businessAndMaritalInfoNationalIdViewHolder; } }); flj.b = businessAndMaritalInfoNationalIdViewHolder.c; fLJ flj2 = flj; commonInputViewGroup8.mEditText.addTextChangedListener(flj2); commonInputViewGroup8.d.add(flj2); if (c0620Kv.c) { return; } if (c0620Kv.d) { commonInputViewGroup8.c(); c0620Kv.d = false; return; } LWm lWm7 = businessAndMaritalInfoNationalIdViewHolder.a; if (lWm7 == null) { C14957gcv.a(""); lWm7 = null; } C0620Kv c0620Kv2 = businessAndMaritalInfoNationalIdViewHolder.d; if (c0620Kv2 == null) { C14957gcv.a(""); c0620Kv2 = null; } if (lWm7.b(c0620Kv2)) { CommonInputViewGroup commonInputViewGroup9 = businessAndMaritalInfoNationalIdViewHolder.ivgInputField; if (commonInputViewGroup9 != null) { commonInputViewGroup = commonInputViewGroup9; } else { C14957gcv.a(""); } commonInputViewGroup.e(); return; } CommonInputViewGroup commonInputViewGroup10 = businessAndMaritalInfoNationalIdViewHolder.ivgInputField; if (commonInputViewGroup10 != null) { commonInputViewGroup2 = commonInputViewGroup10; } else { C14957gcv.a(""); } commonInputViewGroup2.c(); } } private final boolean c(int i) { return i == getItemCount() - 1 || getItemViewType(i + 1) == 0; } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final int getItemCount() { return this.e.size(); } static { new RVV((byte) 0); } }