what-the-bank/sources/com/scb/phone/view/adapter/transferandpay/BillerAdapter.java

226 lines
8.3 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.adapter.transferandpay;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.GridLayoutManager;
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.transferandpay.BillerAdapter;
import java.util.List;
import o.AbstractC1181Xh;
import o.C1193Xr;
import o.C1226Yl;
import o.C12891fKc;
import o.InterfaceC12823fIP;
import o.InterfaceC12824fIT;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class BillerAdapter extends RecyclerView.Sts<ItemViewHolder> {
private Drawable a;
public boolean b;
public InterfaceC12823fIP c;
public List<AbstractC1181Xh> d;
public RecyclerView.tOB e;
private InterfaceC12824fIT g;
private Context i;
@FunctionalInterface
/* loaded from: classes5.dex */
public interface Sts {
void c();
}
/* loaded from: classes5.dex */
public class ItemViewHolder_ViewBinding implements Unbinder {
private ItemViewHolder d;
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
this.d = itemViewHolder;
itemViewHolder.gridLayout = (ConstraintLayout) pyT.e(view, R.id.biller_grid_layout, "field 'gridLayout'", ConstraintLayout.class);
itemViewHolder.listLayout = (RelativeLayout) pyT.e(view, R.id.biller_list_layout, "field 'listLayout'", RelativeLayout.class);
itemViewHolder.tvTempBlock = (TextView) pyT.e(view, R.id.tv_temp_block, "field 'tvTempBlock'", TextView.class);
itemViewHolder.name = (TextView) pyT.e(view, R.id.biller_name_text_view, "field 'name'", TextView.class);
itemViewHolder.avatar = (ImageView) pyT.e(view, R.id.biller_avatar_image_view, "field 'avatar'", ImageView.class);
itemViewHolder.nameList = (TextView) pyT.e(view, R.id.biller_name_text_view_list, "field 'nameList'", TextView.class);
itemViewHolder.codeList = (TextView) pyT.e(view, R.id.biller_code_text_view_list, "field 'codeList'", TextView.class);
itemViewHolder.avatarList = (ImageView) pyT.e(view, R.id.biller_avatar_image_view_list, "field 'avatarList'", ImageView.class);
}
@Override // butterknife.Unbinder
public final void a() {
ItemViewHolder itemViewHolder = this.d;
if (itemViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.d = null;
itemViewHolder.gridLayout = null;
itemViewHolder.listLayout = null;
itemViewHolder.tvTempBlock = null;
itemViewHolder.name = null;
itemViewHolder.avatar = null;
itemViewHolder.nameList = null;
itemViewHolder.codeList = null;
itemViewHolder.avatarList = null;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ void onBindViewHolder(ItemViewHolder itemViewHolder, final int i) {
ItemViewHolder itemViewHolder2 = itemViewHolder;
AbstractC1181Xh abstractC1181Xh = this.d.get(i);
C12891fKc.azg_(this.i, this.a, itemViewHolder2.avatar, abstractC1181Xh.c(), this.i.getResources().getDimensionPixelOffset(R.dimen.f15222131165286), nMh.getColor(this.i, R.color.f3412131099849));
itemViewHolder2.name.setText(abstractC1181Xh.e());
itemViewHolder2.itemView.setOnClickListener(new View.OnClickListener(this, i) { // from class: o.ezv
private BillerAdapter c;
private int d;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
BillerAdapter.c(this.c, this.d);
}
{
this.c = this;
this.d = i;
}
});
C12891fKc.azg_(this.i, this.a, itemViewHolder2.avatarList, abstractC1181Xh.c(), this.i.getResources().getDimensionPixelOffset(R.dimen.f15222131165286), nMh.getColor(this.i, R.color.f3412131099849));
itemViewHolder2.nameList.setText(abstractC1181Xh.e());
if (abstractC1181Xh instanceof C1193Xr) {
C1193Xr c1193Xr = (C1193Xr) abstractC1181Xh;
if ("".equals(c1193Xr.f8453o)) {
itemViewHolder2.codeList.setText(this.i.getString(R.string.biller_ac, c1193Xr.g));
} else {
itemViewHolder2.codeList.setText(c1193Xr.h);
}
} else if (abstractC1181Xh instanceof C1226Yl) {
if (((C1226Yl) abstractC1181Xh).g) {
itemViewHolder2.avatar.setAlpha(0.5f);
itemViewHolder2.tvTempBlock.setVisibility(0);
itemViewHolder2.itemView.setOnClickListener(new View.OnClickListener(this) { // from class: o.ezu
private BillerAdapter d;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
BillerAdapter.b(this.d);
}
{
this.d = this;
}
});
} else {
itemViewHolder2.avatar.setAlpha(1.0f);
itemViewHolder2.tvTempBlock.setVisibility(8);
}
}
if (this.b) {
itemViewHolder2.gridLayout.setVisibility(0);
itemViewHolder2.listLayout.setVisibility(8);
} else {
itemViewHolder2.gridLayout.setVisibility(8);
itemViewHolder2.listLayout.setVisibility(0);
}
}
public BillerAdapter(Context context, List<AbstractC1181Xh> list, InterfaceC12824fIT interfaceC12824fIT) {
this.i = context;
this.d = list;
this.g = interfaceC12824fIT;
this.a = nMh.getDrawable(context, R.drawable.biller_place_holder);
this.b = false;
RecyclerView.tOB tob = this.e;
if (tob == null || (tob instanceof GridLayoutManager)) {
this.b = true;
}
}
public static void a(Sts sts) {
sts.c();
}
public final AbstractC1181Xh a(int i) {
List<AbstractC1181Xh> list = this.d;
if (list == null || list.isEmpty()) {
return null;
}
return this.d.get(i);
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
return this.d.size();
}
/* loaded from: classes5.dex */
class ItemViewHolder extends RecyclerView.zJl {
private BillerAdapter a;
@BindView
ImageView avatar;
@BindView
ImageView avatarList;
private boolean c;
@BindView
TextView codeList;
private View e;
@BindView
ConstraintLayout gridLayout;
@BindView
RelativeLayout listLayout;
@BindView
TextView name;
@BindView
TextView nameList;
@BindView
TextView tvTempBlock;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
ItemViewHolder(BillerAdapter billerAdapter, View view, boolean z) {
super(view);
this.a = billerAdapter;
this.c = z;
this.e = view;
ButterKnife.c(this, view);
}
}
public static /* synthetic */ void b(BillerAdapter billerAdapter) {
InterfaceC12823fIP interfaceC12823fIP = billerAdapter.c;
if (interfaceC12823fIP != null) {
interfaceC12823fIP.h();
}
}
public static /* synthetic */ void c(BillerAdapter billerAdapter, int i) {
InterfaceC12824fIT interfaceC12824fIT = billerAdapter.g;
if (interfaceC12824fIT != null) {
interfaceC12824fIT.a(i);
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ ItemViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
return new ItemViewHolder(this, LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559071, viewGroup, false), this.b);
}
}