package com.scb.phone.view.adapter.transferandpay; import android.app.Activity; import android.content.Context; import android.graphics.drawable.Drawable; 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.activity.BaseActivity; import com.scb.phone.view.adapter.BaseExpandableRecycleViewAdapter; import com.scb.phone.view.adapter.transferandpay.HistoryAdapter; import java.util.ArrayList; import o.AbstractC5347brN; import o.C1089Vj; import o.C1094Vm; import o.C12891fKc; import o.C13072fPs; import o.C14866gag; import o.C14957gcv; import o.C16148leh; import o.CfC; import o.InterfaceC14890gbN; import o.InterfaceC14894gbR; import o.kIT; import o.nMh; import o.pyT; /* loaded from: classes5.dex */ public final class HistoryAdapter extends BaseExpandableRecycleViewAdapter { public String a; public String c; public String d; public final ArrayList e; private C16148leh f; private InterfaceC14894gbR g; private InterfaceC14894gbR h; private Sts i; private int j; private InterfaceC14890gbN k; private View.OnClickListener l; /* loaded from: classes5.dex */ protected interface LWm { void e(int i); } /* loaded from: classes5.dex */ public enum Sts { LOADING, ERROR, NONE } /* loaded from: classes5.dex */ public final class ChildViewHolder_ViewBinding implements Unbinder { private ChildViewHolder e; public ChildViewHolder_ViewBinding(ChildViewHolder childViewHolder, View view) { this.e = childViewHolder; childViewHolder.repeatView = pyT.a(view, R.id.view_group_repeat, "field 'repeatView'"); childViewHolder.regenerateView = pyT.a(view, R.id.view_group_regenerate, "field 'regenerateView'"); } @Override // butterknife.Unbinder public final void a() { ChildViewHolder childViewHolder = this.e; if (childViewHolder == null) { throw new IllegalStateException("Bindings already cleared."); } this.e = null; childViewHolder.repeatView = null; childViewHolder.regenerateView = null; } } /* loaded from: classes5.dex */ public final class GroupFooterViewHolder_ViewBinding implements Unbinder { private GroupFooterViewHolder b; public GroupFooterViewHolder_ViewBinding(GroupFooterViewHolder groupFooterViewHolder, View view) { this.b = groupFooterViewHolder; groupFooterViewHolder.remarkTextView = (TextView) pyT.e(view, R.id.history_remark_text_view, "field 'remarkTextView'", TextView.class); } @Override // butterknife.Unbinder public final void a() { GroupFooterViewHolder groupFooterViewHolder = this.b; if (groupFooterViewHolder == null) { throw new IllegalStateException("Bindings already cleared."); } this.b = null; groupFooterViewHolder.remarkTextView = null; } } /* loaded from: classes5.dex */ public final class GroupErrorViewHolder_ViewBinding implements Unbinder { private GroupErrorViewHolder b; public GroupErrorViewHolder_ViewBinding(GroupErrorViewHolder groupErrorViewHolder, View view) { this.b = groupErrorViewHolder; groupErrorViewHolder.emptyCard = (RelativeLayout) pyT.e(view, R.id.empty_container_relative_layout, "field 'emptyCard'", RelativeLayout.class); groupErrorViewHolder.emptyTitle = (TextView) pyT.e(view, R.id.empty_title_text_view, "field 'emptyTitle'", TextView.class); groupErrorViewHolder.emptyDescription = (TextView) pyT.e(view, R.id.empty_description_text_view, "field 'emptyDescription'", TextView.class); groupErrorViewHolder.emptyImage = (ImageView) pyT.e(view, R.id.empty_button_image_view, "field 'emptyImage'", ImageView.class); } @Override // butterknife.Unbinder public final void a() { GroupErrorViewHolder groupErrorViewHolder = this.b; if (groupErrorViewHolder == null) { throw new IllegalStateException("Bindings already cleared."); } this.b = null; groupErrorViewHolder.emptyCard = null; groupErrorViewHolder.emptyTitle = null; groupErrorViewHolder.emptyDescription = null; groupErrorViewHolder.emptyImage = null; } } /* loaded from: classes5.dex */ public final class GroupItemViewHolder_ViewBinding extends BaseExpandableRecycleViewAdapter.BaseParentViewHolder_ViewBinding { private GroupItemViewHolder d; public GroupItemViewHolder_ViewBinding(GroupItemViewHolder groupItemViewHolder, View view) { super(groupItemViewHolder, view); this.d = groupItemViewHolder; groupItemViewHolder.container = pyT.a(view, R.id.container, "field 'container'"); groupItemViewHolder.billerImageView = (ImageView) pyT.e(view, R.id.iv_biller_image, "field 'billerImageView'", ImageView.class); groupItemViewHolder.textReference = (TextView) pyT.e(view, R.id.text_reference, "field 'textReference'", TextView.class); groupItemViewHolder.textTitle = (TextView) pyT.e(view, R.id.text_title, "field 'textTitle'", TextView.class); groupItemViewHolder.textAmount = (TextView) pyT.e(view, R.id.text_amount, "field 'textAmount'", TextView.class); groupItemViewHolder.textTimestamp = (TextView) pyT.e(view, R.id.text_timestamp, "field 'textTimestamp'", TextView.class); groupItemViewHolder.dividerView = pyT.a(view, R.id.v_divider, "field 'dividerView'"); groupItemViewHolder.endOfTableView = pyT.a(view, R.id.v_end_of_table, "field 'endOfTableView'"); } @Override // com.scb.phone.view.adapter.BaseExpandableRecycleViewAdapter.BaseParentViewHolder_ViewBinding, butterknife.Unbinder public final void a() { GroupItemViewHolder groupItemViewHolder = this.d; if (groupItemViewHolder == null) { throw new IllegalStateException("Bindings already cleared."); } this.d = null; groupItemViewHolder.container = null; groupItemViewHolder.billerImageView = null; groupItemViewHolder.textReference = null; groupItemViewHolder.textTitle = null; groupItemViewHolder.textAmount = null; groupItemViewHolder.textTimestamp = null; groupItemViewHolder.dividerView = null; groupItemViewHolder.endOfTableView = null; super.a(); } } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public HistoryAdapter(Context context, C16148leh c16148leh, InterfaceC14894gbR interfaceC14894gbR, InterfaceC14894gbR interfaceC14894gbR2, InterfaceC14890gbN interfaceC14890gbN) { super(context); C14957gcv.e(context, ""); C14957gcv.e(c16148leh, ""); C14957gcv.e(interfaceC14894gbR, ""); C14957gcv.e(interfaceC14894gbR2, ""); C14957gcv.e(interfaceC14890gbN, ""); this.f = c16148leh; this.h = interfaceC14894gbR; this.g = interfaceC14894gbR2; this.k = interfaceC14890gbN; this.e = new ArrayList<>(); this.i = Sts.NONE; this.j = -1; String string = this.b.getResources().getString(R.string.auto_regen_repeat_history_error_state_title); C14957gcv.c((Object) string, ""); this.a = string; String string2 = this.b.getResources().getString(R.string.auto_regen_repeat_history_error_state_message); C14957gcv.c((Object) string2, ""); this.d = string2; this.l = new View.OnClickListener(this) { // from class: o.ezK private HistoryAdapter e; @Override // android.view.View.OnClickListener public final void onClick(View view) { HistoryAdapter.a(this.e, view); } { this.e = this; } }; } /* loaded from: classes5.dex */ public static final class IeS { private IeS() { } public /* synthetic */ IeS(byte b) { this(); } } public final void d(Sts sts) { C14957gcv.e(sts, ""); if (sts != this.i) { int size = this.e.size() > 0 ? this.e.size() - 1 : 0; this.i = sts; int i = HBt.d[sts.ordinal()]; if (i != 1 && i != 2) { if (i == 3) { this.e.remove(size); notifyItemRemoved(this.e.size()); return; } return; } if (this.e.size() <= 0 || this.e.get(size) != null) { this.e.add(null); notifyItemInserted(size); } else { notifyItemChanged(size); } } } @Override // o.pvT, o.Qpt public final int c(int i) { if (i >= this.e.size()) { return 2; } if (this.e.get(i) == null && this.i == Sts.LOADING) { return 0; } return (this.e.get(i) == null && this.i == Sts.ERROR) ? 3 : 1; } @Override // o.Qpt public final int d() { String str = this.c; return (str == null || str.length() == 0) ? this.e.size() : this.e.size() + 1; } @Override // o.Qpt public final RecyclerView.zJl anX_(ViewGroup viewGroup, int i) { C14957gcv.e(viewGroup, ""); if (i == 0) { View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559246, viewGroup, false); C14957gcv.c(inflate, ""); return new RVV(this, inflate); } if (i == 1) { View inflate2 = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559243, viewGroup, false); C14957gcv.c(inflate2, ""); return new GroupItemViewHolder(this, inflate2, this.l); } if (i != 2) { if (i == 3) { return anV_(viewGroup); } return anV_(viewGroup); } View inflate3 = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559245, viewGroup, false); C14957gcv.c(inflate3, ""); return new GroupFooterViewHolder(this, inflate3); } @Override // o.Qpt public final RecyclerView.zJl anW_(ViewGroup viewGroup, int i) { C14957gcv.e(viewGroup, ""); View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559244, viewGroup, false); C14957gcv.c(inflate, ""); return new ChildViewHolder(this, inflate); } /* JADX WARN: Multi-variable type inference failed */ @Override // o.Qpt public final void d(RecyclerView.zJl zjl, int i) { C14957gcv.e(zjl, ""); if (zjl instanceof LWm) { ((LWm) zjl).e(i); } } @Override // o.Qpt public final void c(RecyclerView.zJl zjl, int i, int i2) { C14957gcv.e(zjl, ""); if (zjl instanceof ChildViewHolder) { ChildViewHolder childViewHolder = (ChildViewHolder) zjl; final C1089Vj c1089Vj = childViewHolder.e.e.get(i); View view = childViewHolder.repeatView; View view2 = null; if (view == null) { C14957gcv.a(""); view = null; } view.setVisibility((c1089Vj == null || !c1089Vj.k) ? 8 : 0); View view3 = childViewHolder.regenerateView; if (view3 == null) { C14957gcv.a(""); view3 = null; } view3.setVisibility((c1089Vj == null || !c1089Vj.i) ? 8 : 0); if (c1089Vj != null) { View view4 = childViewHolder.repeatView; if (view4 == null) { C14957gcv.a(""); view4 = null; } final HistoryAdapter historyAdapter = childViewHolder.e; view4.setOnClickListener(new View.OnClickListener(historyAdapter, c1089Vj) { // from class: o.ezN private HistoryAdapter a; private C1089Vj c; @Override // android.view.View.OnClickListener public final void onClick(View view5) { HistoryAdapter.ChildViewHolder.e(this.a, this.c); } { this.a = historyAdapter; this.c = c1089Vj; } }); View view5 = childViewHolder.regenerateView; if (view5 != null) { view2 = view5; } else { C14957gcv.a(""); } final HistoryAdapter historyAdapter2 = childViewHolder.e; view2.setOnClickListener(new View.OnClickListener(historyAdapter2, c1089Vj) { // from class: o.ezP private C1089Vj a; private HistoryAdapter d; @Override // android.view.View.OnClickListener public final void onClick(View view6) { HistoryAdapter.ChildViewHolder.a(this.d, this.a); } { this.d = historyAdapter2; this.a = c1089Vj; } }); } } } /* JADX INFO: Access modifiers changed from: private */ public final boolean e(int i) { C1089Vj c1089Vj; if (i <= this.e.size() && (c1089Vj = this.e.get(i)) != null) { return c1089Vj.k || c1089Vj.i; } return false; } private final RecyclerView.zJl anV_(ViewGroup viewGroup) { View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559147, viewGroup, false); C14957gcv.c(inflate, ""); return new GroupErrorViewHolder(this, inflate, this.a, this.d); } /* loaded from: classes5.dex */ protected final class RVV extends AbstractC5347brN { private HistoryAdapter e; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public RVV(HistoryAdapter historyAdapter, View view) { super(view); C14957gcv.e(view, ""); this.e = historyAdapter; } } /* loaded from: classes5.dex */ protected final class GroupFooterViewHolder extends AbstractC5347brN implements LWm { private HistoryAdapter b; @BindView public TextView remarkTextView; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public GroupFooterViewHolder(HistoryAdapter historyAdapter, View view) { super(view); C14957gcv.e(view, ""); this.b = historyAdapter; ButterKnife.c(this, view); } @Override // com.scb.phone.view.adapter.transferandpay.HistoryAdapter.LWm public final void e(int i) { TextView textView = this.remarkTextView; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(this.b.c); } } /* loaded from: classes5.dex */ public final class GroupErrorViewHolder extends AbstractC5347brN implements LWm { private final String b; private HistoryAdapter d; private final String e; @BindView public RelativeLayout emptyCard; @BindView public TextView emptyDescription; @BindView public ImageView emptyImage; @BindView public TextView emptyTitle; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public GroupErrorViewHolder(HistoryAdapter historyAdapter, View view, String str, String str2) { super(view); C14957gcv.e(view, ""); C14957gcv.e(str, ""); C14957gcv.e(str2, ""); this.d = historyAdapter; this.b = str; this.e = str2; ButterKnife.c(this, view); } @Override // com.scb.phone.view.adapter.transferandpay.HistoryAdapter.LWm public final void e(int i) { RelativeLayout relativeLayout = this.emptyCard; TextView textView = null; if (relativeLayout == null) { C14957gcv.a(""); relativeLayout = null; } final HistoryAdapter historyAdapter = this.d; relativeLayout.setOnClickListener(new View.OnClickListener(historyAdapter) { // from class: o.ezM private HistoryAdapter c; @Override // android.view.View.OnClickListener public final void onClick(View view) { HistoryAdapter.GroupErrorViewHolder.c(this.c); } { this.c = historyAdapter; } }); RelativeLayout relativeLayout2 = this.emptyCard; if (relativeLayout2 == null) { C14957gcv.a(""); relativeLayout2 = null; } relativeLayout2.setVisibility(0); TextView textView2 = this.emptyTitle; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(this.b); TextView textView3 = this.emptyDescription; if (textView3 != null) { textView = textView3; } else { C14957gcv.a(""); } textView.setText(this.e); } public static /* synthetic */ void c(HistoryAdapter historyAdapter) { C14957gcv.e(historyAdapter, ""); historyAdapter.k.invoke(); } } /* JADX INFO: Access modifiers changed from: protected */ /* loaded from: classes5.dex */ public final class GroupItemViewHolder extends BaseExpandableRecycleViewAdapter.BaseParentViewHolder implements LWm { @BindView public ImageView billerImageView; @BindView public View container; @BindView public View dividerView; private HistoryAdapter e; @BindView public View endOfTableView; @BindView public TextView textAmount; @BindView public TextView textReference; @BindView public TextView textTimestamp; @BindView public TextView textTitle; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public GroupItemViewHolder(HistoryAdapter historyAdapter, View view, View.OnClickListener onClickListener) { super(view); C14957gcv.e(view, ""); C14957gcv.e(onClickListener, ""); this.e = historyAdapter; ButterKnife.c(this, view); View view2 = this.container; if (view2 == null) { C14957gcv.a(""); view2 = null; } view2.setOnClickListener(onClickListener); } @Override // com.scb.phone.view.adapter.transferandpay.HistoryAdapter.LWm public final void e(int i) { String str; ImageView imageView; String str2; C1094Vm c1094Vm; String str3; C1094Vm c1094Vm2; C1089Vj c1089Vj = (C1089Vj) this.e.e.get(i); TextView textView = this.textTitle; if (textView == null) { C14957gcv.a(""); textView = null; } if (c1089Vj == null || (c1094Vm2 = c1089Vj.j) == null || (str = c1094Vm2.e) == null) { str = c1089Vj != null ? c1089Vj.d : null; } textView.setText(str); TextView textView2 = this.textAmount; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(c1089Vj != null ? c1089Vj.e : null); TextView textView3 = this.textTimestamp; if (textView3 == null) { C14957gcv.a(""); textView3 = null; } textView3.setText(c1089Vj != null ? c1089Vj.f8423o : null); TextView textView4 = this.textReference; if (textView4 == null) { C14957gcv.a(""); textView4 = null; } textView4.setText(c1089Vj != null ? c1089Vj.a : null); boolean z = i == this.e.e.size() - 1; View view = this.dividerView; if (view == null) { C14957gcv.a(""); view = null; } view.setVisibility(z ? 8 : 0); View view2 = this.endOfTableView; if (view2 == null) { C14957gcv.a(""); view2 = null; } view2.setVisibility(z ? 0 : 8); Context context = this.e.b; if (context != null) { Drawable drawable = nMh.getDrawable(context, R.drawable.biller_place_holder); ImageView imageView2 = this.billerImageView; if (imageView2 != null) { imageView = imageView2; } else { C14957gcv.a(""); imageView = null; } if (c1089Vj == null || (c1094Vm = c1089Vj.j) == null || (str3 = c1094Vm.a) == null) { str2 = c1089Vj != null ? c1089Vj.b : null; } else { str2 = str3; } C12891fKc.azg_(context, drawable, imageView, str2, context.getResources().getDimensionPixelOffset(R.dimen.f27732131166539), nMh.getColor(context, R.color.f3412131099849)); } if (!this.e.e(i)) { this.itemView.setClickable(false); this.expandIcon.setVisibility(8); } else { this.itemView.setClickable(true); this.expandIcon.setVisibility(0); } BaseExpandableRecycleViewAdapter.a(this); } } /* loaded from: classes5.dex */ public final class ChildViewHolder extends AbstractC5347brN { final HistoryAdapter e; @BindView public View regenerateView; @BindView public View repeatView; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public ChildViewHolder(HistoryAdapter historyAdapter, View view) { super(view); C14957gcv.e(view, ""); this.e = historyAdapter; ButterKnife.c(this, view); } public static /* synthetic */ void a(HistoryAdapter historyAdapter, C1089Vj c1089Vj) { C14957gcv.e(historyAdapter, ""); historyAdapter.g.invoke(c1089Vj); } public static /* synthetic */ void e(HistoryAdapter historyAdapter, C1089Vj c1089Vj) { C14957gcv.e(historyAdapter, ""); historyAdapter.h.invoke(c1089Vj); } } public static /* synthetic */ void a(HistoryAdapter historyAdapter, View view) { RecyclerView.zJl a; int adapterPosition; int i; View currentFocus; C14957gcv.e(historyAdapter, ""); C14957gcv.c(view, ""); if (view.getId() != R.id.container || (a = CfC.a(view)) == null || (adapterPosition = a.getAdapterPosition()) == -1) { return; } kIT kit = historyAdapter.f.j; long c = kit == null ? -1L : kit.g.c(adapterPosition); int i2 = (int) c; if (historyAdapter.e(i2)) { Context e = C13072fPs.e(historyAdapter.b); if (e instanceof BaseActivity) { ((BaseActivity) e).aN_(); } if (((int) (c >>> 32)) == -1) { Context e2 = C13072fPs.e(historyAdapter.b); if (e2 != null && (currentFocus = ((Activity) e2).getCurrentFocus()) != null) { currentFocus.clearFocus(); } if (!historyAdapter.f.d(i2)) { historyAdapter.f.e(); kIT kit2 = historyAdapter.f.j; if (kit2 != null) { kit2.a(i2, false); } } else { kIT kit3 = historyAdapter.f.j; if (kit3 != null) { kit3.e(i2, false); } } } if ((a instanceof GroupItemViewHolder) && (i = historyAdapter.j) >= 0 && i != adapterPosition) { historyAdapter.notifyDataSetChanged(); } historyAdapter.j = adapterPosition; } } /* loaded from: classes5.dex */ public final /* synthetic */ class HBt { public static final int[] d; static { int[] iArr = new int[Sts.values().length]; try { iArr[Sts.LOADING.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { iArr[Sts.ERROR.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { iArr[Sts.NONE.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } d = iArr; } } @Override // com.scb.phone.view.adapter.BaseExpandableRecycleViewAdapter, o.Qpt public final boolean b(RecyclerView.zJl zjl) { C14957gcv.e(zjl, ""); return false; } static { new IeS((byte) 0); } }