what-the-bank/sources/com/scb/phone/view/adapter/accountsummary/InvestmentViewPagerAdapter....

209 lines
7.9 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.adapter.accountsummary;
import android.content.Context;
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 butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.scb.phone.R;
import com.scb.phone.view.adapter.accountsummary.InvestmentViewPagerAdapter;
import com.squareup.picasso.Picasso;
import java.util.List;
import o.QD;
import o.WYJ;
import o.pyT;
/* loaded from: classes5.dex */
public final class InvestmentViewPagerAdapter extends WYJ {
private Sts c;
private final List<QD> d;
private LayoutInflater e;
/* loaded from: classes5.dex */
public interface Sts {
void b(int i);
void c();
}
@Override // o.WYJ
public final boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
/* loaded from: classes5.dex */
public class ViewHolder_ViewBinding implements Unbinder {
private ViewHolder b;
public ViewHolder_ViewBinding(ViewHolder viewHolder, View view) {
this.b = viewHolder;
viewHolder.mErrorDescription = (TextView) pyT.e(view, R.id.error_description, "field 'mErrorDescription'", TextView.class);
viewHolder.mCardTitle = (TextView) pyT.e(view, R.id.tv_card_title, "field 'mCardTitle'", TextView.class);
viewHolder.mTotalBalance = (TextView) pyT.e(view, R.id.tv_investment_total_balance_text_view, "field 'mTotalBalance'", TextView.class);
viewHolder.mNetGain = (TextView) pyT.e(view, R.id.tv_investment_net_gain_text_view, "field 'mNetGain'", TextView.class);
viewHolder.mLastUpdatedDate = (TextView) pyT.e(view, R.id.tv_investment_last_updated_date_text_view, "field 'mLastUpdatedDate'", TextView.class);
viewHolder.mLastUpdatedDateTitle = (TextView) pyT.e(view, R.id.tv_investment_last_updated_date_title, "field 'mLastUpdatedDateTitle'", TextView.class);
viewHolder.mNetGainIndicator = (ImageView) pyT.e(view, R.id.iv_investment_gain_indicator, "field 'mNetGainIndicator'", ImageView.class);
viewHolder.investmentCardErrorLayout = (LinearLayout) pyT.e(view, R.id.my_investment_card_error, "field 'investmentCardErrorLayout'", LinearLayout.class);
viewHolder.investmentCardLayout = (LinearLayout) pyT.e(view, R.id.ll_layout_investment_card_contents, "field 'investmentCardLayout'", LinearLayout.class);
viewHolder.cardBg = (ImageView) pyT.e(view, R.id.iv_card_bg, "field 'cardBg'", ImageView.class);
viewHolder.investmentIcon = (ImageView) pyT.e(view, R.id.iv_investment_icon, "field 'investmentIcon'", ImageView.class);
viewHolder.tvInvestmentRemarkDataSharing = (TextView) pyT.e(view, R.id.tv_investment_remark_data_sharing, "field 'tvInvestmentRemarkDataSharing'", TextView.class);
}
@Override // butterknife.Unbinder
public final void a() {
ViewHolder viewHolder = this.b;
if (viewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.b = null;
viewHolder.mErrorDescription = null;
viewHolder.mCardTitle = null;
viewHolder.mTotalBalance = null;
viewHolder.mNetGain = null;
viewHolder.mLastUpdatedDate = null;
viewHolder.mLastUpdatedDateTitle = null;
viewHolder.mNetGainIndicator = null;
viewHolder.investmentCardErrorLayout = null;
viewHolder.investmentCardLayout = null;
viewHolder.cardBg = null;
viewHolder.investmentIcon = null;
viewHolder.tvInvestmentRemarkDataSharing = null;
}
}
public InvestmentViewPagerAdapter(Context context, List<QD> list, Sts sts) {
this.e = (LayoutInflater) context.getSystemService("layout_inflater");
this.c = sts;
this.d = list;
}
@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) {
ViewHolder viewHolder = new ViewHolder(this.e.inflate(R.layout.2131559151, viewGroup, false));
final QD qd = this.d.get(i);
final Sts sts = this.c;
if (TextUtils.isEmpty(qd.b)) {
viewHolder.investmentCardErrorLayout.setVisibility(8);
viewHolder.investmentCardLayout.setVisibility(0);
String str = qd.f;
if (str.length() > 18) {
viewHolder.mTotalBalance.setTextSize(0, viewHolder.b.getResources().getDimension(R.dimen.f28292131166595));
}
viewHolder.mTotalBalance.setText(str);
viewHolder.mNetGainIndicator.setImageResource(qd.c);
viewHolder.mNetGain.setTextColor(viewHolder.b.getResources().getColor(qd.h));
viewHolder.mNetGain.setText(qd.g);
viewHolder.mLastUpdatedDate.setText(qd.d);
viewHolder.mCardTitle.setText(qd.i);
Picasso.d().e(qd.j).aBu_(viewHolder.investmentIcon, null);
if (qd.f8320o == 0) {
viewHolder.cardBg.setImageResource(R.drawable.bg_investment_card);
viewHolder.tvInvestmentRemarkDataSharing.setVisibility(0);
} else {
viewHolder.cardBg.setImageResource(R.drawable.bg_scbs_card);
viewHolder.tvInvestmentRemarkDataSharing.setVisibility(8);
}
if (qd.a) {
viewHolder.mLastUpdatedDateTitle.setVisibility(8);
viewHolder.mLastUpdatedDate.setVisibility(8);
}
viewHolder.b.setOnClickListener(new View.OnClickListener(sts, qd) { // from class: o.eqW
private QD d;
private InvestmentViewPagerAdapter.Sts e;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
this.e.b(this.d.f8320o);
}
{
this.e = sts;
this.d = qd;
}
});
} else {
viewHolder.investmentCardErrorLayout.setVisibility(0);
viewHolder.investmentCardLayout.setVisibility(8);
viewHolder.mErrorDescription.setText(qd.b);
viewHolder.investmentCardErrorLayout.setOnClickListener(new View.OnClickListener(sts) { // from class: o.eqT
private InvestmentViewPagerAdapter.Sts e;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
this.e.c();
}
{
this.e = sts;
}
});
}
viewGroup.addView(viewHolder.b, 0);
return viewHolder.b;
}
/* loaded from: classes5.dex */
public static class ViewHolder {
final View b;
@BindView
ImageView cardBg;
@BindView
LinearLayout investmentCardErrorLayout;
@BindView
LinearLayout investmentCardLayout;
@BindView
ImageView investmentIcon;
@BindView
TextView mCardTitle;
@BindView
TextView mErrorDescription;
@BindView
TextView mLastUpdatedDate;
@BindView
TextView mLastUpdatedDateTitle;
@BindView
TextView mNetGain;
@BindView
ImageView mNetGainIndicator;
@BindView
TextView mTotalBalance;
@BindView
TextView tvInvestmentRemarkDataSharing;
public ViewHolder(View view) {
this.b = view;
ButterKnife.c(this, view);
}
}
}