what-the-bank/sources/com/scb/phone/view/adapter/pointx/PaymentMethodCreditSelector...

239 lines
8.7 KiB
Java

package com.scb.phone.view.adapter.pointx;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
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.pointx.PaymentMethodCreditSelectorAdapter;
import java.util.ArrayList;
import o.C0367Fb;
import o.C12891fKc;
import o.C14957gcv;
import o.WYJ;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class PaymentMethodCreditSelectorAdapter extends WYJ {
public int a;
private final int b;
public int c;
private final Context d;
public RVV e;
private final ArrayList<C0367Fb> h;
private int j;
/* loaded from: classes5.dex */
public interface RVV {
void b(C0367Fb c0367Fb, int i);
}
/* loaded from: classes5.dex */
public final class ItemViewHolder_ViewBinding implements Unbinder {
private ItemViewHolder b;
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
this.b = itemViewHolder;
itemViewHolder.cardContainer = (ConstraintLayout) pyT.e(view, R.id.cs_layout_card_container, "field 'cardContainer'", ConstraintLayout.class);
itemViewHolder.cardAvailableCreditTextView = (TextView) pyT.e(view, R.id.tv_card_available_credit, "field 'cardAvailableCreditTextView'", TextView.class);
itemViewHolder.cardReferenceNameTextView = (TextView) pyT.e(view, R.id.tv_card_reference_name, "field 'cardReferenceNameTextView'", TextView.class);
itemViewHolder.cardLastNumberTextView = (TextView) pyT.e(view, R.id.tv_card_last_number, "field 'cardLastNumberTextView'", TextView.class);
itemViewHolder.cardArtImageView = (ImageView) pyT.e(view, R.id.image_card_art, "field 'cardArtImageView'", ImageView.class);
}
@Override // butterknife.Unbinder
public final void a() {
ItemViewHolder itemViewHolder = this.b;
if (itemViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.b = null;
itemViewHolder.cardContainer = null;
itemViewHolder.cardAvailableCreditTextView = null;
itemViewHolder.cardReferenceNameTextView = null;
itemViewHolder.cardLastNumberTextView = null;
itemViewHolder.cardArtImageView = null;
}
}
public PaymentMethodCreditSelectorAdapter(Context context, ArrayList<C0367Fb> arrayList) {
C14957gcv.e(context, "");
C14957gcv.e(arrayList, "");
this.d = context;
this.h = arrayList;
this.a = R.drawable.bg_white_rounded;
this.j = R.drawable.rounded_purple_view_pager;
}
@Override // o.WYJ
public final boolean isViewFromObject(View view, Object obj) {
C14957gcv.e(view, "");
C14957gcv.e(obj, "");
return C14957gcv.b(view, obj);
}
@Override // o.WYJ
public final int getCount() {
return this.h.size();
}
@Override // o.WYJ
public final void destroyItem(ViewGroup viewGroup, int i, Object obj) {
C14957gcv.e(viewGroup, "");
C14957gcv.e(obj, "");
if (obj instanceof View) {
viewGroup.removeView((View) obj);
}
}
@Override // o.WYJ
public final Object instantiateItem(ViewGroup viewGroup, final int i) {
C14957gcv.e(viewGroup, "");
C0367Fb c0367Fb = this.h.get(i);
C14957gcv.c(c0367Fb, "");
final C0367Fb c0367Fb2 = c0367Fb;
View inflate = LayoutInflater.from(this.d).inflate(R.layout.2131559089, viewGroup, false);
C14957gcv.c(inflate, "");
ItemViewHolder itemViewHolder = new ItemViewHolder(this, inflate);
ConstraintLayout constraintLayout = null;
if (this.c == i) {
ConstraintLayout constraintLayout2 = itemViewHolder.cardContainer;
if (constraintLayout2 == null) {
C14957gcv.a("");
constraintLayout2 = null;
}
constraintLayout2.setBackground(nMh.getDrawable(this.d, this.j));
TextView textView = itemViewHolder.cardReferenceNameTextView;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setTextColor(nMh.getColor(this.d, R.color.f2982131099805));
} else {
ConstraintLayout constraintLayout3 = itemViewHolder.cardContainer;
if (constraintLayout3 == null) {
C14957gcv.a("");
constraintLayout3 = null;
}
constraintLayout3.setBackground(nMh.getDrawable(this.d, this.a));
TextView textView2 = itemViewHolder.cardReferenceNameTextView;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setTextColor(nMh.getColor(this.d, R.color.f3092131099816));
}
C14957gcv.e(c0367Fb2, "");
TextView textView3 = itemViewHolder.cardAvailableCreditTextView;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView3.setText(c0367Fb2.d);
TextView textView4 = itemViewHolder.cardReferenceNameTextView;
if (textView4 == null) {
C14957gcv.a("");
textView4 = null;
}
textView4.setText(c0367Fb2.W);
TextView textView5 = itemViewHolder.cardLastNumberTextView;
if (textView5 == null) {
C14957gcv.a("");
textView5 = null;
}
textView5.setText(c0367Fb2.r);
String str = c0367Fb2.p;
if (str == null) {
str = "";
}
ImageView imageView = itemViewHolder.cardArtImageView;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
ItemViewHolder.anM_(str, imageView);
TextView textView6 = itemViewHolder.cardReferenceNameTextView;
if (textView6 == null) {
C14957gcv.a("");
textView6 = null;
}
textView6.setTag("TAG_ACCOUNT_SOURCE_ADAPTER_TEXT".concat(String.valueOf(i)));
ConstraintLayout constraintLayout4 = itemViewHolder.cardContainer;
if (constraintLayout4 != null) {
constraintLayout = constraintLayout4;
} else {
C14957gcv.a("");
}
constraintLayout.setTag("TAG_ACCOUNT_SOURCE_ADAPTER".concat(String.valueOf(i)));
final RVV rvv = this.e;
if (rvv != null) {
itemViewHolder.c.setOnClickListener(new View.OnClickListener(rvv, c0367Fb2, i) { // from class: o.exz
private C0367Fb a;
private PaymentMethodCreditSelectorAdapter.RVV b;
private int e;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
PaymentMethodCreditSelectorAdapter.d(this.b, this.a, this.e);
}
{
this.b = rvv;
this.a = c0367Fb2;
this.e = i;
}
});
}
viewGroup.addView(itemViewHolder.c, this.b);
return itemViewHolder.c;
}
/* loaded from: classes5.dex */
public final class ItemViewHolder extends RecyclerView.zJl {
final View c;
@BindView
public ImageView cardArtImageView;
@BindView
public TextView cardAvailableCreditTextView;
@BindView
public ConstraintLayout cardContainer;
@BindView
public TextView cardLastNumberTextView;
@BindView
public TextView cardReferenceNameTextView;
private PaymentMethodCreditSelectorAdapter e;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ItemViewHolder(PaymentMethodCreditSelectorAdapter paymentMethodCreditSelectorAdapter, View view) {
super(view);
C14957gcv.e(view, "");
this.e = paymentMethodCreditSelectorAdapter;
this.c = view;
ButterKnife.c(this, this.itemView);
}
static void anM_(String str, ImageView imageView) {
C12891fKc.azv_(str, R.drawable.default_card, R.drawable.default_card_without_logo, imageView);
}
}
public static /* synthetic */ void d(RVV rvv, C0367Fb c0367Fb, int i) {
C14957gcv.e(rvv, "");
C14957gcv.e(c0367Fb, "");
rvv.b(c0367Fb, i);
}
}