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

223 lines
7.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.adapter.transferandpay;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
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.transferandpay.AccountSourceAdapter;
import java.util.ArrayList;
import java.util.List;
import o.InterfaceC12824fIT;
import o.Jel;
import o.PRA;
import o.WW;
import o.WYJ;
import o.YKU;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class AccountSourceAdapter extends WYJ {
private List<WW> a;
private InterfaceC12824fIT d;
public String e;
private Context g;
private LayoutInflater h;
public int c = 0;
public boolean b = false;
@Override // o.WYJ
public final int getItemPosition(Object obj) {
return -2;
}
@Override // o.WYJ
public final boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
/* loaded from: classes5.dex */
public class ItemViewHolder_ViewBinding implements Unbinder {
private ItemViewHolder c;
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
this.c = itemViewHolder;
itemViewHolder.background = (LinearLayout) pyT.e(view, R.id.account_source_linear_layout, "field 'background'", LinearLayout.class);
itemViewHolder.title = (TextView) pyT.e(view, R.id.account_source_name_text_view, "field 'title'", TextView.class);
itemViewHolder.fund = (TextView) pyT.e(view, R.id.account_source_funds_text_view, "field 'fund'", TextView.class);
}
@Override // butterknife.Unbinder
public final void a() {
ItemViewHolder itemViewHolder = this.c;
if (itemViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.c = null;
itemViewHolder.background = null;
itemViewHolder.title = null;
itemViewHolder.fund = null;
}
}
public AccountSourceAdapter(Context context, List<WW> list, InterfaceC12824fIT interfaceC12824fIT) {
this.g = context;
this.h = (LayoutInflater) context.getSystemService("layout_inflater");
this.a = list == null ? new ArrayList<>() : list;
this.d = interfaceC12824fIT;
}
@Override // o.WYJ
public final Object instantiateItem(ViewGroup viewGroup, final int i) {
View inflate = this.h.inflate(R.layout.2131559055, viewGroup, false);
WW ww = (WW) ((List) new YKU(this.a).b(new Jel(this) { // from class: o.ezm
private AccountSourceAdapter d;
@Override // o.Jel
public final boolean e(Object obj) {
boolean equalsIgnoreCase;
equalsIgnoreCase = ((WW) obj).s.equalsIgnoreCase(this.d.e);
return equalsIgnoreCase;
}
{
this.d = this;
}
}).a(new PRA.Sts(new PRA.AnonymousClass4(), new PRA.AnonymousClass8()))).get(i);
ItemViewHolder itemViewHolder = new ItemViewHolder(inflate);
if (ww != null) {
itemViewHolder.title.setText(ww.x);
itemViewHolder.title.setTag("TAG_ACCOUNT_SOURCE_ADAPTER_TEXT".concat(String.valueOf(i)));
itemViewHolder.fund.setText(ww.c);
itemViewHolder.background.setTag("TAG_ACCOUNT_SOURCE_ADAPTER".concat(String.valueOf(i)));
if (this.c == i) {
itemViewHolder.background.setBackground(nMh.getDrawable(this.g, R.drawable.rounded_purple_view_pager));
itemViewHolder.title.setTextColor(nMh.getColor(this.g, R.color.f2982131099805));
} else {
itemViewHolder.background.setBackground(nMh.getDrawable(this.g, this.b ? R.drawable.bg_white_rounded_with_border : R.drawable.bg_white_rounded));
itemViewHolder.title.setTextColor(nMh.getColor(this.g, R.color.f3092131099816));
}
itemViewHolder.background.setOnClickListener(new View.OnClickListener(this, i) { // from class: o.ezr
private int c;
private AccountSourceAdapter d;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
AccountSourceAdapter.c(this.d, this.c);
}
{
this.d = this;
this.c = i;
}
});
}
viewGroup.addView(inflate, 0);
return inflate;
}
@Override // o.WYJ
public final void destroyItem(ViewGroup viewGroup, int i, Object obj) {
viewGroup.removeView((View) obj);
}
/* loaded from: classes5.dex */
static class ItemViewHolder extends RecyclerView.zJl {
@BindView
LinearLayout background;
private View e;
@BindView
TextView fund;
@BindView
TextView title;
ItemViewHolder(View view) {
super(view);
this.e = view;
ButterKnife.c(this, view);
}
}
public final WW d(int i) {
if (i < getCount()) {
return (WW) ((List) new YKU(this.a).b(new Jel(this) { // from class: o.ezi
private AccountSourceAdapter d;
@Override // o.Jel
public final boolean e(Object obj) {
boolean equalsIgnoreCase;
equalsIgnoreCase = ((WW) obj).s.equalsIgnoreCase(this.d.e);
return equalsIgnoreCase;
}
{
this.d = this;
}
}).a(new PRA.Sts(new PRA.AnonymousClass4(), new PRA.AnonymousClass8()))).get(i);
}
return null;
}
public static /* synthetic */ void c(AccountSourceAdapter accountSourceAdapter, int i) {
InterfaceC12824fIT interfaceC12824fIT = accountSourceAdapter.d;
if (interfaceC12824fIT != null) {
interfaceC12824fIT.a(i);
}
}
public final int b(String str) {
List list = (List) new YKU(this.a).b(new Jel(this) { // from class: o.ezl
private AccountSourceAdapter b;
@Override // o.Jel
public final boolean e(Object obj) {
boolean equalsIgnoreCase;
equalsIgnoreCase = ((WW) obj).s.equalsIgnoreCase(this.b.e);
return equalsIgnoreCase;
}
{
this.b = this;
}
}).a(new PRA.Sts(new PRA.AnonymousClass4(), new PRA.AnonymousClass8()));
for (int i = 0; i < list.size(); i++) {
if (((WW) list.get(i)).s.equalsIgnoreCase(str)) {
return i;
}
}
return -1;
}
@Override // o.WYJ
public final int getCount() {
List<WW> list = this.a;
if (list == null) {
return 0;
}
return ((List) new YKU(list).b(new Jel(this) { // from class: o.ezo
private AccountSourceAdapter d;
@Override // o.Jel
public final boolean e(Object obj) {
boolean equalsIgnoreCase;
equalsIgnoreCase = ((WW) obj).s.equalsIgnoreCase(this.d.e);
return equalsIgnoreCase;
}
{
this.d = this;
}
}).a(new PRA.Sts(new PRA.AnonymousClass4(), new PRA.AnonymousClass8()))).size();
}
}