what-the-bank/sources/com/scb/phone/view/adapter/bankingagent/BankingAgentAdapter.java

224 lines
8.5 KiB
Java

package com.scb.phone.view.adapter.bankingagent;
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.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.scb.phone.R;
import com.scb.phone.view.adapter.bankingagent.BankingAgentAdapter;
import java.util.List;
import o.C12891fKc;
import o.C14957gcv;
import o.FE;
import o.InterfaceC12824fIT;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class BankingAgentAdapter extends RecyclerView.Sts<ItemViewHolder> {
private final Context a;
public List<FE> b;
private final Drawable c;
private RecyclerView.tOB d;
private boolean e;
private final InterfaceC12824fIT i;
/* loaded from: classes5.dex */
public final class ItemViewHolder_ViewBinding implements Unbinder {
private ItemViewHolder e;
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
this.e = itemViewHolder;
itemViewHolder.gridLayout = (RelativeLayout) pyT.e(view, R.id.agent_grid_layout, "field 'gridLayout'", RelativeLayout.class);
itemViewHolder.listLayout = (RelativeLayout) pyT.e(view, R.id.agent_list_layout, "field 'listLayout'", RelativeLayout.class);
itemViewHolder.name = (TextView) pyT.e(view, R.id.agent_name_text_view, "field 'name'", TextView.class);
itemViewHolder.avatar = (ImageView) pyT.e(view, R.id.agent_avatar_image_view, "field 'avatar'", ImageView.class);
itemViewHolder.nameList = (TextView) pyT.e(view, R.id.agent_name_text_view_list, "field 'nameList'", TextView.class);
itemViewHolder.codeList = (TextView) pyT.e(view, R.id.agent_code_text_view_list, "field 'codeList'", TextView.class);
itemViewHolder.avatarList = (ImageView) pyT.e(view, R.id.agent_avatar_image_view_list, "field 'avatarList'", ImageView.class);
}
@Override // butterknife.Unbinder
public final void a() {
ItemViewHolder itemViewHolder = this.e;
if (itemViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.e = null;
itemViewHolder.gridLayout = null;
itemViewHolder.listLayout = 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, int i) {
ImageView imageView;
ImageView imageView2;
final ItemViewHolder itemViewHolder2 = itemViewHolder;
C14957gcv.e(itemViewHolder2, "");
FE fe = this.b.get(i);
C14957gcv.e(fe, "");
Context context = itemViewHolder2.c.a;
Drawable drawable = itemViewHolder2.c.c;
ImageView imageView3 = itemViewHolder2.avatar;
RelativeLayout relativeLayout = null;
if (imageView3 != null) {
imageView = imageView3;
} else {
C14957gcv.a("");
imageView = null;
}
C12891fKc.azg_(context, drawable, imageView, fe.b, itemViewHolder2.c.a.getResources().getDimensionPixelOffset(R.dimen.f15212131165285), nMh.getColor(itemViewHolder2.c.a, R.color.f3412131099849));
TextView textView = itemViewHolder2.name;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(fe.h);
View view = itemViewHolder2.itemView;
final BankingAgentAdapter bankingAgentAdapter = itemViewHolder2.c;
view.setOnClickListener(new View.OnClickListener(bankingAgentAdapter, itemViewHolder2) { // from class: o.erh
private BankingAgentAdapter.ItemViewHolder a;
private BankingAgentAdapter c;
@Override // android.view.View.OnClickListener
public final void onClick(View view2) {
BankingAgentAdapter.ItemViewHolder.d(this.c, this.a);
}
{
this.c = bankingAgentAdapter;
this.a = itemViewHolder2;
}
});
Context context2 = itemViewHolder2.c.a;
Drawable drawable2 = itemViewHolder2.c.c;
ImageView imageView4 = itemViewHolder2.avatarList;
if (imageView4 != null) {
imageView2 = imageView4;
} else {
C14957gcv.a("");
imageView2 = null;
}
C12891fKc.azg_(context2, drawable2, imageView2, fe.b, itemViewHolder2.c.a.getResources().getDimensionPixelOffset(R.dimen.f15252131165289), nMh.getColor(itemViewHolder2.c.a, R.color.f3412131099849));
TextView textView2 = itemViewHolder2.nameList;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setText(fe.h);
if (itemViewHolder2.d) {
RelativeLayout relativeLayout2 = itemViewHolder2.gridLayout;
if (relativeLayout2 == null) {
C14957gcv.a("");
relativeLayout2 = null;
}
relativeLayout2.setVisibility(0);
RelativeLayout relativeLayout3 = itemViewHolder2.listLayout;
if (relativeLayout3 != null) {
relativeLayout = relativeLayout3;
} else {
C14957gcv.a("");
}
relativeLayout.setVisibility(8);
return;
}
RelativeLayout relativeLayout4 = itemViewHolder2.gridLayout;
if (relativeLayout4 == null) {
C14957gcv.a("");
relativeLayout4 = null;
}
relativeLayout4.setVisibility(8);
RelativeLayout relativeLayout5 = itemViewHolder2.listLayout;
if (relativeLayout5 != null) {
relativeLayout = relativeLayout5;
} else {
C14957gcv.a("");
}
relativeLayout.setVisibility(0);
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ ItemViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
C14957gcv.e(viewGroup, "");
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559058, viewGroup, false);
C14957gcv.c(inflate, "");
return new ItemViewHolder(this, inflate, this.e);
}
public BankingAgentAdapter(Context context, List<FE> list, InterfaceC12824fIT interfaceC12824fIT) {
C14957gcv.e(context, "");
C14957gcv.e(list, "");
this.a = context;
this.b = list;
this.i = interfaceC12824fIT;
this.c = nMh.getDrawable(context, R.drawable.banking_agent_placeholder);
this.e = true;
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
return this.b.size();
}
/* loaded from: classes5.dex */
public final class ItemViewHolder extends RecyclerView.zJl {
@BindView
public ImageView avatar;
@BindView
public ImageView avatarList;
final BankingAgentAdapter c;
@BindView
public TextView codeList;
boolean d;
private View e;
@BindView
public RelativeLayout gridLayout;
@BindView
public RelativeLayout listLayout;
@BindView
public TextView name;
@BindView
public TextView nameList;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ItemViewHolder(BankingAgentAdapter bankingAgentAdapter, View view, boolean z) {
super(view);
C14957gcv.e(view, "");
this.c = bankingAgentAdapter;
this.e = view;
this.d = z;
ButterKnife.c(this, view);
}
public static /* synthetic */ void d(BankingAgentAdapter bankingAgentAdapter, ItemViewHolder itemViewHolder) {
C14957gcv.e(bankingAgentAdapter, "");
C14957gcv.e(itemViewHolder, "");
InterfaceC12824fIT interfaceC12824fIT = bankingAgentAdapter.i;
if (interfaceC12824fIT != null) {
interfaceC12824fIT.a(itemViewHolder.getAdapterPosition());
}
}
}
}