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

375 lines
14 KiB
Java

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.AccountBnplSourceAdapter;
import java.util.ArrayList;
import java.util.List;
import o.C1173Xd;
import o.C14957gcv;
import o.C6583cXR;
import o.InterfaceC12824fIT;
import o.WYJ;
import o.gdZ;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class AccountBnplSourceAdapter extends WYJ {
public final List<C1173Xd> a;
private String b;
public int c;
private final String d;
private final Context e;
private final InterfaceC12824fIT f;
private LayoutInflater i;
private final InterfaceC12824fIT j;
/* loaded from: classes5.dex */
public final class ItemViewHolder_ViewBinding implements Unbinder {
private ItemViewHolder b;
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
this.b = itemViewHolder;
itemViewHolder.llBackground = (LinearLayout) pyT.e(view, R.id.ll_account_source, "field 'llBackground'", LinearLayout.class);
itemViewHolder.tvAccountName = (TextView) pyT.e(view, R.id.tv_account_source_name, "field 'tvAccountName'", TextView.class);
itemViewHolder.tvAccountNumber = (TextView) pyT.e(view, R.id.tv_account_source_number, "field 'tvAccountNumber'", TextView.class);
itemViewHolder.tvAccountRemaining = (TextView) pyT.e(view, R.id.tv_account_source_remaining_balance, "field 'tvAccountRemaining'", TextView.class);
itemViewHolder.bgSetupDueDate = (LinearLayout) pyT.e(view, R.id.ll_bg_account_source_setup_due_date, "field 'bgSetupDueDate'", LinearLayout.class);
itemViewHolder.tvTitleSetupDueDate = (TextView) pyT.e(view, R.id.tv_account_bnpl_setup_due_date_title, "field 'tvTitleSetupDueDate'", TextView.class);
itemViewHolder.tvSetupDueDateLink = (TextView) pyT.e(view, R.id.tv_account_bnpl_link, "field 'tvSetupDueDateLink'", TextView.class);
}
@Override // butterknife.Unbinder
public final void a() {
ItemViewHolder itemViewHolder = this.b;
if (itemViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.b = null;
itemViewHolder.llBackground = null;
itemViewHolder.tvAccountName = null;
itemViewHolder.tvAccountNumber = null;
itemViewHolder.tvAccountRemaining = null;
itemViewHolder.bgSetupDueDate = null;
itemViewHolder.tvTitleSetupDueDate = null;
itemViewHolder.tvSetupDueDateLink = null;
}
}
public AccountBnplSourceAdapter(Context context, String str, List<C1173Xd> list, InterfaceC12824fIT interfaceC12824fIT, InterfaceC12824fIT interfaceC12824fIT2) {
C14957gcv.e(context, "");
C14957gcv.e(str, "");
C14957gcv.e(list, "");
this.e = context;
this.d = str;
this.a = list;
this.f = interfaceC12824fIT;
this.j = interfaceC12824fIT2;
Object systemService = context.getSystemService("layout_inflater");
C14957gcv.d(systemService, "");
this.i = (LayoutInflater) systemService;
this.b = "";
}
/* loaded from: classes5.dex */
public static final class IeS {
private IeS() {
}
public /* synthetic */ IeS(byte b) {
this();
}
}
@Override // o.WYJ
public final int getCount() {
return this.a.size();
}
@Override // o.WYJ
public final boolean isViewFromObject(View view, Object obj) {
C14957gcv.e(view, "");
C14957gcv.e(obj, "");
return C14957gcv.b(view, obj);
}
@Override // o.WYJ
public final void destroyItem(ViewGroup viewGroup, int i, Object obj) {
C14957gcv.e(viewGroup, "");
C14957gcv.e(obj, "");
if (obj instanceof View) {
viewGroup.removeView((View) obj);
}
}
@Override // o.WYJ
public final Object instantiateItem(ViewGroup viewGroup, final int i) {
String str;
C14957gcv.e(viewGroup, "");
LinearLayout linearLayout = null;
View inflate = this.i.inflate(R.layout.2131558892, (ViewGroup) null);
C14957gcv.c(inflate, "");
ItemViewHolder itemViewHolder = new ItemViewHolder(this, inflate);
if (!this.a.isEmpty()) {
List<C1173Xd> list = this.a;
ArrayList arrayList = new ArrayList();
for (Object obj : list) {
String str2 = ((C1173Xd) obj).c;
if (str2 != null && gdZ.d((CharSequence) str2, (CharSequence) this.b, false)) {
arrayList.add(obj);
}
}
C1173Xd c1173Xd = (C1173Xd) arrayList.get(i);
String str3 = c1173Xd.e;
if (str3 != null && str3.length() != 0) {
TextView textView = itemViewHolder.tvAccountName;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(c1173Xd.e);
} else {
TextView textView2 = itemViewHolder.tvAccountName;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
if (C14957gcv.b((Object) this.d, (Object) "en")) {
str = c1173Xd.i;
} else {
str = c1173Xd.h;
}
textView2.setText(str);
}
TextView textView3 = itemViewHolder.tvAccountNumber;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView3.setText(c1173Xd.d);
TextView textView4 = itemViewHolder.tvAccountRemaining;
if (textView4 == null) {
C14957gcv.a("");
textView4 = null;
}
Double d = c1173Xd.a;
textView4.setText(((String) C6583cXR.c(new Object[]{Double.valueOf(d != null ? d.doubleValue() : 0.0d)}, -150997759, 150997764, (int) System.currentTimeMillis())).toString());
TextView textView5 = itemViewHolder.tvAccountName;
if (textView5 == null) {
C14957gcv.a("");
textView5 = null;
}
textView5.setTag("TAG_ACCOUNT_SOURCE_ADAPTER_TEXT".concat(String.valueOf(i)));
LinearLayout linearLayout2 = itemViewHolder.llBackground;
if (linearLayout2 == null) {
C14957gcv.a("");
linearLayout2 = null;
}
linearLayout2.setTag("TAG_ACCOUNT_SOURCE_ADAPTER".concat(String.valueOf(i)));
if (!C14957gcv.b(c1173Xd.m, Boolean.TRUE)) {
LinearLayout linearLayout3 = itemViewHolder.bgSetupDueDate;
if (linearLayout3 == null) {
C14957gcv.a("");
linearLayout3 = null;
}
LinearLayout linearLayout4 = linearLayout3;
C14957gcv.e(linearLayout4, "");
linearLayout4.setVisibility(0);
TextView textView6 = itemViewHolder.tvTitleSetupDueDate;
if (textView6 == null) {
C14957gcv.a("");
textView6 = null;
}
textView6.setText(R.string.loan_account_bnpl_background_title);
TextView textView7 = itemViewHolder.tvSetupDueDateLink;
if (textView7 == null) {
C14957gcv.a("");
textView7 = null;
}
textView7.setText(R.string.loan_account_bnpl_background_btn);
} else if (C14957gcv.b((Object) "4", (Object) c1173Xd.b)) {
LinearLayout linearLayout5 = itemViewHolder.bgSetupDueDate;
if (linearLayout5 == null) {
C14957gcv.a("");
linearLayout5 = null;
}
LinearLayout linearLayout6 = linearLayout5;
C14957gcv.e(linearLayout6, "");
linearLayout6.setVisibility(0);
TextView textView8 = itemViewHolder.tvTitleSetupDueDate;
if (textView8 == null) {
C14957gcv.a("");
textView8 = null;
}
textView8.setText(R.string.loan_account_bnpl_background_title_frozen);
TextView textView9 = itemViewHolder.tvSetupDueDateLink;
if (textView9 == null) {
C14957gcv.a("");
textView9 = null;
}
textView9.setText(R.string.loan_account_bnpl_background_btn_frozen);
}
if (this.c == i) {
LinearLayout linearLayout7 = itemViewHolder.llBackground;
if (linearLayout7 == null) {
C14957gcv.a("");
linearLayout7 = null;
}
LinearLayout linearLayout8 = itemViewHolder.llBackground;
if (linearLayout8 == null) {
C14957gcv.a("");
linearLayout8 = null;
}
linearLayout7.setBackground(nMh.getDrawable(linearLayout8.getContext(), R.drawable.rounded_purple_view_pager));
TextView textView10 = itemViewHolder.tvAccountName;
if (textView10 == null) {
C14957gcv.a("");
textView10 = null;
}
TextView textView11 = itemViewHolder.tvAccountName;
if (textView11 == null) {
C14957gcv.a("");
textView11 = null;
}
textView10.setTextColor(nMh.getColor(textView11.getContext(), R.color.f2982131099805));
} else {
LinearLayout linearLayout9 = itemViewHolder.llBackground;
if (linearLayout9 == null) {
C14957gcv.a("");
linearLayout9 = null;
}
LinearLayout linearLayout10 = itemViewHolder.llBackground;
if (linearLayout10 == null) {
C14957gcv.a("");
linearLayout10 = null;
}
linearLayout9.setBackground(nMh.getDrawable(linearLayout10.getContext(), R.drawable.bg_white_rounded_with_border));
TextView textView12 = itemViewHolder.tvAccountName;
if (textView12 == null) {
C14957gcv.a("");
textView12 = null;
}
TextView textView13 = itemViewHolder.tvAccountName;
if (textView13 == null) {
C14957gcv.a("");
textView13 = null;
}
textView12.setTextColor(nMh.getColor(textView13.getContext(), R.color.f3092131099816));
}
LinearLayout linearLayout11 = itemViewHolder.llBackground;
if (linearLayout11 == null) {
C14957gcv.a("");
linearLayout11 = null;
}
linearLayout11.setOnClickListener(new View.OnClickListener(this, i) { // from class: o.ezk
private int b;
private AccountBnplSourceAdapter d;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
AccountBnplSourceAdapter.c(this.d, this.b);
}
{
this.d = this;
this.b = i;
}
});
LinearLayout linearLayout12 = itemViewHolder.bgSetupDueDate;
if (linearLayout12 != null) {
linearLayout = linearLayout12;
} else {
C14957gcv.a("");
}
linearLayout.setOnClickListener(new View.OnClickListener(this, i) { // from class: o.ezj
private AccountBnplSourceAdapter c;
private int e;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
AccountBnplSourceAdapter.b(this.c, this.e);
}
{
this.c = this;
this.e = i;
}
});
}
viewGroup.addView(itemViewHolder.b, 0);
return itemViewHolder.b;
}
/* loaded from: classes5.dex */
public final class ItemViewHolder extends RecyclerView.zJl {
final View b;
@BindView
public LinearLayout bgSetupDueDate;
private AccountBnplSourceAdapter d;
@BindView
public LinearLayout llBackground;
@BindView
public TextView tvAccountName;
@BindView
public TextView tvAccountNumber;
@BindView
public TextView tvAccountRemaining;
@BindView
public TextView tvSetupDueDateLink;
@BindView
public TextView tvTitleSetupDueDate;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ItemViewHolder(AccountBnplSourceAdapter accountBnplSourceAdapter, View view) {
super(view);
C14957gcv.e(view, "");
this.d = accountBnplSourceAdapter;
this.b = view;
ButterKnife.c(this, view);
}
}
@Override // o.WYJ
public final int getItemPosition(Object obj) {
C14957gcv.e(obj, "");
return super.getItemPosition(obj);
}
public static /* synthetic */ void c(AccountBnplSourceAdapter accountBnplSourceAdapter, int i) {
C14957gcv.e(accountBnplSourceAdapter, "");
InterfaceC12824fIT interfaceC12824fIT = accountBnplSourceAdapter.f;
if (interfaceC12824fIT != null) {
interfaceC12824fIT.a(i);
}
}
public static /* synthetic */ void b(AccountBnplSourceAdapter accountBnplSourceAdapter, int i) {
C14957gcv.e(accountBnplSourceAdapter, "");
InterfaceC12824fIT interfaceC12824fIT = accountBnplSourceAdapter.j;
if (interfaceC12824fIT != null) {
interfaceC12824fIT.a(i);
}
}
static {
new IeS((byte) 0);
}
}