507 lines
19 KiB
Java
507 lines
19 KiB
Java
package com.scb.phone.view.adapter.accountsummary;
|
|
|
|
import android.content.Context;
|
|
import android.graphics.Color;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.graphics.drawable.GradientDrawable;
|
|
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.constraintlayout.widget.ConstraintLayout;
|
|
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.accountsummary.DepositViewPagerAdapter;
|
|
import java.util.List;
|
|
import o.C0386Fk;
|
|
import o.C14957gcv;
|
|
import o.C6583cXR;
|
|
import o.InterfaceC8958daf;
|
|
import o.WYJ;
|
|
import o.gHK;
|
|
import o.gdZ;
|
|
import o.guQ;
|
|
import o.pyT;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public final class DepositViewPagerAdapter extends WYJ {
|
|
public boolean a;
|
|
public final List<C0386Fk> b;
|
|
private final Context c;
|
|
public InterfaceC8958daf d;
|
|
private boolean e;
|
|
private final gHK f;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public final class ItemViewHolder_ViewBinding implements Unbinder {
|
|
private ItemViewHolder e;
|
|
|
|
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
|
|
this.e = itemViewHolder;
|
|
itemViewHolder.llLayoutDepositSummaryDetail = (LinearLayout) pyT.e(view, R.id.ll_layout_deposit_summary_detail, "field 'llLayoutDepositSummaryDetail'", LinearLayout.class);
|
|
itemViewHolder.llLayoutDepositSummaryError = (LinearLayout) pyT.e(view, R.id.ll_layout_deposit_summary_error, "field 'llLayoutDepositSummaryError'", LinearLayout.class);
|
|
itemViewHolder.llLayoutDepositSummaryLoading = (LinearLayout) pyT.e(view, R.id.ll_layout_deposit_summary_loading, "field 'llLayoutDepositSummaryLoading'", LinearLayout.class);
|
|
itemViewHolder.tvDepositName = (TextView) pyT.e(view, R.id.tv_deposit_name, "field 'tvDepositName'", TextView.class);
|
|
itemViewHolder.tvDepositAccount = (TextView) pyT.e(view, R.id.tv_deposit_account, "field 'tvDepositAccount'", TextView.class);
|
|
itemViewHolder.tvDepositTotalAmount = (TextView) pyT.e(view, R.id.tv_deposit_total_amount, "field 'tvDepositTotalAmount'", TextView.class);
|
|
itemViewHolder.llLayoutLastTransactions = (LinearLayout) pyT.e(view, R.id.ll_layout_deposit_last_transactions, "field 'llLayoutLastTransactions'", LinearLayout.class);
|
|
itemViewHolder.llLayoutLatestStatements = (LinearLayout) pyT.e(view, R.id.ll_layout_latest_statements, "field 'llLayoutLatestStatements'", LinearLayout.class);
|
|
itemViewHolder.llLayoutLatestStatementsError = (LinearLayout) pyT.e(view, R.id.ll_layout_latest_statements_error, "field 'llLayoutLatestStatementsError'", LinearLayout.class);
|
|
itemViewHolder.tvErrorTitle = (TextView) pyT.e(view, R.id.tv_error_title, "field 'tvErrorTitle'", TextView.class);
|
|
itemViewHolder.tvErrorMessage = (TextView) pyT.e(view, R.id.tv_error_message, "field 'tvErrorMessage'", TextView.class);
|
|
itemViewHolder.csLayoutRemarkAccount = (ConstraintLayout) pyT.e(view, R.id.cs_layout_remark_account, "field 'csLayoutRemarkAccount'", ConstraintLayout.class);
|
|
itemViewHolder.tvRemarkTitle = (TextView) pyT.e(view, R.id.tv_remark_account_title, "field 'tvRemarkTitle'", TextView.class);
|
|
itemViewHolder.ivIcon = (ImageView) pyT.e(view, R.id.iv_icon, "field 'ivIcon'", ImageView.class);
|
|
itemViewHolder.tvDepositTag = (TextView) pyT.e(view, R.id.tv_deposit_tag, "field 'tvDepositTag'", TextView.class);
|
|
itemViewHolder.tvDepositHappyCashLimit = (TextView) pyT.e(view, R.id.tv_deposit_happy_cash_limit, "field 'tvDepositHappyCashLimit'", TextView.class);
|
|
}
|
|
|
|
@Override // butterknife.Unbinder
|
|
public final void a() {
|
|
ItemViewHolder itemViewHolder = this.e;
|
|
if (itemViewHolder == null) {
|
|
throw new IllegalStateException("Bindings already cleared.");
|
|
}
|
|
this.e = null;
|
|
itemViewHolder.llLayoutDepositSummaryDetail = null;
|
|
itemViewHolder.llLayoutDepositSummaryError = null;
|
|
itemViewHolder.llLayoutDepositSummaryLoading = null;
|
|
itemViewHolder.tvDepositName = null;
|
|
itemViewHolder.tvDepositAccount = null;
|
|
itemViewHolder.tvDepositTotalAmount = null;
|
|
itemViewHolder.llLayoutLastTransactions = null;
|
|
itemViewHolder.llLayoutLatestStatements = null;
|
|
itemViewHolder.llLayoutLatestStatementsError = null;
|
|
itemViewHolder.tvErrorTitle = null;
|
|
itemViewHolder.tvErrorMessage = null;
|
|
itemViewHolder.csLayoutRemarkAccount = null;
|
|
itemViewHolder.tvRemarkTitle = null;
|
|
itemViewHolder.ivIcon = null;
|
|
itemViewHolder.tvDepositTag = null;
|
|
itemViewHolder.tvDepositHappyCashLimit = null;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public DepositViewPagerAdapter(Context context, List<? extends C0386Fk> list, gHK ghk) {
|
|
C14957gcv.e(context, "");
|
|
C14957gcv.e(list, "");
|
|
C14957gcv.e(ghk, "");
|
|
this.c = context;
|
|
this.b = list;
|
|
this.f = ghk;
|
|
this.e = gHK.JURISTIC == ghk;
|
|
}
|
|
|
|
@Override // o.WYJ
|
|
public final int getCount() {
|
|
Integer num = this.a ? 1 : null;
|
|
return num != null ? num.intValue() : this.b.size();
|
|
}
|
|
|
|
@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) {
|
|
C14957gcv.e(viewGroup, "");
|
|
View inflate = LayoutInflater.from(this.c).inflate(R.layout.2131559098, viewGroup, false);
|
|
C14957gcv.c(inflate, "");
|
|
ItemViewHolder itemViewHolder = new ItemViewHolder(this, inflate);
|
|
ImageView imageView = null;
|
|
if (this.a) {
|
|
C0386Fk c = C0386Fk.c();
|
|
C14957gcv.c(c, "");
|
|
itemViewHolder.b(c);
|
|
LinearLayout linearLayout = itemViewHolder.llLayoutDepositSummaryError;
|
|
if (linearLayout == null) {
|
|
C14957gcv.a("");
|
|
linearLayout = null;
|
|
}
|
|
linearLayout.setVisibility(4);
|
|
LinearLayout linearLayout2 = itemViewHolder.llLayoutDepositSummaryDetail;
|
|
if (linearLayout2 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout2 = null;
|
|
}
|
|
linearLayout2.setVisibility(4);
|
|
LinearLayout linearLayout3 = itemViewHolder.llLayoutDepositSummaryLoading;
|
|
if (linearLayout3 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout3 = null;
|
|
}
|
|
linearLayout3.setVisibility(0);
|
|
} else {
|
|
C0386Fk c0386Fk = this.b.get(i);
|
|
if (!c0386Fk.e) {
|
|
C0386Fk c2 = C0386Fk.c();
|
|
C14957gcv.c(c2, "");
|
|
itemViewHolder.b(c2);
|
|
LinearLayout linearLayout4 = itemViewHolder.llLayoutDepositSummaryError;
|
|
if (linearLayout4 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout4 = null;
|
|
}
|
|
linearLayout4.setVisibility(0);
|
|
LinearLayout linearLayout5 = itemViewHolder.llLayoutDepositSummaryDetail;
|
|
if (linearLayout5 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout5 = null;
|
|
}
|
|
linearLayout5.setVisibility(4);
|
|
LinearLayout linearLayout6 = itemViewHolder.llLayoutDepositSummaryLoading;
|
|
if (linearLayout6 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout6 = null;
|
|
}
|
|
linearLayout6.setVisibility(8);
|
|
} else {
|
|
itemViewHolder.b(c0386Fk);
|
|
itemViewHolder.itemView.setOnClickListener(new View.OnClickListener(this, i) { // from class: o.eqP
|
|
private DepositViewPagerAdapter b;
|
|
private int c;
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
DepositViewPagerAdapter.a(this.b, this.c);
|
|
}
|
|
|
|
{
|
|
this.b = this;
|
|
this.c = i;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
if (this.e) {
|
|
ImageView imageView2 = itemViewHolder.ivIcon;
|
|
if (imageView2 != null) {
|
|
imageView = imageView2;
|
|
} else {
|
|
C14957gcv.a("");
|
|
}
|
|
imageView.setImageResource(R.drawable.ic_account_summary_juristic);
|
|
}
|
|
View view = itemViewHolder.itemView;
|
|
C14957gcv.c(view, "");
|
|
viewGroup.addView(view, 0);
|
|
return view;
|
|
}
|
|
|
|
/* loaded from: classes5.dex */
|
|
public final class ItemViewHolder extends RecyclerView.zJl {
|
|
private final View a;
|
|
|
|
@BindView
|
|
public ConstraintLayout csLayoutRemarkAccount;
|
|
private DepositViewPagerAdapter d;
|
|
|
|
@BindView
|
|
public ImageView ivIcon;
|
|
|
|
@BindView
|
|
public LinearLayout llLayoutDepositSummaryDetail;
|
|
|
|
@BindView
|
|
public LinearLayout llLayoutDepositSummaryError;
|
|
|
|
@BindView
|
|
public LinearLayout llLayoutDepositSummaryLoading;
|
|
|
|
@BindView
|
|
public LinearLayout llLayoutLastTransactions;
|
|
|
|
@BindView
|
|
public LinearLayout llLayoutLatestStatements;
|
|
|
|
@BindView
|
|
public LinearLayout llLayoutLatestStatementsError;
|
|
|
|
@BindView
|
|
public TextView tvDepositAccount;
|
|
|
|
@BindView
|
|
public TextView tvDepositHappyCashLimit;
|
|
|
|
@BindView
|
|
public TextView tvDepositName;
|
|
|
|
@BindView
|
|
public TextView tvDepositTag;
|
|
|
|
@BindView
|
|
public TextView tvDepositTotalAmount;
|
|
|
|
@BindView
|
|
public TextView tvErrorMessage;
|
|
|
|
@BindView
|
|
public TextView tvErrorTitle;
|
|
|
|
@BindView
|
|
public TextView tvRemarkTitle;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public ItemViewHolder(DepositViewPagerAdapter depositViewPagerAdapter, View view) {
|
|
super(view);
|
|
C14957gcv.e(view, "");
|
|
this.d = depositViewPagerAdapter;
|
|
this.a = view;
|
|
ButterKnife.c(this, view);
|
|
}
|
|
|
|
public final void b(C0386Fk c0386Fk) {
|
|
String str;
|
|
C14957gcv.e(c0386Fk, "");
|
|
LinearLayout linearLayout = this.llLayoutDepositSummaryError;
|
|
if (linearLayout == null) {
|
|
C14957gcv.a("");
|
|
linearLayout = null;
|
|
}
|
|
linearLayout.setVisibility(4);
|
|
LinearLayout linearLayout2 = this.llLayoutDepositSummaryDetail;
|
|
if (linearLayout2 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout2 = null;
|
|
}
|
|
linearLayout2.setVisibility(0);
|
|
LinearLayout linearLayout3 = this.llLayoutDepositSummaryLoading;
|
|
if (linearLayout3 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout3 = null;
|
|
}
|
|
linearLayout3.setVisibility(8);
|
|
String str2 = c0386Fk.v;
|
|
if (str2 != null && str2.length() != 0) {
|
|
TextView textView = this.tvDepositName;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
textView.setText(str2);
|
|
TextView textView2 = this.tvDepositAccount;
|
|
if (textView2 == null) {
|
|
C14957gcv.a("");
|
|
textView2 = null;
|
|
}
|
|
textView2.setText(c0386Fk.b);
|
|
} else {
|
|
String a = C6583cXR.a(c0386Fk.A, c0386Fk.u);
|
|
TextView textView3 = this.tvDepositName;
|
|
if (textView3 == null) {
|
|
C14957gcv.a("");
|
|
textView3 = null;
|
|
}
|
|
textView3.setText(a);
|
|
TextView textView4 = this.tvDepositAccount;
|
|
if (textView4 == null) {
|
|
C14957gcv.a("");
|
|
textView4 = null;
|
|
}
|
|
textView4.setText(c0386Fk.b);
|
|
}
|
|
TextView textView5 = this.tvDepositTotalAmount;
|
|
if (textView5 == null) {
|
|
C14957gcv.a("");
|
|
textView5 = null;
|
|
}
|
|
textView5.setText(c0386Fk.f);
|
|
if (c0386Fk.H) {
|
|
TextView textView6 = this.tvDepositTag;
|
|
if (textView6 == null) {
|
|
C14957gcv.a("");
|
|
textView6 = null;
|
|
}
|
|
textView6.setVisibility(0);
|
|
TextView textView7 = this.tvDepositTag;
|
|
if (textView7 == null) {
|
|
C14957gcv.a("");
|
|
textView7 = null;
|
|
}
|
|
Drawable drawable = textView7.getResources().getDrawable(R.drawable.bg_rounded_rectangle_borderless);
|
|
C14957gcv.d(drawable, "");
|
|
GradientDrawable gradientDrawable = (GradientDrawable) drawable;
|
|
try {
|
|
gradientDrawable.setColor(Color.parseColor(c0386Fk.f8173o));
|
|
TextView textView8 = this.tvDepositTag;
|
|
if (textView8 == null) {
|
|
C14957gcv.a("");
|
|
textView8 = null;
|
|
}
|
|
textView8.setText(c0386Fk.l);
|
|
textView8.setBackground(gradientDrawable);
|
|
} catch (IllegalArgumentException e) {
|
|
guQ.e(e, "Invalid color code sent from server", new Object[0]);
|
|
}
|
|
} else {
|
|
TextView textView9 = this.tvDepositTag;
|
|
if (textView9 == null) {
|
|
C14957gcv.a("");
|
|
textView9 = null;
|
|
}
|
|
textView9.setVisibility(8);
|
|
}
|
|
TextView textView10 = this.tvDepositHappyCashLimit;
|
|
if (textView10 == null) {
|
|
C14957gcv.a("");
|
|
textView10 = null;
|
|
}
|
|
Integer num = c0386Fk.z ? 0 : null;
|
|
textView10.setVisibility(num != null ? num.intValue() : 4);
|
|
textView10.setText(c0386Fk.C);
|
|
b();
|
|
String str3 = c0386Fk.t;
|
|
if ((str3 != null && !gdZ.d((CharSequence) str3)) || ((str = c0386Fk.p) != null && !gdZ.d((CharSequence) str))) {
|
|
d(c0386Fk);
|
|
} else if (c0386Fk.B) {
|
|
c(c0386Fk);
|
|
}
|
|
}
|
|
|
|
private final void b() {
|
|
LinearLayout linearLayout = this.llLayoutLastTransactions;
|
|
LinearLayout linearLayout2 = null;
|
|
if (linearLayout == null) {
|
|
C14957gcv.a("");
|
|
linearLayout = null;
|
|
}
|
|
linearLayout.removeAllViews();
|
|
LinearLayout linearLayout3 = this.llLayoutLatestStatements;
|
|
if (linearLayout3 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout3 = null;
|
|
}
|
|
linearLayout3.setVisibility(0);
|
|
LinearLayout linearLayout4 = this.llLayoutLatestStatementsError;
|
|
if (linearLayout4 != null) {
|
|
linearLayout2 = linearLayout4;
|
|
} else {
|
|
C14957gcv.a("");
|
|
}
|
|
linearLayout2.setVisibility(4);
|
|
}
|
|
|
|
private final void d(C0386Fk c0386Fk) {
|
|
String str = c0386Fk.t;
|
|
String str2 = c0386Fk.p;
|
|
LinearLayout linearLayout = this.llLayoutLatestStatements;
|
|
TextView textView = null;
|
|
if (linearLayout == null) {
|
|
C14957gcv.a("");
|
|
linearLayout = null;
|
|
}
|
|
linearLayout.setVisibility(4);
|
|
LinearLayout linearLayout2 = this.llLayoutLatestStatementsError;
|
|
if (linearLayout2 == null) {
|
|
C14957gcv.a("");
|
|
linearLayout2 = null;
|
|
}
|
|
linearLayout2.setVisibility(0);
|
|
TextView textView2 = this.tvErrorTitle;
|
|
if (textView2 == null) {
|
|
C14957gcv.a("");
|
|
textView2 = null;
|
|
}
|
|
textView2.setVisibility(str != null ? 0 : 4);
|
|
TextView textView3 = this.tvErrorTitle;
|
|
if (textView3 == null) {
|
|
C14957gcv.a("");
|
|
textView3 = null;
|
|
}
|
|
if (str == null) {
|
|
str = "";
|
|
}
|
|
textView3.setText(str);
|
|
TextView textView4 = this.tvErrorMessage;
|
|
if (textView4 == null) {
|
|
C14957gcv.a("");
|
|
textView4 = null;
|
|
}
|
|
textView4.setVisibility(str2 != null ? 0 : 4);
|
|
TextView textView5 = this.tvErrorMessage;
|
|
if (textView5 != null) {
|
|
textView = textView5;
|
|
} else {
|
|
C14957gcv.a("");
|
|
}
|
|
if (str2 == null) {
|
|
str2 = "";
|
|
}
|
|
textView.setText(str2);
|
|
}
|
|
|
|
private final void c(C0386Fk c0386Fk) {
|
|
String str = c0386Fk.k;
|
|
ConstraintLayout constraintLayout = this.csLayoutRemarkAccount;
|
|
TextView textView = null;
|
|
if (constraintLayout == null) {
|
|
C14957gcv.a("");
|
|
constraintLayout = null;
|
|
}
|
|
constraintLayout.setVisibility(0);
|
|
LinearLayout linearLayout = this.llLayoutLatestStatements;
|
|
if (linearLayout == null) {
|
|
C14957gcv.a("");
|
|
linearLayout = null;
|
|
}
|
|
linearLayout.setVisibility(4);
|
|
TextView textView2 = this.tvRemarkTitle;
|
|
if (textView2 == null) {
|
|
C14957gcv.a("");
|
|
textView2 = null;
|
|
}
|
|
textView2.setVisibility(str == null ? 4 : 0);
|
|
TextView textView3 = this.tvRemarkTitle;
|
|
if (textView3 != null) {
|
|
textView = textView3;
|
|
} else {
|
|
C14957gcv.a("");
|
|
}
|
|
if (str == null) {
|
|
str = "";
|
|
}
|
|
textView.setText(str);
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes5.dex */
|
|
public static final class RVV {
|
|
private RVV() {
|
|
}
|
|
|
|
public /* synthetic */ RVV(byte b) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void a(DepositViewPagerAdapter depositViewPagerAdapter, int i) {
|
|
C14957gcv.e(depositViewPagerAdapter, "");
|
|
InterfaceC8958daf interfaceC8958daf = depositViewPagerAdapter.d;
|
|
if (interfaceC8958daf != null) {
|
|
interfaceC8958daf.b(i);
|
|
}
|
|
}
|
|
|
|
@Override // o.WYJ
|
|
public final boolean isViewFromObject(View view, Object obj) {
|
|
C14957gcv.e(view, "");
|
|
C14957gcv.e(obj, "");
|
|
return view == obj;
|
|
}
|
|
|
|
static {
|
|
new RVV((byte) 0);
|
|
}
|
|
}
|