what-the-bank/sources/com/scb/phone/view/adapter/cardmanagement/ExportCardStatementSelectio...

540 lines
19 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.adapter.cardmanagement;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
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.cardmanagement.ExportCardStatementSelectionAdapter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import o.C14957gcv;
import o.GU;
import o.GW;
import o.gcH;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class ExportCardStatementSelectionAdapter extends RecyclerView.Sts<RecyclerView.zJl> {
private static List<String> a;
public LWm b;
public List<GW> c;
private String d;
public RecyclerView.ZnX e;
/* loaded from: classes5.dex */
public interface LWm {
void d(GU gu);
void e(Integer num);
}
/* loaded from: classes5.dex */
public enum RVV {
TITLE,
ITEMS,
REMARK
}
/* loaded from: classes5.dex */
public final class TitleViewHolder_ViewBinding implements Unbinder {
private TitleViewHolder d;
public TitleViewHolder_ViewBinding(TitleViewHolder titleViewHolder, View view) {
this.d = titleViewHolder;
titleViewHolder.tvTitle = (TextView) pyT.e(view, R.id.tv_title, "field 'tvTitle'", TextView.class);
}
@Override // butterknife.Unbinder
public final void a() {
TitleViewHolder titleViewHolder = this.d;
if (titleViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.d = null;
titleViewHolder.tvTitle = null;
}
}
/* loaded from: classes5.dex */
public final class ItemSelectionViewHolder_ViewBinding implements Unbinder {
private ItemSelectionViewHolder d;
public ItemSelectionViewHolder_ViewBinding(ItemSelectionViewHolder itemSelectionViewHolder, View view) {
this.d = itemSelectionViewHolder;
itemSelectionViewHolder.tvCycleYear = (TextView) pyT.e(view, R.id.tv_cycle_year, "field 'tvCycleYear'", TextView.class);
itemSelectionViewHolder.rvCycleSelection = (RecyclerView) pyT.e(view, R.id.rv_cycle_selection, "field 'rvCycleSelection'", RecyclerView.class);
itemSelectionViewHolder.divider = pyT.a(view, R.id.view_divider, "field 'divider'");
}
@Override // butterknife.Unbinder
public final void a() {
ItemSelectionViewHolder itemSelectionViewHolder = this.d;
if (itemSelectionViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.d = null;
itemSelectionViewHolder.tvCycleYear = null;
itemSelectionViewHolder.rvCycleSelection = null;
itemSelectionViewHolder.divider = null;
}
}
/* loaded from: classes5.dex */
public final class MonthViewHolder_ViewBinding implements Unbinder {
private MonthViewHolder e;
public MonthViewHolder_ViewBinding(MonthViewHolder monthViewHolder, View view) {
this.e = monthViewHolder;
monthViewHolder.ckbMonth = (CheckBox) pyT.e(view, R.id.ckb_month, "field 'ckbMonth'", CheckBox.class);
monthViewHolder.tvMonth = (TextView) pyT.e(view, R.id.tv_month, "field 'tvMonth'", TextView.class);
}
@Override // butterknife.Unbinder
public final void a() {
MonthViewHolder monthViewHolder = this.e;
if (monthViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.e = null;
monthViewHolder.ckbMonth = null;
monthViewHolder.tvMonth = null;
}
}
public ExportCardStatementSelectionAdapter() {
a = new ArrayList();
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemViewType(int i) {
if (i == 0) {
return RVV.TITLE.ordinal();
}
return i == getItemCount() + (-1) ? RVV.REMARK.ordinal() : RVV.ITEMS.ordinal();
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final RecyclerView.zJl onCreateViewHolder(ViewGroup viewGroup, int i) {
C14957gcv.e(viewGroup, "");
if (i == RVV.TITLE.ordinal()) {
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131560000, viewGroup, false);
C14957gcv.c(inflate, "");
return new TitleViewHolder(inflate);
}
if (i == RVV.ITEMS.ordinal()) {
View inflate2 = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559997, viewGroup, false);
RecyclerView.ZnX znX = this.e;
C14957gcv.c(inflate2, "");
ItemSelectionViewHolder itemSelectionViewHolder = new ItemSelectionViewHolder(znX, inflate2);
itemSelectionViewHolder.a = this.b;
return itemSelectionViewHolder;
}
View inflate3 = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559999, viewGroup, false);
C14957gcv.c(inflate3, "");
return new HBt(inflate3);
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
List<GW> list = this.c;
if (list != null) {
return list.size() + 2;
}
return 0;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r9v2, types: [android.view.View] */
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final void onBindViewHolder(RecyclerView.zJl zjl, int i) {
List<GW> list;
GW gw;
C14957gcv.e(zjl, "");
TextView textView = null;
if (zjl instanceof TitleViewHolder) {
List<GW> list2 = this.c;
if (list2 != null) {
Iterator it = list2.iterator();
while (it.hasNext()) {
this.d = String.valueOf(((GW) it.next()).b);
}
}
TitleViewHolder titleViewHolder = (TitleViewHolder) zjl;
String str = this.d;
if (str == null) {
str = "";
}
C14957gcv.e(str, "");
Context context = titleViewHolder.itemView.getContext();
if (context != null) {
TextView textView2 = titleViewHolder.tvTitle;
if (textView2 != null) {
textView = textView2;
} else {
C14957gcv.a("");
}
gcH gch = gcH.d;
String string = context.getString(R.string.ccm_e_statement_selection_header);
C14957gcv.c((Object) string, "");
String format = String.format(string, Arrays.copyOf(new Object[]{str}, 1));
C14957gcv.c((Object) format, "");
textView.setText(format);
return;
}
return;
}
if (!(zjl instanceof ItemSelectionViewHolder) || (list = this.c) == null || (gw = list.get(i - 1)) == null) {
return;
}
ItemSelectionViewHolder itemSelectionViewHolder = (ItemSelectionViewHolder) zjl;
boolean z = i != getItemCount() + (-2);
Integer num = gw.b;
C14957gcv.e(gw, "");
TextView textView3 = itemSelectionViewHolder.tvCycleYear;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView3.setText(gw.c);
if (itemSelectionViewHolder.c != null) {
RecyclerView recyclerView = itemSelectionViewHolder.rvCycleSelection;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
recyclerView.setRecycledViewPool(itemSelectionViewHolder.c);
}
RecyclerView recyclerView2 = itemSelectionViewHolder.rvCycleSelection;
if (recyclerView2 == null) {
C14957gcv.a("");
recyclerView2 = null;
}
itemSelectionViewHolder.itemView.getContext();
recyclerView2.setLayoutManager(new GridLayoutManager(3, (byte) 0));
RecyclerView recyclerView3 = itemSelectionViewHolder.rvCycleSelection;
if (recyclerView3 == null) {
C14957gcv.a("");
recyclerView3 = null;
}
Sts sts = new Sts(gw.a, num != null ? num.intValue() : 0);
sts.e = itemSelectionViewHolder.a;
recyclerView3.setAdapter(sts);
?? r9 = itemSelectionViewHolder.divider;
if (r9 != 0) {
textView = r9;
} else {
C14957gcv.a("");
}
textView.setVisibility(z ? 0 : 4);
}
public static void b() {
List<String> list = a;
if (list != null) {
list.clear();
}
}
/* loaded from: classes5.dex */
public static final class Sts extends RecyclerView.Sts<RecyclerView.zJl> {
private final int a;
private final List<GU> d;
LWm e;
/* loaded from: classes5.dex */
public enum LWm {
ITEM
}
public Sts(List<GU> list, int i) {
this.d = list;
this.a = i;
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final RecyclerView.zJl onCreateViewHolder(ViewGroup viewGroup, int i) {
C14957gcv.e(viewGroup, "");
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559998, viewGroup, false);
C14957gcv.c(inflate, "");
MonthViewHolder monthViewHolder = new MonthViewHolder(inflate);
monthViewHolder.d = this.e;
return monthViewHolder;
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemViewType(int i) {
return LWm.ITEM.ordinal();
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
List<GU> list = this.d;
if (list != null) {
return list.size();
}
return 0;
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final void onBindViewHolder(RecyclerView.zJl zjl, int i) {
List<GU> list;
final GU gu;
C14957gcv.e(zjl, "");
if (!(zjl instanceof MonthViewHolder) || (list = this.d) == null || (gu = list.get(i)) == null) {
return;
}
final MonthViewHolder monthViewHolder = (MonthViewHolder) zjl;
final int i2 = this.a;
C14957gcv.e(gu, "");
final String str = gu.c;
Context context = monthViewHolder.itemView.getContext();
if (context != null) {
CheckBox checkBox = monthViewHolder.ckbMonth;
CheckBox checkBox2 = null;
if (checkBox == null) {
C14957gcv.a("");
checkBox = null;
}
checkBox.setEnabled(gu.b);
CheckBox checkBox3 = monthViewHolder.ckbMonth;
if (checkBox3 == null) {
C14957gcv.a("");
checkBox3 = null;
}
checkBox3.setChecked(gu.e);
TextView textView = monthViewHolder.tvMonth;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(gu.d);
TextView textView2 = monthViewHolder.tvMonth;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setTextColor(MonthViewHolder.c(context, gu.b));
TextView textView3 = monthViewHolder.tvMonth;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView3.setOnClickListener(new View.OnClickListener(monthViewHolder) { // from class: o.ers
private ExportCardStatementSelectionAdapter.MonthViewHolder d;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
ExportCardStatementSelectionAdapter.MonthViewHolder.a(this.d);
}
{
this.d = monthViewHolder;
}
});
CheckBox checkBox4 = monthViewHolder.ckbMonth;
if (checkBox4 == null) {
C14957gcv.a("");
checkBox4 = null;
}
if (checkBox4.isEnabled()) {
CheckBox checkBox5 = monthViewHolder.ckbMonth;
if (checkBox5 != null) {
checkBox2 = checkBox5;
} else {
C14957gcv.a("");
}
checkBox2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(i2, gu, monthViewHolder, str) { // from class: o.erw
private int a;
private GU b;
private ExportCardStatementSelectionAdapter.MonthViewHolder c;
private String e;
@Override // android.widget.CompoundButton.OnCheckedChangeListener
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
ExportCardStatementSelectionAdapter.MonthViewHolder.e(this.a, this.b, this.c, this.e, z);
}
{
this.a = i2;
this.b = gu;
this.c = monthViewHolder;
this.e = str;
}
});
}
}
}
}
/* loaded from: classes5.dex */
public static final class TitleViewHolder extends RecyclerView.zJl {
@BindView
public TextView tvTitle;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public TitleViewHolder(View view) {
super(view);
C14957gcv.e(view, "");
ButterKnife.c(this, view);
}
}
/* loaded from: classes5.dex */
public static final class ItemSelectionViewHolder extends RecyclerView.zJl {
LWm a;
final RecyclerView.ZnX c;
@BindView
public View divider;
@BindView
public RecyclerView rvCycleSelection;
@BindView
public TextView tvCycleYear;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ItemSelectionViewHolder(RecyclerView.ZnX znX, View view) {
super(view);
C14957gcv.e(view, "");
this.c = znX;
ButterKnife.c(this, view);
}
}
/* loaded from: classes5.dex */
public static final class MonthViewHolder extends RecyclerView.zJl {
@BindView
public CheckBox ckbMonth;
LWm d;
@BindView
public TextView tvMonth;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public MonthViewHolder(View view) {
super(view);
C14957gcv.e(view, "");
ButterKnife.c(this, view);
}
static int c(Context context, boolean z) {
if (z) {
C14957gcv.e(context, "");
return nMh.getColor(context, R.color.f2982131099805);
}
C14957gcv.e(context, "");
return nMh.getColor(context, R.color.f3412131099849);
}
public static /* synthetic */ void a(MonthViewHolder monthViewHolder) {
C14957gcv.e(monthViewHolder, "");
CheckBox checkBox = monthViewHolder.ckbMonth;
CheckBox checkBox2 = null;
if (checkBox == null) {
C14957gcv.a("");
checkBox = null;
}
if (checkBox.isEnabled()) {
CheckBox checkBox3 = monthViewHolder.ckbMonth;
if (checkBox3 != null) {
checkBox2 = checkBox3;
} else {
C14957gcv.a("");
}
checkBox2.toggle();
}
}
public static /* synthetic */ void e(int i, GU gu, MonthViewHolder monthViewHolder, String str, boolean z) {
C14957gcv.e(gu, "");
C14957gcv.e(monthViewHolder, "");
List list = ExportCardStatementSelectionAdapter.a;
if (list != null) {
if (list.size() >= i) {
boolean contains = list.contains(String.valueOf(str));
CheckBox checkBox = null;
if (contains) {
CheckBox checkBox2 = monthViewHolder.ckbMonth;
if (checkBox2 != null) {
checkBox = checkBox2;
} else {
C14957gcv.a("");
}
checkBox.setChecked(false);
gu.e = false;
list.remove(String.valueOf(str));
return;
}
if (contains) {
return;
}
LWm lWm = monthViewHolder.d;
if (lWm != null) {
lWm.e(Integer.valueOf(i));
}
CheckBox checkBox3 = monthViewHolder.ckbMonth;
if (checkBox3 != null) {
checkBox = checkBox3;
} else {
C14957gcv.a("");
}
checkBox.setChecked(false);
return;
}
gu.e = z;
LWm lWm2 = monthViewHolder.d;
if (lWm2 != null) {
lWm2.d(gu);
}
boolean z2 = gu.e;
if (z2) {
list.add(String.valueOf(str));
} else {
if (z2) {
return;
}
list.remove(String.valueOf(str));
}
}
}
}
/* loaded from: classes5.dex */
public static final class HBt extends RecyclerView.zJl {
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public HBt(View view) {
super(view);
C14957gcv.e(view, "");
}
}
/* loaded from: classes5.dex */
public static final class IeS {
private IeS() {
}
public /* synthetic */ IeS(byte b) {
this();
}
}
static {
new IeS((byte) 0);
}
}