what-the-bank/sources/com/scb/phone/view/adapter/investment/assessment/RiskLevelsAdapter.java

175 lines
6.2 KiB
Java

package com.scb.phone.view.adapter.investment.assessment;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
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.investment.assessment.RiskLevelsAdapter;
import io.github.inflationx.calligraphy3.CalligraphyUtils;
import java.util.List;
import o.C0822Pf;
import o.C14957gcv;
import o.fIW;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class RiskLevelsAdapter extends RecyclerView.Sts<RiskLevelHolder> {
private final fIW<String> a;
private final List<C0822Pf> b;
private final fIW<Integer> d;
private int e;
/* loaded from: classes5.dex */
public final class RiskLevelHolder_ViewBinding implements Unbinder {
private RiskLevelHolder e;
public RiskLevelHolder_ViewBinding(RiskLevelHolder riskLevelHolder, View view) {
this.e = riskLevelHolder;
riskLevelHolder.tvTitle = (TextView) pyT.e(view, R.id.tv_title, "field 'tvTitle'", TextView.class);
riskLevelHolder.llLayoutContainer = pyT.a(view, R.id.ll_layout_container, "field 'llLayoutContainer'");
}
@Override // butterknife.Unbinder
public final void a() {
RiskLevelHolder riskLevelHolder = this.e;
if (riskLevelHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.e = null;
riskLevelHolder.tvTitle = null;
riskLevelHolder.llLayoutContainer = null;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ void onBindViewHolder(RiskLevelHolder riskLevelHolder, int i) {
final RiskLevelHolder riskLevelHolder2 = riskLevelHolder;
C14957gcv.e(riskLevelHolder2, "");
C0822Pf c0822Pf = this.b.get(i);
boolean z = i == this.e;
final fIW<Integer> fiw = this.d;
C14957gcv.e(c0822Pf, "");
C14957gcv.e(fiw, "");
Context context = riskLevelHolder2.itemView.getContext();
TextView textView = riskLevelHolder2.tvTitle;
TextView textView2 = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(c0822Pf.c);
View view = riskLevelHolder2.llLayoutContainer;
if (view == null) {
C14957gcv.a("");
view = null;
}
view.setBackgroundResource(z ? R.drawable.shape_purple_border_rounded_rectangle : R.drawable.shape_gray_rounded_rectangle);
riskLevelHolder2.itemView.setOnClickListener(new View.OnClickListener(fiw, riskLevelHolder2) { // from class: o.evk
private fIW c;
private RiskLevelsAdapter.RiskLevelHolder d;
@Override // android.view.View.OnClickListener
public final void onClick(View view2) {
RiskLevelsAdapter.RiskLevelHolder.a(this.c, this.d);
}
{
this.c = fiw;
this.d = riskLevelHolder2;
}
});
TextView textView3 = riskLevelHolder2.tvTitle;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView3.setTextColor(nMh.getColor(context, z ? R.color.f13682131100876 : R.color.f2982131099805));
TextView textView4 = riskLevelHolder2.tvTitle;
if (textView4 != null) {
textView2 = textView4;
} else {
C14957gcv.a("");
}
CalligraphyUtils.applyFontToTextView(context, textView2, z ? "fonts/db_heavent_medium.ttf" : "fonts/db_heavent_regular.ttf");
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ RiskLevelHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
C14957gcv.e(viewGroup, "");
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559217, viewGroup, false);
C14957gcv.c(inflate, "");
return new RiskLevelHolder(this, inflate);
}
public RiskLevelsAdapter(List<C0822Pf> list, fIW<String> fiw) {
C14957gcv.e(list, "");
C14957gcv.e(fiw, "");
this.b = list;
this.a = fiw;
setHasStableIds(true);
this.e = -1;
this.d = new fIW(this) { // from class: o.evi
private RiskLevelsAdapter b;
@Override // o.fIW
public final void a(Object obj) {
RiskLevelsAdapter.b(this.b, (Integer) obj);
}
{
this.b = this;
}
};
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
return this.b.size();
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final long getItemId(int i) {
return this.b.get(i).a != null ? r3.hashCode() : 0;
}
/* loaded from: classes5.dex */
public final class RiskLevelHolder extends RecyclerView.zJl {
private RiskLevelsAdapter c;
@BindView
public View llLayoutContainer;
@BindView
public TextView tvTitle;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RiskLevelHolder(RiskLevelsAdapter riskLevelsAdapter, View view) {
super(view);
C14957gcv.e(view, "");
this.c = riskLevelsAdapter;
ButterKnife.c(this, view);
}
public static /* synthetic */ void a(fIW fiw, RiskLevelHolder riskLevelHolder) {
C14957gcv.e(fiw, "");
C14957gcv.e(riskLevelHolder, "");
fiw.a(Integer.valueOf(riskLevelHolder.getAdapterPosition()));
}
}
public static /* synthetic */ void b(RiskLevelsAdapter riskLevelsAdapter, Integer num) {
C14957gcv.e(riskLevelsAdapter, "");
C14957gcv.c(num, "");
riskLevelsAdapter.e = num.intValue();
riskLevelsAdapter.notifyDataSetChanged();
riskLevelsAdapter.a.a(riskLevelsAdapter.b.get(riskLevelsAdapter.e).a);
}
}