what-the-bank/sources/com/scb/phone/view/adapter/suitabilityassessment/QuestionnaireRecyclerViewAd...

221 lines
8.3 KiB
Java

package com.scb.phone.view.adapter.suitabilityassessment;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatRadioButton;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.scb.phone.R;
import com.scb.phone.view.adapter.suitabilityassessment.QuestionnaireRecyclerViewAdapter;
import java.util.Arrays;
import o.C0819Pd;
import o.C14957gcv;
import o.InterfaceC12867fJk;
import o.OW;
import o.OZ;
import o.gcH;
import o.pyT;
/* loaded from: classes5.dex */
public final class QuestionnaireRecyclerViewAdapter extends RecyclerView.Sts<QuestionnaireViewHolder> {
private final RVV c;
private final C0819Pd d;
private final InterfaceC12867fJk e;
/* loaded from: classes5.dex */
public interface LWm {
void e(int i, int i2);
}
/* loaded from: classes5.dex */
public final class QuestionnaireViewHolder_ViewBinding implements Unbinder {
private QuestionnaireViewHolder b;
public QuestionnaireViewHolder_ViewBinding(QuestionnaireViewHolder questionnaireViewHolder, View view) {
this.b = questionnaireViewHolder;
questionnaireViewHolder.tvQuestionNumber = (TextView) pyT.e(view, R.id.tv_question_number, "field 'tvQuestionNumber'", TextView.class);
questionnaireViewHolder.tvQuestionTitle = (TextView) pyT.e(view, R.id.tv_question_title, "field 'tvQuestionTitle'", TextView.class);
questionnaireViewHolder.rgAnswers = (RadioGroup) pyT.e(view, R.id.rg_answers, "field 'rgAnswers'", RadioGroup.class);
}
@Override // butterknife.Unbinder
public final void a() {
QuestionnaireViewHolder questionnaireViewHolder = this.b;
if (questionnaireViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.b = null;
questionnaireViewHolder.tvQuestionNumber = null;
questionnaireViewHolder.tvQuestionTitle = null;
questionnaireViewHolder.rgAnswers = null;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ void onBindViewHolder(QuestionnaireViewHolder questionnaireViewHolder, final int i) {
QuestionnaireViewHolder questionnaireViewHolder2 = questionnaireViewHolder;
C14957gcv.e(questionnaireViewHolder2, "");
OZ oz = this.d.c.get(i);
final RVV rvv = this.c;
C14957gcv.e(oz, "");
C14957gcv.e(rvv, "");
TextView textView = questionnaireViewHolder2.tvQuestionNumber;
RadioGroup radioGroup = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
gcH gch = gcH.d;
String string = questionnaireViewHolder2.itemView.getContext().getString(R.string.full_stop);
C14957gcv.c((Object) string, "");
String format = String.format(string, Arrays.copyOf(new Object[]{Integer.valueOf(oz.c)}, 1));
C14957gcv.c((Object) format, "");
textView.setText(format);
TextView textView2 = questionnaireViewHolder2.tvQuestionTitle;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setText(oz.b);
RadioGroup radioGroup2 = questionnaireViewHolder2.rgAnswers;
if (radioGroup2 == null) {
C14957gcv.a("");
radioGroup2 = null;
}
radioGroup2.removeAllViews();
int i2 = 0;
int i3 = -1;
for (Object obj : oz.e) {
if (i2 >= 0) {
OW ow = (OW) obj;
AppCompatRadioButton appCompatRadioButton = new AppCompatRadioButton(questionnaireViewHolder2.itemView.getContext(), null, R.attr.questionnaireRadioButtonStyle);
appCompatRadioButton.setId(i2);
appCompatRadioButton.setText(ow.a);
appCompatRadioButton.setTypeface(Typeface.createFromAsset(questionnaireViewHolder2.itemView.getContext().getAssets(), "fonts/PSL001Pro.ttf"));
if (ow.b) {
i3 = appCompatRadioButton.getId();
}
RadioGroup radioGroup3 = questionnaireViewHolder2.rgAnswers;
if (radioGroup3 == null) {
C14957gcv.a("");
radioGroup3 = null;
}
radioGroup3.addView(appCompatRadioButton);
i2++;
} else {
throw new ArithmeticException("Index overflow has happened.");
}
}
if (i3 != -1) {
RadioGroup radioGroup4 = questionnaireViewHolder2.rgAnswers;
if (radioGroup4 == null) {
C14957gcv.a("");
radioGroup4 = null;
}
radioGroup4.check(i3);
}
RadioGroup radioGroup5 = questionnaireViewHolder2.rgAnswers;
if (radioGroup5 != null) {
radioGroup = radioGroup5;
} else {
C14957gcv.a("");
}
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(rvv, i) { // from class: o.ezd
private int c;
private QuestionnaireRecyclerViewAdapter.LWm e;
@Override // android.widget.RadioGroup.OnCheckedChangeListener
public final void onCheckedChanged(RadioGroup radioGroup6, int i4) {
QuestionnaireRecyclerViewAdapter.QuestionnaireViewHolder.d(this.e, this.c, i4);
}
{
this.e = rvv;
this.c = i;
}
});
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ QuestionnaireViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
C14957gcv.e(viewGroup, "");
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559313, viewGroup, false);
C14957gcv.c(inflate, "");
return new QuestionnaireViewHolder(this, inflate);
}
public QuestionnaireRecyclerViewAdapter(C0819Pd c0819Pd, InterfaceC12867fJk interfaceC12867fJk) {
C14957gcv.e(c0819Pd, "");
C14957gcv.e(interfaceC12867fJk, "");
this.d = c0819Pd;
this.e = interfaceC12867fJk;
setHasStableIds(true);
this.c = new RVV(this);
}
/* loaded from: classes5.dex */
public static final class RVV implements LWm {
private QuestionnaireRecyclerViewAdapter d;
RVV(QuestionnaireRecyclerViewAdapter questionnaireRecyclerViewAdapter) {
this.d = questionnaireRecyclerViewAdapter;
}
@Override // com.scb.phone.view.adapter.suitabilityassessment.QuestionnaireRecyclerViewAdapter.LWm
public final void e(int i, int i2) {
int i3 = 0;
for (Object obj : this.d.d.c.get(i).e) {
if (i3 < 0) {
throw new ArithmeticException("Index overflow has happened.");
}
((OW) obj).b = i3 == i2;
i3++;
}
this.d.e.b(this.d.d);
}
}
/* loaded from: classes5.dex */
public final class QuestionnaireViewHolder extends RecyclerView.zJl {
private QuestionnaireRecyclerViewAdapter a;
@BindView
public RadioGroup rgAnswers;
@BindView
public TextView tvQuestionNumber;
@BindView
public TextView tvQuestionTitle;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public QuestionnaireViewHolder(QuestionnaireRecyclerViewAdapter questionnaireRecyclerViewAdapter, View view) {
super(view);
C14957gcv.e(view, "");
this.a = questionnaireRecyclerViewAdapter;
ButterKnife.c(this, view);
}
public static /* synthetic */ void d(LWm lWm, int i, int i2) {
C14957gcv.e(lWm, "");
lWm.e(i, i2);
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
return this.d.c.size();
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final long getItemId(int i) {
return this.d.c.get(i).c;
}
}