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

268 lines
9.1 KiB
Java
Raw Permalink 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.RelativeLayout;
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.CollateralSelectorAdapter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import o.C14957gcv;
import o.C6583cXR;
import o.InterfaceC12824fIT;
import o.WYJ;
import o.fXO;
import o.gcH;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class CollateralSelectorAdapter extends WYJ {
public int a;
private final InterfaceC12824fIT b;
private final Context c;
private final LayoutInflater d;
public List<fXO> e;
private View f;
/* loaded from: classes5.dex */
public final class ItemViewHolder_ViewBinding implements Unbinder {
private ItemViewHolder d;
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
this.d = itemViewHolder;
itemViewHolder.background = (LinearLayout) pyT.e(view, R.id.ll_layout_collateral, "field 'background'", LinearLayout.class);
itemViewHolder.projectNameTxt = (TextView) pyT.e(view, R.id.tv_collateral_project_name, "field 'projectNameTxt'", TextView.class);
itemViewHolder.addressTxt = (TextView) pyT.e(view, R.id.tv_collateral_address, "field 'addressTxt'", TextView.class);
itemViewHolder.creditLimitTxt = (TextView) pyT.e(view, R.id.tv_collateral_credit_limit, "field 'creditLimitTxt'", TextView.class);
itemViewHolder.addNewCollateralLayout = (RelativeLayout) pyT.e(view, R.id.rl_layout_add_new_collateral, "field 'addNewCollateralLayout'", RelativeLayout.class);
}
@Override // butterknife.Unbinder
public final void a() {
ItemViewHolder itemViewHolder = this.d;
if (itemViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.d = null;
itemViewHolder.background = null;
itemViewHolder.projectNameTxt = null;
itemViewHolder.addressTxt = null;
itemViewHolder.creditLimitTxt = null;
itemViewHolder.addNewCollateralLayout = null;
}
}
public CollateralSelectorAdapter(Context context, ArrayList arrayList, InterfaceC12824fIT interfaceC12824fIT) {
C14957gcv.e(context, "");
this.c = context;
this.b = interfaceC12824fIT;
Object systemService = context.getSystemService("layout_inflater");
C14957gcv.d(systemService, "");
this.d = (LayoutInflater) systemService;
this.e = arrayList == null ? new ArrayList() : arrayList;
}
/* loaded from: classes5.dex */
public static final class LWm {
private LWm() {
}
public /* synthetic */ LWm(byte b) {
this();
}
}
@Override // o.WYJ
public final Object instantiateItem(ViewGroup viewGroup, final int i) {
C14957gcv.e(viewGroup, "");
View inflate = this.d.inflate(R.layout.2131558958, viewGroup, false);
C14957gcv.c(inflate, "");
this.f = inflate;
fXO fxo = this.e.get(i);
View view = this.f;
if (view == null) {
C14957gcv.a("");
view = null;
}
ItemViewHolder itemViewHolder = new ItemViewHolder(view);
if (i != this.e.size() - 1) {
TextView textView = itemViewHolder.projectNameTxt;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(fxo.a);
TextView textView2 = itemViewHolder.addressTxt;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
gcH gch = gcH.d;
String format = String.format("%s %s %s", Arrays.copyOf(new Object[]{fxo.d, fxo.c, fxo.b}, 3));
C14957gcv.c((Object) format, "");
textView2.setText(format);
TextView textView3 = itemViewHolder.creditLimitTxt;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
gcH gch2 = gcH.d;
String format2 = String.format("%s %s", Arrays.copyOf(new Object[]{this.c.getResources().getString(R.string.collateral_credit_limit), C6583cXR.i(fxo.e)}, 2));
C14957gcv.c((Object) format2, "");
textView3.setText(format2);
} else {
TextView textView4 = itemViewHolder.projectNameTxt;
if (textView4 == null) {
C14957gcv.a("");
textView4 = null;
}
textView4.setVisibility(8);
TextView textView5 = itemViewHolder.addressTxt;
if (textView5 == null) {
C14957gcv.a("");
textView5 = null;
}
textView5.setVisibility(8);
TextView textView6 = itemViewHolder.creditLimitTxt;
if (textView6 == null) {
C14957gcv.a("");
textView6 = null;
}
textView6.setVisibility(8);
RelativeLayout relativeLayout = itemViewHolder.addNewCollateralLayout;
if (relativeLayout == null) {
C14957gcv.a("");
relativeLayout = null;
}
relativeLayout.setVisibility(0);
}
LinearLayout linearLayout = itemViewHolder.background;
if (linearLayout == null) {
C14957gcv.a("");
linearLayout = null;
}
linearLayout.setTag("TAG_COLLATERAL_SELECTOR_ADAPTER_BACKGROUND".concat(String.valueOf(i)));
if (this.a == i) {
LinearLayout linearLayout2 = itemViewHolder.background;
if (linearLayout2 == null) {
C14957gcv.a("");
linearLayout2 = null;
}
linearLayout2.setBackground(nMh.getDrawable(this.c, R.drawable.rounded_purple_view_pager));
} else {
LinearLayout linearLayout3 = itemViewHolder.background;
if (linearLayout3 == null) {
C14957gcv.a("");
linearLayout3 = null;
}
linearLayout3.setBackground(nMh.getDrawable(this.c, R.drawable.bg_white_rounded));
}
View view2 = this.f;
if (view2 == null) {
C14957gcv.a("");
view2 = null;
}
viewGroup.addView(view2, 0);
LinearLayout linearLayout4 = itemViewHolder.background;
if (linearLayout4 == null) {
C14957gcv.a("");
linearLayout4 = null;
}
linearLayout4.setOnClickListener(new View.OnClickListener(this, i) { // from class: o.eto
private int a;
private CollateralSelectorAdapter d;
@Override // android.view.View.OnClickListener
public final void onClick(View view3) {
CollateralSelectorAdapter.c(this.d, this.a);
}
{
this.d = this;
this.a = i;
}
});
View view3 = this.f;
if (view3 != null) {
return view3;
}
C14957gcv.a("");
return null;
}
@Override // o.WYJ
public final int getCount() {
return this.e.size();
}
@Override // o.WYJ
public final void destroyItem(ViewGroup viewGroup, int i, Object obj) {
C14957gcv.e(viewGroup, "");
C14957gcv.e(obj, "");
viewGroup.removeView((View) obj);
}
/* loaded from: classes5.dex */
public static final class ItemViewHolder extends RecyclerView.zJl {
@BindView
public RelativeLayout addNewCollateralLayout;
@BindView
public TextView addressTxt;
@BindView
public LinearLayout background;
@BindView
public TextView creditLimitTxt;
private final View d;
@BindView
public TextView projectNameTxt;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ItemViewHolder(View view) {
super(view);
C14957gcv.e(view, "");
this.d = view;
ButterKnife.c(this, this.itemView);
}
}
public static /* synthetic */ void c(CollateralSelectorAdapter collateralSelectorAdapter, int i) {
C14957gcv.e(collateralSelectorAdapter, "");
InterfaceC12824fIT interfaceC12824fIT = collateralSelectorAdapter.b;
if (interfaceC12824fIT != null) {
interfaceC12824fIT.a(i);
}
}
@Override // o.WYJ
public final boolean isViewFromObject(View view, Object obj) {
C14957gcv.e(view, "");
C14957gcv.e(obj, "");
return view == obj;
}
@Override // o.WYJ
public final int getItemPosition(Object obj) {
C14957gcv.e(obj, "");
return -2;
}
static {
new LWm((byte) 0);
}
}