what-the-bank/sources/com/scb/phone/view/adapter/prepaid/PrepaidTransactionAdapter.java

374 lines
16 KiB
Java

package com.scb.phone.view.adapter.prepaid;
import android.content.Context;
import android.graphics.PorterDuff;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
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.BaseExpandableRecycleViewAdapter;
import java.util.ArrayList;
import java.util.List;
import o.AbstractC5347brN;
import o.C1040Uh;
import o.C1062Uu;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class PrepaidTransactionAdapter extends BaseExpandableRecycleViewAdapter {
public boolean a;
private Context c;
public List<C1062Uu> d;
private boolean e;
/* loaded from: classes5.dex */
public class ChildViewHolder_ViewBinding implements Unbinder {
private ChildViewHolder b;
public ChildViewHolder_ViewBinding(ChildViewHolder childViewHolder, View view) {
this.b = childViewHolder;
childViewHolder.description = (TextView) pyT.e(view, R.id.unbilled_description_value, "field 'description'", TextView.class);
childViewHolder.titleDescription = (TextView) pyT.e(view, R.id.description_text_view, "field 'titleDescription'", TextView.class);
childViewHolder.titlePostDate = (TextView) pyT.e(view, R.id.post_date_text_view, "field 'titlePostDate'", TextView.class);
childViewHolder.postDate = (TextView) pyT.e(view, R.id.unbilled_post_date_value, "field 'postDate'", TextView.class);
childViewHolder.originalCurrency = (TextView) pyT.e(view, R.id.original_currency_text_view, "field 'originalCurrency'", TextView.class);
childViewHolder.foreignCurrency = (TextView) pyT.e(view, R.id.unbilled_foreign_currency_value, "field 'foreignCurrency'", TextView.class);
childViewHolder.titleCategory = (TextView) pyT.e(view, R.id.categories_text_view, "field 'titleCategory'", TextView.class);
childViewHolder.category = (TextView) pyT.e(view, R.id.unbilled_category_value, "field 'category'", TextView.class);
}
@Override // butterknife.Unbinder
public final void a() {
ChildViewHolder childViewHolder = this.b;
if (childViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.b = null;
childViewHolder.description = null;
childViewHolder.titleDescription = null;
childViewHolder.titlePostDate = null;
childViewHolder.postDate = null;
childViewHolder.originalCurrency = null;
childViewHolder.foreignCurrency = null;
childViewHolder.titleCategory = null;
childViewHolder.category = null;
}
}
/* loaded from: classes5.dex */
public class ParentViewHolder_ViewBinding extends BaseExpandableRecycleViewAdapter.BaseParentViewHolder_ViewBinding {
private ParentViewHolder d;
public ParentViewHolder_ViewBinding(ParentViewHolder parentViewHolder, View view) {
super(parentViewHolder, view);
this.d = parentViewHolder;
parentViewHolder.containerPrepaid = (RelativeLayout) pyT.e(view, R.id.billed_detail_container, "field 'containerPrepaid'", RelativeLayout.class);
parentViewHolder.titlePrepaid = (TextView) pyT.e(view, R.id.billed_detail_title, "field 'titlePrepaid'", TextView.class);
parentViewHolder.valuePrepaid = (TextView) pyT.e(view, R.id.billed_detail_value, "field 'valuePrepaid'", TextView.class);
parentViewHolder.datePrepaid = (TextView) pyT.e(view, R.id.billed_detail_date, "field 'datePrepaid'", TextView.class);
parentViewHolder.billedPending = (TextView) pyT.e(view, R.id.billed_pending, "field 'billedPending'", TextView.class);
parentViewHolder.expandIconImageView = (ImageView) pyT.e(view, R.id.expand_icon_image_view, "field 'expandIconImageView'", ImageView.class);
parentViewHolder.linePrepaid = pyT.a(view, R.id.billed_line, "field 'linePrepaid'");
parentViewHolder.verticalLinePrepaid = pyT.a(view, R.id.billed_vertical_line_view, "field 'verticalLinePrepaid'");
}
@Override // com.scb.phone.view.adapter.BaseExpandableRecycleViewAdapter.BaseParentViewHolder_ViewBinding, butterknife.Unbinder
public final void a() {
ParentViewHolder parentViewHolder = this.d;
if (parentViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.d = null;
parentViewHolder.containerPrepaid = null;
parentViewHolder.titlePrepaid = null;
parentViewHolder.valuePrepaid = null;
parentViewHolder.datePrepaid = null;
parentViewHolder.billedPending = null;
parentViewHolder.expandIconImageView = null;
parentViewHolder.linePrepaid = null;
parentViewHolder.verticalLinePrepaid = null;
super.a();
}
}
public PrepaidTransactionAdapter(Context context) {
super(context);
this.d = new ArrayList();
this.a = false;
}
public PrepaidTransactionAdapter(Context context, byte b) {
super(context);
this.d = new ArrayList();
this.a = false;
this.e = true;
}
@Override // o.Qpt
public final int d() {
if (this.a) {
return this.d.size() + 1;
}
return this.d.size();
}
@Override // o.pvT, o.Qpt
public final int c(int i) {
return i < this.d.size() ? 1 : 0;
}
@Override // o.Qpt
public final RecyclerView.zJl anX_(ViewGroup viewGroup, int i) {
this.c = viewGroup.getContext();
LayoutInflater from = LayoutInflater.from(viewGroup.getContext());
if (i == 1) {
return new ParentViewHolder(from.inflate(R.layout.2131559086, viewGroup, false));
}
return new Sts(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559248, viewGroup, false));
}
@Override // o.Qpt
public final RecyclerView.zJl anW_(ViewGroup viewGroup, int i) {
return new ChildViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559091, viewGroup, false));
}
@Override // o.Qpt
public final void d(RecyclerView.zJl zjl, int i) {
String obj;
if (zjl instanceof ParentViewHolder) {
ParentViewHolder parentViewHolder = (ParentViewHolder) zjl;
C1062Uu c1062Uu = this.d.get(i);
if (c1062Uu == null) {
parentViewHolder.titlePrepaid.setText("Loading");
return;
}
parentViewHolder.titlePrepaid.setText(c1062Uu.a);
parentViewHolder.datePrepaid.setText(c1062Uu.h);
if (i > 0 && i < this.d.size()) {
parentViewHolder.linePrepaid.setVisibility(0);
} else {
parentViewHolder.linePrepaid.setVisibility(4);
}
if (i == this.d.size() - 1) {
parentViewHolder.verticalLinePrepaid.setVisibility(8);
} else {
parentViewHolder.verticalLinePrepaid.setVisibility(0);
}
if (this.e) {
if ("A".equalsIgnoreCase(c1062Uu.f8400o)) {
StringBuilder sb = new StringBuilder();
sb.append(c1062Uu.b);
sb.append(" ");
sb.append(c1062Uu.c);
String obj2 = sb.toString();
if ("C".equalsIgnoreCase(c1062Uu.j)) {
obj = "+".concat(String.valueOf(obj2));
} else {
obj = "-".concat(String.valueOf(obj2));
}
} else {
StringBuilder sb2 = new StringBuilder();
sb2.append(c1062Uu.i);
sb2.append(" ");
sb2.append(c1062Uu.f);
String obj3 = sb2.toString();
if ("C".equalsIgnoreCase(c1062Uu.j)) {
obj = "+".concat(String.valueOf(obj3));
} else {
obj = "-".concat(String.valueOf(obj3));
}
}
} else if (!"A".equalsIgnoreCase(c1062Uu.f8400o)) {
if ("C".equalsIgnoreCase(c1062Uu.j)) {
StringBuilder sb3 = new StringBuilder("+");
sb3.append(c1062Uu.i);
obj = sb3.toString();
} else {
StringBuilder sb4 = new StringBuilder("-");
sb4.append(c1062Uu.i);
obj = sb4.toString();
}
} else {
String str = "THB".equalsIgnoreCase(c1062Uu.c) ? "" : c1062Uu.c;
if ("C".equalsIgnoreCase(c1062Uu.j)) {
StringBuilder sb5 = new StringBuilder();
sb5.append(str);
sb5.append(" +");
sb5.append(c1062Uu.b);
obj = sb5.toString();
} else {
StringBuilder sb6 = new StringBuilder();
sb6.append(str);
sb6.append(" -");
sb6.append(c1062Uu.b);
obj = sb6.toString();
}
}
parentViewHolder.valuePrepaid.setText(obj);
if ("A".equalsIgnoreCase(c1062Uu.f8400o)) {
parentViewHolder.billedPending.setVisibility(0);
parentViewHolder.expandIconImageView.setColorFilter(nMh.getColor(this.b, R.color.f3412131099849), PorterDuff.Mode.SRC_ATOP);
parentViewHolder.titlePrepaid.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
parentViewHolder.datePrepaid.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
parentViewHolder.valuePrepaid.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
} else {
parentViewHolder.billedPending.setVisibility(8);
parentViewHolder.expandIconImageView.setColorFilter(nMh.getColor(this.b, R.color.f2982131099805), PorterDuff.Mode.SRC_ATOP);
parentViewHolder.titlePrepaid.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
parentViewHolder.datePrepaid.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
if ("C".equalsIgnoreCase(c1062Uu.j)) {
parentViewHolder.valuePrepaid.setTextColor(nMh.getColor(this.b, R.color.f3432131099851));
} else {
parentViewHolder.valuePrepaid.setTextColor(nMh.getColor(this.b, R.color.f3462131099854));
}
}
BaseExpandableRecycleViewAdapter.a(parentViewHolder);
}
}
@Override // o.Qpt
public final void c(RecyclerView.zJl zjl, int i, int i2) {
if (zjl instanceof ChildViewHolder) {
ChildViewHolder childViewHolder = (ChildViewHolder) zjl;
C1062Uu c1062Uu = this.d.get(i);
TextView textView = childViewHolder.category;
C1040Uh c1040Uh = c1062Uu.e;
textView.setText(c1040Uh != null ? c1040Uh.a : null);
childViewHolder.description.setText(c1062Uu.d);
if (this.e || "A".equalsIgnoreCase(c1062Uu.f8400o) || "THB".equalsIgnoreCase(c1062Uu.c) || TextUtils.isEmpty(c1062Uu.c)) {
childViewHolder.originalCurrency.setVisibility(8);
childViewHolder.foreignCurrency.setVisibility(8);
} else {
childViewHolder.originalCurrency.setVisibility(0);
childViewHolder.foreignCurrency.setVisibility(0);
TextView textView2 = childViewHolder.foreignCurrency;
StringBuilder sb = new StringBuilder();
sb.append(c1062Uu.c);
sb.append(" ");
sb.append(c1062Uu.b);
textView2.setText(sb.toString());
}
childViewHolder.postDate.setText(c1062Uu.g);
if ("A".equalsIgnoreCase(c1062Uu.f8400o)) {
childViewHolder.titleDescription.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
childViewHolder.description.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
childViewHolder.originalCurrency.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
childViewHolder.foreignCurrency.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
childViewHolder.titlePostDate.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
childViewHolder.postDate.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
childViewHolder.titleCategory.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
childViewHolder.category.setTextColor(nMh.getColor(this.c, R.color.f3412131099849));
childViewHolder.postDate.setText("-");
return;
}
childViewHolder.titleDescription.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
childViewHolder.description.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
childViewHolder.originalCurrency.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
childViewHolder.foreignCurrency.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
childViewHolder.titlePostDate.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
childViewHolder.postDate.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
childViewHolder.titleCategory.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
childViewHolder.category.setTextColor(nMh.getColor(this.c, R.color.f2982131099805));
}
}
@Override // com.scb.phone.view.adapter.BaseExpandableRecycleViewAdapter, o.Qpt
public final boolean b(RecyclerView.zJl zjl) {
return zjl instanceof ParentViewHolder;
}
public final void b(boolean z) {
this.a = z;
if (z) {
notifyItemInserted(this.d.size());
} else {
if (this.d.isEmpty()) {
return;
}
notifyItemRemoved(this.d.size());
}
}
/* loaded from: classes5.dex */
static class ParentViewHolder extends BaseExpandableRecycleViewAdapter.BaseParentViewHolder {
@BindView
TextView billedPending;
@BindView
RelativeLayout containerPrepaid;
@BindView
TextView datePrepaid;
@BindView
ImageView expandIconImageView;
@BindView
View linePrepaid;
@BindView
TextView titlePrepaid;
@BindView
TextView valuePrepaid;
@BindView
View verticalLinePrepaid;
ParentViewHolder(View view) {
super(view);
ButterKnife.c(this, view);
}
}
/* loaded from: classes5.dex */
static class ChildViewHolder extends AbstractC5347brN {
@BindView
TextView category;
@BindView
TextView description;
@BindView
TextView foreignCurrency;
@BindView
TextView originalCurrency;
@BindView
TextView postDate;
@BindView
TextView titleCategory;
@BindView
TextView titleDescription;
@BindView
TextView titlePostDate;
ChildViewHolder(View view) {
super(view);
ButterKnife.c(this, view);
}
}
/* loaded from: classes5.dex */
static class Sts extends AbstractC5347brN {
Sts(View view) {
super(view);
}
}
}