what-the-bank/sources/com/scb/phone/view/adapter/debitatm/DebitCardDetailAdapter.java

200 lines
7.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.adapter.debitatm;
import android.graphics.Bitmap;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
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.squareup.picasso.Picasso;
import java.util.List;
import o.C13020fOa;
import o.IU;
import o.WYJ;
import o.fNW;
import o.pyT;
/* loaded from: classes5.dex */
public final class DebitCardDetailAdapter extends WYJ {
public List<? extends IU> b;
private final String c;
@Override // o.WYJ
public final int getItemPosition(Object obj) {
return -2;
}
@Override // o.WYJ
public final boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
/* loaded from: classes5.dex */
public class DebitCardHolder_ViewBinding implements Unbinder {
private DebitCardHolder d;
public DebitCardHolder_ViewBinding(DebitCardHolder debitCardHolder, View view) {
this.d = debitCardHolder;
debitCardHolder.tvDbLastNumber = (TextView) pyT.e(view, R.id.card_number_text_view, "field 'tvDbLastNumber'", TextView.class);
debitCardHolder.tvDbFrontNumber = (TextView) pyT.e(view, R.id.card_number_front_text_view, "field 'tvDbFrontNumber'", TextView.class);
debitCardHolder.tvDbSecondFrontNumber = (TextView) pyT.e(view, R.id.card_number_2nd_front_text_view, "field 'tvDbSecondFrontNumber'", TextView.class);
debitCardHolder.tvDbPoint = (TextView) pyT.e(view, R.id.tv_point, "field 'tvDbPoint'", TextView.class);
debitCardHolder.ivDbCard = (ImageView) pyT.e(view, R.id.iv_card, "field 'ivDbCard'", ImageView.class);
debitCardHolder.lloverlayContainer = (LinearLayout) pyT.e(view, R.id.ll_overlay_container, "field 'lloverlayContainer'", LinearLayout.class);
debitCardHolder.ivDbThumb = (ImageView) pyT.e(view, R.id.iv_thumb, "field 'ivDbThumb'", ImageView.class);
debitCardHolder.tvDbOverlayDescription = (TextView) pyT.e(view, R.id.tv_overlay_description, "field 'tvDbOverlayDescription'", TextView.class);
debitCardHolder.tvNickName = (TextView) pyT.e(view, R.id.tv_nickname, "field 'tvNickName'", TextView.class);
}
@Override // butterknife.Unbinder
public final void a() {
DebitCardHolder debitCardHolder = this.d;
if (debitCardHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.d = null;
debitCardHolder.tvDbLastNumber = null;
debitCardHolder.tvDbFrontNumber = null;
debitCardHolder.tvDbSecondFrontNumber = null;
debitCardHolder.tvDbPoint = null;
debitCardHolder.ivDbCard = null;
debitCardHolder.lloverlayContainer = null;
debitCardHolder.ivDbThumb = null;
debitCardHolder.tvDbOverlayDescription = null;
debitCardHolder.tvNickName = null;
}
}
public DebitCardDetailAdapter(String str) {
this.c = str;
}
@Override // o.WYJ
public final int getCount() {
List<? extends IU> list = this.b;
if (list != null) {
return list.size();
}
return 0;
}
@Override // o.WYJ
public final void destroyItem(ViewGroup viewGroup, int i, Object obj) {
viewGroup.removeView((View) obj);
}
@Override // o.WYJ
public final Object instantiateItem(ViewGroup viewGroup, int i) {
boolean z;
DebitCardHolder debitCardHolder = new DebitCardHolder(viewGroup, this.c);
IU iu = this.b.get(i);
debitCardHolder.tvDbFrontNumber.setText((String) IU.e(new Object[]{iu}, -1062788666, 1062788667, System.identityHashCode(iu)));
debitCardHolder.tvDbSecondFrontNumber.setText(iu.s());
debitCardHolder.tvDbLastNumber.setText(iu.i());
if (!TextUtils.isEmpty(iu.o())) {
debitCardHolder.tvNickName.setText(iu.o());
debitCardHolder.tvNickName.setVisibility(0);
} else {
debitCardHolder.tvNickName.setVisibility(8);
}
String[] a = iu.a();
int length = a.length;
int i2 = 0;
loop0: while (true) {
if (i2 >= length) {
z = false;
break;
}
String str = a[i2];
for (String str2 : debitCardHolder.d) {
if (str.equalsIgnoreCase(str2)) {
z = true;
break loop0;
}
}
i2++;
}
debitCardHolder.tvDbPoint.setVisibility(8);
debitCardHolder.lloverlayContainer.setVisibility(0);
if (z) {
debitCardHolder.ivDbThumb.setImageResource(R.drawable.ic_lock);
debitCardHolder.tvDbOverlayDescription.setText(iu.m());
} else if (!TextUtils.isEmpty(iu.m())) {
debitCardHolder.ivDbThumb.setImageResource(R.mipmap.2131755011);
debitCardHolder.tvDbOverlayDescription.setText(iu.m());
} else {
debitCardHolder.lloverlayContainer.setVisibility(8);
if (iu.v() == 0) {
debitCardHolder.tvDbPoint.setVisibility(8);
} else if (iu.r() != null) {
debitCardHolder.tvDbPoint.setVisibility(0);
debitCardHolder.tvDbPoint.setText(debitCardHolder.b);
debitCardHolder.tvDbPoint.setBackgroundResource(R.drawable.trapezoid_gray);
} else if (iu.g() == null) {
debitCardHolder.tvDbPoint.setVisibility(8);
} else {
debitCardHolder.tvDbPoint.setVisibility(0);
debitCardHolder.tvDbPoint.setText(String.format("%s %s", iu.g().b, (String) IU.e(new Object[]{iu}, -103287250, 103287254, System.identityHashCode(iu))));
debitCardHolder.tvDbPoint.setBackgroundResource(R.drawable.trapezoid_purple);
}
}
C13020fOa e = Picasso.d().e(iu.d());
Bitmap.Config config = Bitmap.Config.RGB_565;
fNW.IeS ieS = e.a;
if (config != null) {
ieS.a = config;
e.b(R.drawable.default_card_without_logo).e(R.drawable.default_card_without_logo).aBu_(debitCardHolder.ivDbCard, null);
viewGroup.addView(debitCardHolder.itemView);
return debitCardHolder.itemView;
}
throw new IllegalArgumentException("config == null");
}
/* loaded from: classes5.dex */
public static class DebitCardHolder extends RecyclerView.zJl {
final String b;
String[] d;
@BindView
ImageView ivDbCard;
@BindView
ImageView ivDbThumb;
@BindView
LinearLayout lloverlayContainer;
@BindView
TextView tvDbFrontNumber;
@BindView
TextView tvDbLastNumber;
@BindView
TextView tvDbOverlayDescription;
@BindView
TextView tvDbPoint;
@BindView
TextView tvDbSecondFrontNumber;
@BindView
TextView tvNickName;
public DebitCardHolder(ViewGroup viewGroup, String str) {
super(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559990, viewGroup, false));
this.d = new String[]{"OVERLAY_TEMP_LOCK", "OVERLAY_MCARD_UNABLE", "OVERLAY_OTHER_UNABLE"};
this.b = str;
ButterKnife.c(this, this.itemView);
}
}
}