237 lines
9.8 KiB
Java
237 lines
9.8 KiB
Java
package com.scb.phone.view.adapter.accountsummary;
|
|
|
|
import android.content.Context;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
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.adapter.accountsummary.MerchantWalletViewPagerAdapter;
|
|
import com.scb.phone.view.custom.common.CustomMerchantRecentTransaction;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import o.RK;
|
|
import o.RO;
|
|
import o.RU;
|
|
import o.WYJ;
|
|
import o.pyT;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public final class MerchantWalletViewPagerAdapter extends WYJ {
|
|
public List<RK> b;
|
|
public boolean c;
|
|
private LayoutInflater d;
|
|
public HBt e;
|
|
|
|
@FunctionalInterface
|
|
/* loaded from: classes5.dex */
|
|
public interface HBt {
|
|
void e(int i, List<RK> list);
|
|
}
|
|
|
|
@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 e;
|
|
|
|
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
|
|
this.e = itemViewHolder;
|
|
itemViewHolder.layoutMerchantDetail = (ViewGroup) pyT.e(view, R.id.layout_merchant_detail, "field 'layoutMerchantDetail'", ViewGroup.class);
|
|
itemViewHolder.layoutMerchantDetailError = (ViewGroup) pyT.e(view, R.id.layout_merchant_detail_error, "field 'layoutMerchantDetailError'", ViewGroup.class);
|
|
itemViewHolder.layoutMerchantDetailLoading = (ViewGroup) pyT.e(view, R.id.layout_merchant_detail_loading, "field 'layoutMerchantDetailLoading'", ViewGroup.class);
|
|
itemViewHolder.textMerchantWalletName = (TextView) pyT.e(view, R.id.deposit_name_text_view, "field 'textMerchantWalletName'", TextView.class);
|
|
itemViewHolder.textMerchantWalletAccount = (TextView) pyT.e(view, R.id.deposit_account_text_view, "field 'textMerchantWalletAccount'", TextView.class);
|
|
itemViewHolder.textMerchantWalletTotalAmount = (TextView) pyT.e(view, R.id.deposit_total_amount_text_view, "field 'textMerchantWalletTotalAmount'", TextView.class);
|
|
itemViewHolder.layoutMerchantWalletLastTransactions = (LinearLayout) pyT.e(view, R.id.deposit_last_transactions_linear_layout, "field 'layoutMerchantWalletLastTransactions'", LinearLayout.class);
|
|
itemViewHolder.viewMerchantWalletLatestStatements = pyT.a(view, R.id.view_latest_statements, "field 'viewMerchantWalletLatestStatements'");
|
|
itemViewHolder.viewMerchantWalletLatestStatementsError = pyT.a(view, R.id.view_latest_statements_error, "field 'viewMerchantWalletLatestStatementsError'");
|
|
itemViewHolder.textMerchantWalletErrorTitle = (TextView) pyT.e(view, R.id.text_error_title, "field 'textMerchantWalletErrorTitle'", TextView.class);
|
|
itemViewHolder.textMerchantWalletErrorMessage = (TextView) pyT.e(view, R.id.text_error_message, "field 'textMerchantWalletErrorMessage'", 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.layoutMerchantDetail = null;
|
|
itemViewHolder.layoutMerchantDetailError = null;
|
|
itemViewHolder.layoutMerchantDetailLoading = null;
|
|
itemViewHolder.textMerchantWalletName = null;
|
|
itemViewHolder.textMerchantWalletAccount = null;
|
|
itemViewHolder.textMerchantWalletTotalAmount = null;
|
|
itemViewHolder.layoutMerchantWalletLastTransactions = null;
|
|
itemViewHolder.viewMerchantWalletLatestStatements = null;
|
|
itemViewHolder.viewMerchantWalletLatestStatementsError = null;
|
|
itemViewHolder.textMerchantWalletErrorTitle = null;
|
|
itemViewHolder.textMerchantWalletErrorMessage = null;
|
|
}
|
|
}
|
|
|
|
public MerchantWalletViewPagerAdapter(Context context, List<RK> list) {
|
|
this.d = (LayoutInflater) context.getSystemService("layout_inflater");
|
|
this.b = list == null ? new ArrayList<>() : list;
|
|
this.c = false;
|
|
}
|
|
|
|
@Override // o.WYJ
|
|
public final int getCount() {
|
|
if (this.c) {
|
|
return 1;
|
|
}
|
|
return this.b.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, final int i) {
|
|
ItemViewHolder itemViewHolder = new ItemViewHolder(this.d.inflate(R.layout.2131559180, (ViewGroup) null));
|
|
if (this.c) {
|
|
itemViewHolder.a(new RK());
|
|
itemViewHolder.layoutMerchantDetailError.setVisibility(8);
|
|
itemViewHolder.layoutMerchantDetail.setVisibility(4);
|
|
itemViewHolder.layoutMerchantDetailLoading.setVisibility(0);
|
|
} else {
|
|
RK rk = this.b.get(i);
|
|
if (rk.e) {
|
|
itemViewHolder.a(rk);
|
|
itemViewHolder.itemView.setOnClickListener(new View.OnClickListener(this, i) { // from class: o.eqU
|
|
private int b;
|
|
private MerchantWalletViewPagerAdapter c;
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
MerchantWalletViewPagerAdapter.d(this.c, this.b);
|
|
}
|
|
|
|
{
|
|
this.c = this;
|
|
this.b = i;
|
|
}
|
|
});
|
|
} else {
|
|
itemViewHolder.a(rk);
|
|
itemViewHolder.layoutMerchantDetailError.setVisibility(0);
|
|
itemViewHolder.layoutMerchantDetail.setVisibility(4);
|
|
itemViewHolder.layoutMerchantDetailLoading.setVisibility(8);
|
|
}
|
|
}
|
|
View view = itemViewHolder.itemView;
|
|
viewGroup.addView(view, 0);
|
|
return view;
|
|
}
|
|
|
|
/* loaded from: classes5.dex */
|
|
static class ItemViewHolder extends RecyclerView.zJl {
|
|
|
|
@BindView
|
|
ViewGroup layoutMerchantDetail;
|
|
|
|
@BindView
|
|
ViewGroup layoutMerchantDetailError;
|
|
|
|
@BindView
|
|
ViewGroup layoutMerchantDetailLoading;
|
|
|
|
@BindView
|
|
LinearLayout layoutMerchantWalletLastTransactions;
|
|
|
|
@BindView
|
|
TextView textMerchantWalletAccount;
|
|
|
|
@BindView
|
|
TextView textMerchantWalletErrorMessage;
|
|
|
|
@BindView
|
|
TextView textMerchantWalletErrorTitle;
|
|
|
|
@BindView
|
|
TextView textMerchantWalletName;
|
|
|
|
@BindView
|
|
TextView textMerchantWalletTotalAmount;
|
|
|
|
@BindView
|
|
View viewMerchantWalletLatestStatements;
|
|
|
|
@BindView
|
|
View viewMerchantWalletLatestStatementsError;
|
|
|
|
ItemViewHolder(View view) {
|
|
super(view);
|
|
ButterKnife.c(this, view);
|
|
}
|
|
|
|
final void a(RK rk) {
|
|
this.layoutMerchantDetailError.setVisibility(8);
|
|
this.layoutMerchantDetail.setVisibility(0);
|
|
this.layoutMerchantDetailLoading.setVisibility(8);
|
|
this.textMerchantWalletName.setText(rk.c);
|
|
this.textMerchantWalletAccount.setText(rk.i);
|
|
this.textMerchantWalletTotalAmount.setText(rk.h);
|
|
RO ro = rk.j;
|
|
if (ro != null && ro.b != null && !ro.b.isEmpty()) {
|
|
a(ro.b);
|
|
} else {
|
|
c();
|
|
}
|
|
}
|
|
|
|
private void a(List<RU> list) {
|
|
View view;
|
|
this.viewMerchantWalletLatestStatements.setVisibility(0);
|
|
this.viewMerchantWalletLatestStatementsError.setVisibility(8);
|
|
if (this.layoutMerchantWalletLastTransactions.getChildCount() > 0) {
|
|
this.layoutMerchantWalletLastTransactions.removeAllViews();
|
|
}
|
|
for (int i = 0; i < 2; i++) {
|
|
CustomMerchantRecentTransaction customMerchantRecentTransaction = new CustomMerchantRecentTransaction(this.itemView.getContext());
|
|
if (i < list.size()) {
|
|
customMerchantRecentTransaction.setRecentTransactionDisplay(list.get(i));
|
|
}
|
|
if (i > 0 && list.size() > 1 && (view = customMerchantRecentTransaction.borderView) != null) {
|
|
view.setVisibility(0);
|
|
}
|
|
this.layoutMerchantWalletLastTransactions.addView(customMerchantRecentTransaction);
|
|
}
|
|
}
|
|
|
|
private void c() {
|
|
View view;
|
|
this.viewMerchantWalletLatestStatements.setVisibility(4);
|
|
this.viewMerchantWalletLatestStatementsError.setVisibility(0);
|
|
this.textMerchantWalletErrorTitle.setVisibility(8);
|
|
this.textMerchantWalletErrorMessage.setText(R.string.account_summary_no_last_transaction);
|
|
for (int i = 0; i < 2; i++) {
|
|
CustomMerchantRecentTransaction customMerchantRecentTransaction = new CustomMerchantRecentTransaction(this.itemView.getContext());
|
|
if (i > 0 && (view = customMerchantRecentTransaction.borderView) != null) {
|
|
view.setVisibility(0);
|
|
}
|
|
this.layoutMerchantWalletLastTransactions.addView(customMerchantRecentTransaction);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void d(MerchantWalletViewPagerAdapter merchantWalletViewPagerAdapter, int i) {
|
|
HBt hBt = merchantWalletViewPagerAdapter.e;
|
|
if (hBt != null) {
|
|
hBt.e(i, merchantWalletViewPagerAdapter.b);
|
|
}
|
|
}
|
|
}
|