what-the-bank/sources/com/scb/phone/view/adapter/merchant/bankaccount/BankAccountAdapter.java

138 lines
5.4 KiB
Java

package com.scb.phone.view.adapter.merchant.bankaccount;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RadioButton;
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.merchant.bankaccount.BankAccountAdapter;
import java.util.List;
import o.WW;
import o.pyT;
/* loaded from: classes5.dex */
public final class BankAccountAdapter extends RecyclerView.Sts<BankAccountViewHolder> {
public LWm a;
public List<WW> c;
public int d = -1;
/* loaded from: classes5.dex */
public interface LWm {
void d();
}
/* loaded from: classes5.dex */
public class BankAccountViewHolder_ViewBinding implements Unbinder {
private BankAccountViewHolder e;
public BankAccountViewHolder_ViewBinding(BankAccountViewHolder bankAccountViewHolder, View view) {
this.e = bankAccountViewHolder;
bankAccountViewHolder.layoutRoot = (LinearLayout) pyT.e(view, R.id.layout_root, "field 'layoutRoot'", LinearLayout.class);
bankAccountViewHolder.radioButton = (RadioButton) pyT.e(view, R.id.radio_mw_check, "field 'radioButton'", RadioButton.class);
bankAccountViewHolder.accountNumber = (TextView) pyT.e(view, R.id.tv_mw_account_number, "field 'accountNumber'", TextView.class);
bankAccountViewHolder.accountNickName = (TextView) pyT.e(view, R.id.tv_mw_account_nickname, "field 'accountNickName'", TextView.class);
bankAccountViewHolder.viewLineBorder = pyT.a(view, R.id.line_mw_border, "field 'viewLineBorder'");
}
@Override // butterknife.Unbinder
public final void a() {
BankAccountViewHolder bankAccountViewHolder = this.e;
if (bankAccountViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.e = null;
bankAccountViewHolder.layoutRoot = null;
bankAccountViewHolder.radioButton = null;
bankAccountViewHolder.accountNumber = null;
bankAccountViewHolder.accountNickName = null;
bankAccountViewHolder.viewLineBorder = null;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ void onBindViewHolder(BankAccountViewHolder bankAccountViewHolder, int i) {
BankAccountViewHolder.c(bankAccountViewHolder, this.c.get(i));
}
/* loaded from: classes5.dex */
public class BankAccountViewHolder extends RecyclerView.zJl {
@BindView
TextView accountNickName;
@BindView
TextView accountNumber;
private BankAccountAdapter c;
@BindView
LinearLayout layoutRoot;
@BindView
RadioButton radioButton;
@BindView
View viewLineBorder;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public BankAccountViewHolder(BankAccountAdapter bankAccountAdapter, View view) {
super(view);
this.c = bankAccountAdapter;
ButterKnife.c(this, view);
}
public static /* synthetic */ void b(BankAccountViewHolder bankAccountViewHolder) {
bankAccountViewHolder.c.d = bankAccountViewHolder.getAdapterPosition();
bankAccountViewHolder.c.notifyDataSetChanged();
if (bankAccountViewHolder.c.a != null) {
bankAccountViewHolder.c.a.d();
}
}
static /* synthetic */ void c(final BankAccountViewHolder bankAccountViewHolder, WW ww) {
String str;
bankAccountViewHolder.accountNumber.setText(ww.s);
if (ww.k != null && !TextUtils.isEmpty(ww.k)) {
str = ww.k;
} else {
str = ww.r;
}
bankAccountViewHolder.accountNickName.setText(str);
bankAccountViewHolder.radioButton.setChecked(bankAccountViewHolder.c.d >= 0 && bankAccountViewHolder.c.d == bankAccountViewHolder.getAdapterPosition());
bankAccountViewHolder.viewLineBorder.setVisibility(bankAccountViewHolder.getAdapterPosition() == bankAccountViewHolder.c.c.size() - 1 ? 8 : 0);
bankAccountViewHolder.layoutRoot.setOnClickListener(new View.OnClickListener(bankAccountViewHolder) { // from class: o.ewY
private BankAccountAdapter.BankAccountViewHolder c;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
BankAccountAdapter.BankAccountViewHolder.b(this.c);
}
{
this.c = bankAccountViewHolder;
}
});
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
List<WW> list = this.c;
if (list != null) {
return list.size();
}
return 0;
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ BankAccountViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
return new BankAccountViewHolder(this, LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131558902, viewGroup, false));
}
}