234 lines
8.5 KiB
Java
234 lines
8.5 KiB
Java
|
package com.scb.phone.view.adapter.ndid;
|
||
|
|
||
|
import android.view.LayoutInflater;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.widget.CheckBox;
|
||
|
import android.widget.TextView;
|
||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||
|
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.ndid.EligibleAccountAdapter;
|
||
|
import java.util.Collections;
|
||
|
import java.util.Comparator;
|
||
|
import java.util.List;
|
||
|
import o.C14957gcv;
|
||
|
import o.C6583cXR;
|
||
|
import o.dGW;
|
||
|
import o.nMh;
|
||
|
import o.pyT;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public final class EligibleAccountAdapter extends RecyclerView.Sts<EligibleAccountAdapterViewHolder> {
|
||
|
public boolean a;
|
||
|
public final List<dGW> b;
|
||
|
private final boolean d;
|
||
|
private final HBt e;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public interface HBt {
|
||
|
void d(dGW dgw);
|
||
|
}
|
||
|
|
||
|
@Override // androidx.recyclerview.widget.RecyclerView.Sts
|
||
|
public final /* synthetic */ void onBindViewHolder(EligibleAccountAdapterViewHolder eligibleAccountAdapterViewHolder, int i) {
|
||
|
EligibleAccountAdapterViewHolder eligibleAccountAdapterViewHolder2 = eligibleAccountAdapterViewHolder;
|
||
|
C14957gcv.e(eligibleAccountAdapterViewHolder2, "");
|
||
|
final dGW dgw = this.b.get(i);
|
||
|
final HBt hBt = this.e;
|
||
|
boolean z = this.d;
|
||
|
boolean z2 = this.a;
|
||
|
C14957gcv.e(dgw, "");
|
||
|
C14957gcv.e(hBt, "");
|
||
|
eligibleAccountAdapterViewHolder2.itemView.setEnabled(z2);
|
||
|
TextView textView = eligibleAccountAdapterViewHolder2.tvAccountNumber;
|
||
|
CheckBox checkBox = null;
|
||
|
if (textView == null) {
|
||
|
C14957gcv.a("");
|
||
|
textView = null;
|
||
|
}
|
||
|
textView.setText(C6583cXR.b(dgw.e, z));
|
||
|
textView.setTextColor(nMh.getColor(textView.getContext(), EligibleAccountAdapterViewHolder.b(z2)));
|
||
|
TextView textView2 = eligibleAccountAdapterViewHolder2.tvProductType;
|
||
|
if (textView2 == null) {
|
||
|
C14957gcv.a("");
|
||
|
textView2 = null;
|
||
|
}
|
||
|
textView2.setText(dgw.c);
|
||
|
textView2.setTextColor(nMh.getColor(textView2.getContext(), EligibleAccountAdapterViewHolder.b(z2)));
|
||
|
ConstraintLayout constraintLayout = eligibleAccountAdapterViewHolder2.layoutAccountContainer;
|
||
|
if (constraintLayout == null) {
|
||
|
C14957gcv.a("");
|
||
|
constraintLayout = null;
|
||
|
}
|
||
|
if (z2) {
|
||
|
constraintLayout.setOnClickListener(new View.OnClickListener(hBt, dgw) { // from class: o.exl
|
||
|
private EligibleAccountAdapter.HBt b;
|
||
|
private dGW c;
|
||
|
|
||
|
@Override // android.view.View.OnClickListener
|
||
|
public final void onClick(View view) {
|
||
|
EligibleAccountAdapter.EligibleAccountAdapterViewHolder.d(this.b, this.c);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.b = hBt;
|
||
|
this.c = dgw;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
CheckBox checkBox2 = eligibleAccountAdapterViewHolder2.cbAccount;
|
||
|
if (checkBox2 != null) {
|
||
|
checkBox = checkBox2;
|
||
|
} else {
|
||
|
C14957gcv.a("");
|
||
|
}
|
||
|
checkBox.setChecked(false);
|
||
|
checkBox.setEnabled(z2);
|
||
|
checkBox.setButtonDrawable(nMh.getDrawable(checkBox.getContext(), EligibleAccountAdapterViewHolder.c(z2)));
|
||
|
if (z2) {
|
||
|
checkBox.setOnClickListener(new View.OnClickListener(hBt, dgw) { // from class: o.exi
|
||
|
private dGW a;
|
||
|
private EligibleAccountAdapter.HBt c;
|
||
|
|
||
|
@Override // android.view.View.OnClickListener
|
||
|
public final void onClick(View view) {
|
||
|
EligibleAccountAdapter.EligibleAccountAdapterViewHolder.b(this.c, this.a);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.c = hBt;
|
||
|
this.a = dgw;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // androidx.recyclerview.widget.RecyclerView.Sts
|
||
|
public final /* synthetic */ EligibleAccountAdapterViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
||
|
C14957gcv.e(viewGroup, "");
|
||
|
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559332, viewGroup, false);
|
||
|
C14957gcv.c(inflate, "");
|
||
|
return new EligibleAccountAdapterViewHolder(inflate);
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public final class EligibleAccountAdapterViewHolder_ViewBinding implements Unbinder {
|
||
|
private EligibleAccountAdapterViewHolder d;
|
||
|
|
||
|
public EligibleAccountAdapterViewHolder_ViewBinding(EligibleAccountAdapterViewHolder eligibleAccountAdapterViewHolder, View view) {
|
||
|
this.d = eligibleAccountAdapterViewHolder;
|
||
|
eligibleAccountAdapterViewHolder.layoutAccountContainer = (ConstraintLayout) pyT.e(view, R.id.cs_layout_account_container, "field 'layoutAccountContainer'", ConstraintLayout.class);
|
||
|
eligibleAccountAdapterViewHolder.cbAccount = (CheckBox) pyT.e(view, R.id.cb_account, "field 'cbAccount'", CheckBox.class);
|
||
|
eligibleAccountAdapterViewHolder.tvAccountNumber = (TextView) pyT.e(view, R.id.tv_account_number, "field 'tvAccountNumber'", TextView.class);
|
||
|
eligibleAccountAdapterViewHolder.tvProductType = (TextView) pyT.e(view, R.id.tv_product_type, "field 'tvProductType'", TextView.class);
|
||
|
}
|
||
|
|
||
|
@Override // butterknife.Unbinder
|
||
|
public final void a() {
|
||
|
EligibleAccountAdapterViewHolder eligibleAccountAdapterViewHolder = this.d;
|
||
|
if (eligibleAccountAdapterViewHolder == null) {
|
||
|
throw new IllegalStateException("Bindings already cleared.");
|
||
|
}
|
||
|
this.d = null;
|
||
|
eligibleAccountAdapterViewHolder.layoutAccountContainer = null;
|
||
|
eligibleAccountAdapterViewHolder.cbAccount = null;
|
||
|
eligibleAccountAdapterViewHolder.tvAccountNumber = null;
|
||
|
eligibleAccountAdapterViewHolder.tvProductType = null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public EligibleAccountAdapter(List<dGW> list, HBt hBt, boolean z) {
|
||
|
C14957gcv.e(list, "");
|
||
|
C14957gcv.e(hBt, "");
|
||
|
this.b = list;
|
||
|
this.e = hBt;
|
||
|
this.d = z;
|
||
|
this.a = true;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.recyclerview.widget.RecyclerView.Sts
|
||
|
public final int getItemCount() {
|
||
|
return this.b.size();
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public static final class EligibleAccountAdapterViewHolder extends RecyclerView.zJl {
|
||
|
|
||
|
@BindView
|
||
|
public CheckBox cbAccount;
|
||
|
|
||
|
@BindView
|
||
|
public ConstraintLayout layoutAccountContainer;
|
||
|
|
||
|
@BindView
|
||
|
public TextView tvAccountNumber;
|
||
|
|
||
|
@BindView
|
||
|
public TextView tvProductType;
|
||
|
|
||
|
static int b(boolean z) {
|
||
|
return z ? R.color.f2982131099805 : R.color.f3412131099849;
|
||
|
}
|
||
|
|
||
|
static int c(boolean z) {
|
||
|
return z ? R.drawable.account_checkbox_selector : R.drawable.ic_checkbox_disable;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||
|
public EligibleAccountAdapterViewHolder(View view) {
|
||
|
super(view);
|
||
|
C14957gcv.e(view, "");
|
||
|
ButterKnife.c(this, view);
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ void d(HBt hBt, dGW dgw) {
|
||
|
C14957gcv.e(hBt, "");
|
||
|
C14957gcv.e(dgw, "");
|
||
|
hBt.d(dgw);
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ void b(HBt hBt, dGW dgw) {
|
||
|
C14957gcv.e(hBt, "");
|
||
|
C14957gcv.e(dgw, "");
|
||
|
hBt.d(dgw);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public static final class RVV<T> implements Comparator {
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
@Override // java.util.Comparator
|
||
|
public final int compare(T t, T t2) {
|
||
|
Integer valueOf = Integer.valueOf(((dGW) t).b);
|
||
|
Integer valueOf2 = Integer.valueOf(((dGW) t2).b);
|
||
|
if (valueOf == valueOf2) {
|
||
|
return 0;
|
||
|
}
|
||
|
if (valueOf == null) {
|
||
|
return -1;
|
||
|
}
|
||
|
if (valueOf2 == null) {
|
||
|
return 1;
|
||
|
}
|
||
|
return valueOf.compareTo(valueOf2);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final void c() {
|
||
|
List<dGW> list = this.b;
|
||
|
if (list.size() > 1) {
|
||
|
RVV rvv = new RVV();
|
||
|
C14957gcv.e(list, "");
|
||
|
C14957gcv.e(rvv, "");
|
||
|
if (list.size() > 1) {
|
||
|
Collections.sort(list, rvv);
|
||
|
}
|
||
|
}
|
||
|
notifyDataSetChanged();
|
||
|
}
|
||
|
}
|