147 lines
5.1 KiB
Java
147 lines
5.1 KiB
Java
|
package com.scb.phone.view.adapter.easycash;
|
||
|
|
||
|
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.scb.phone.view.custom.common.ThaiTextView;
|
||
|
import com.squareup.picasso.Picasso;
|
||
|
import java.util.List;
|
||
|
import o.JO;
|
||
|
import o.WYJ;
|
||
|
import o.nMh;
|
||
|
import o.pyT;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public final class CardLoanOfferViewPagerAdapter extends WYJ {
|
||
|
private boolean a;
|
||
|
private boolean b;
|
||
|
private List<JO> d;
|
||
|
public int e = 0;
|
||
|
|
||
|
@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 ItemViewHolder_ViewBinding implements Unbinder {
|
||
|
private ItemViewHolder d;
|
||
|
|
||
|
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
|
||
|
this.d = itemViewHolder;
|
||
|
itemViewHolder.card = pyT.a(view, R.id.card, "field 'card'");
|
||
|
itemViewHolder.name = (TextView) pyT.e(view, R.id.card_name_text_view, "field 'name'", TextView.class);
|
||
|
itemViewHolder.description = (ThaiTextView) pyT.e(view, R.id.card_description_text_view, "field 'description'", ThaiTextView.class);
|
||
|
itemViewHolder.imageCardArt = (ImageView) pyT.e(view, R.id.image_card_art, "field 'imageCardArt'", ImageView.class);
|
||
|
itemViewHolder.imageCardFull = (ImageView) pyT.e(view, R.id.image_card_full, "field 'imageCardFull'", ImageView.class);
|
||
|
itemViewHolder.cardDots = (LinearLayout) pyT.e(view, R.id.credit_card_dots_linear_layout, "field 'cardDots'", LinearLayout.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.card = null;
|
||
|
itemViewHolder.name = null;
|
||
|
itemViewHolder.description = null;
|
||
|
itemViewHolder.imageCardArt = null;
|
||
|
itemViewHolder.imageCardFull = null;
|
||
|
itemViewHolder.cardDots = null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public CardLoanOfferViewPagerAdapter(List<JO> list, boolean z, boolean z2) {
|
||
|
this.d = list;
|
||
|
this.a = z;
|
||
|
this.b = z2;
|
||
|
}
|
||
|
|
||
|
@Override // o.WYJ
|
||
|
public final int getCount() {
|
||
|
return this.d.size();
|
||
|
}
|
||
|
|
||
|
@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) {
|
||
|
View view;
|
||
|
LayoutInflater layoutInflater = (LayoutInflater) viewGroup.getContext().getSystemService("layout_inflater");
|
||
|
JO jo = this.d.get(i);
|
||
|
if (!jo.e) {
|
||
|
view = layoutInflater.inflate(R.layout.2131559016, viewGroup, false);
|
||
|
} else {
|
||
|
View inflate = layoutInflater.inflate(R.layout.2131559171, viewGroup, false);
|
||
|
ItemViewHolder itemViewHolder = new ItemViewHolder(inflate, this.a, this.b);
|
||
|
if (itemViewHolder.b) {
|
||
|
itemViewHolder.imageCardFull.setVisibility(0);
|
||
|
itemViewHolder.imageCardArt.setVisibility(8);
|
||
|
} else {
|
||
|
itemViewHolder.imageCardFull.setVisibility(8);
|
||
|
itemViewHolder.imageCardArt.setVisibility(0);
|
||
|
}
|
||
|
itemViewHolder.name.setText(jo.b);
|
||
|
itemViewHolder.description.setText(jo.a);
|
||
|
Picasso.d().e(jo.d).e(R.drawable.default_card_without_logo).b(R.drawable.default_card).aBu_(itemViewHolder.b ? itemViewHolder.imageCardFull : itemViewHolder.imageCardArt, null);
|
||
|
itemViewHolder.card.setTag("TAG_ACCOUNT_SELECTOR_ADAPTER_BACKGROUND".concat(String.valueOf(i)));
|
||
|
itemViewHolder.cardDots.setVisibility(itemViewHolder.a ? 0 : 8);
|
||
|
itemViewHolder.card.setBackground(nMh.getDrawable(viewGroup.getContext(), this.e == i ? R.drawable.rounded_purple_view_pager : R.drawable.bg_white_rounded));
|
||
|
view = inflate;
|
||
|
}
|
||
|
viewGroup.addView(view, 0);
|
||
|
return view;
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
static class ItemViewHolder extends RecyclerView.zJl {
|
||
|
boolean a;
|
||
|
boolean b;
|
||
|
|
||
|
@BindView
|
||
|
View card;
|
||
|
|
||
|
@BindView
|
||
|
LinearLayout cardDots;
|
||
|
private View d;
|
||
|
|
||
|
@BindView
|
||
|
ThaiTextView description;
|
||
|
|
||
|
@BindView
|
||
|
ImageView imageCardArt;
|
||
|
|
||
|
@BindView
|
||
|
ImageView imageCardFull;
|
||
|
|
||
|
@BindView
|
||
|
TextView name;
|
||
|
|
||
|
ItemViewHolder(View view, boolean z, boolean z2) {
|
||
|
super(view);
|
||
|
this.d = view;
|
||
|
this.a = z;
|
||
|
this.b = z2;
|
||
|
ButterKnife.c(this, view);
|
||
|
}
|
||
|
}
|
||
|
}
|