what-the-bank/sources/com/scb/phone/view/adapter/easycash/AccountSelectorAdapter.java

172 lines
5.4 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.adapter.easycash;
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.easycash.AccountSelectorAdapter;
import java.util.ArrayList;
import java.util.List;
import o.InterfaceC12824fIT;
import o.WW;
import o.WYJ;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public class AccountSelectorAdapter extends WYJ {
public List<WW> a;
private LayoutInflater b;
public int c = 0;
private Context d;
private InterfaceC12824fIT e;
private View h;
protected int a() {
return R.layout.2131559055;
}
protected void a(int i) {
}
@Override // o.WYJ
public int getItemPosition(Object obj) {
return -2;
}
@Override // o.WYJ
public boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
/* loaded from: classes5.dex */
public class ItemViewHolder_ViewBinding implements Unbinder {
private ItemViewHolder e;
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
this.e = 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.subtitle = (TextView) pyT.e(view, R.id.account_source_funds_text_view, "field 'subtitle'", TextView.class);
}
@Override // butterknife.Unbinder
public void a() {
ItemViewHolder itemViewHolder = this.e;
if (itemViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.e = null;
itemViewHolder.background = null;
itemViewHolder.title = null;
itemViewHolder.subtitle = null;
}
}
public AccountSelectorAdapter(Context context, List<WW> list, InterfaceC12824fIT interfaceC12824fIT) {
this.d = context;
this.b = (LayoutInflater) context.getSystemService("layout_inflater");
this.a = list == null ? new ArrayList<>() : list;
this.e = interfaceC12824fIT;
}
@Override // o.WYJ
public Object instantiateItem(ViewGroup viewGroup, final int i) {
this.h = this.b.inflate(a(), viewGroup, false);
WW ww = this.a.get(i);
ItemViewHolder e = e();
if (ww != null) {
if (ww.y) {
e.title.setVisibility(8);
}
e.title.setText(ww.x);
e.title.setTag("TAG_ACCOUNT_SELECTOR_ADAPTER_TEXT".concat(String.valueOf(i)));
e.subtitle.setText(ww.s);
e.background.setTag("TAG_ACCOUNT_SELECTOR_ADAPTER_BACKGROUND".concat(String.valueOf(i)));
if (this.c == i) {
e.background.setBackground(nMh.getDrawable(this.d, R.drawable.rounded_purple_view_pager));
e.title.setTextColor(nMh.getColor(this.d, R.color.f2982131099805));
} else {
e.background.setBackground(nMh.getDrawable(this.d, R.drawable.bg_white_rounded));
e.title.setTextColor(nMh.getColor(this.d, R.color.f3092131099816));
}
}
viewGroup.addView(this.h, 0);
e.background.setOnClickListener(new View.OnClickListener(this, i) { // from class: o.ete
private AccountSelectorAdapter b;
private int e;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
AccountSelectorAdapter.a(this.b, this.e);
}
{
this.b = this;
this.e = i;
}
});
a(i);
return this.h;
}
protected ItemViewHolder e() {
return new ItemViewHolder(this.h);
}
@Override // o.WYJ
public int getCount() {
List<WW> list = this.a;
if (list == null) {
return 0;
}
return list.size();
}
@Override // o.WYJ
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
viewGroup.removeView((View) obj);
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes5.dex */
public static class ItemViewHolder extends RecyclerView.zJl {
@BindView
LinearLayout background;
private View d;
@BindView
TextView subtitle;
@BindView
TextView title;
/* JADX INFO: Access modifiers changed from: package-private */
public ItemViewHolder(View view) {
super(view);
this.d = view;
ButterKnife.c(this, view);
}
}
public static /* synthetic */ void a(AccountSelectorAdapter accountSelectorAdapter, int i) {
InterfaceC12824fIT interfaceC12824fIT = accountSelectorAdapter.e;
if (interfaceC12824fIT != null) {
interfaceC12824fIT.a(i);
}
}
/* JADX INFO: Access modifiers changed from: protected */
public final View c() {
return this.h;
}
}