package o; import android.content.Context; 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 java.util.Iterator; import java.util.List; import o.C12856fJS; /* renamed from: o.ezB, reason: case insensitive filesystem */ /* loaded from: classes5.dex */ public final class C12485ezB extends RecyclerView.Sts { public boolean a; boolean b; public double c; public LWm d; List e; int h; /* renamed from: o.ezB$LWm */ /* loaded from: classes5.dex */ public interface LWm { void b(); void d(double d); } public C12485ezB(boolean z, List list, double d) { C14957gcv.e(list, ""); this.b = z; this.e = list; this.c = d; this.h = -1; } /* renamed from: o.ezB$HBt */ /* loaded from: classes5.dex */ public static final class HBt { private HBt() { } public /* synthetic */ HBt(byte b) { this(); } } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final RecyclerView.zJl onCreateViewHolder(ViewGroup viewGroup, int i) { C14957gcv.e(viewGroup, ""); if (i == 1) { View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(com.scb.phone.R.layout.2131559070, viewGroup, false); RelativeLayout relativeLayout = (RelativeLayout) inflate; ImageView imageView = (ImageView) qeC.e(inflate, com.scb.phone.R.id.ic_pencil); if (imageView != null) { Sza sza = new Sza(relativeLayout, relativeLayout, imageView); C14957gcv.c(sza, ""); return new Sts(this, sza); } throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(com.scb.phone.R.id.ic_pencil))); } if (i != 2) { View inflate2 = LayoutInflater.from(viewGroup.getContext()).inflate(com.scb.phone.R.layout.2131559069, viewGroup, false); RelativeLayout relativeLayout2 = (RelativeLayout) inflate2; TextView textView = (TextView) qeC.e(inflate2, com.scb.phone.R.id.amount_text_view); if (textView != null) { lZq lzq = new lZq(relativeLayout2, relativeLayout2, textView); C14957gcv.c(lzq, ""); return new IeS(this, lzq); } throw new NullPointerException("Missing required view with ID: ".concat(inflate2.getResources().getResourceName(com.scb.phone.R.id.amount_text_view))); } View inflate3 = LayoutInflater.from(viewGroup.getContext()).inflate(com.scb.phone.R.layout.2131559068, viewGroup, false); RelativeLayout relativeLayout3 = (RelativeLayout) inflate3; TextView textView2 = (TextView) qeC.e(inflate3, com.scb.phone.R.id.amount_text_view); if (textView2 != null) { Tsd tsd = new Tsd(relativeLayout3, relativeLayout3, textView2); C14957gcv.c(tsd, ""); return new RVV(this, tsd); } throw new NullPointerException("Missing required view with ID: ".concat(inflate3.getResources().getResourceName(com.scb.phone.R.id.amount_text_view))); } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final int getItemViewType(int i) { boolean z = this.b; if (z && i == 0) { return 1; } List list = this.e; if (z) { i--; } return ((double) list.get(i).intValue()) <= this.c ? 2 : 3; } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final int getItemCount() { if (this.e.isEmpty()) { return 0; } return this.e.size() + (this.b ? 1 : 0); } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final void onBindViewHolder(RecyclerView.zJl zjl, int i) { int bindingAdapterPosition; C14957gcv.e(zjl, ""); int itemViewType = getItemViewType(i); int i2 = com.scb.phone.R.color.f14042131100912; int i3 = com.scb.phone.R.drawable.bg_button_amount_purple; if (itemViewType != 1) { if (getItemViewType(i) != 2) { IeS ieS = (IeS) zjl; TextView textView = ieS.e.d; C12485ezB c12485ezB = ieS.b; if (c12485ezB.b) { bindingAdapterPosition = ieS.getBindingAdapterPosition() - 1; } else { bindingAdapterPosition = ieS.getBindingAdapterPosition(); } textView.setText(String.valueOf(c12485ezB.e.get(bindingAdapterPosition).intValue())); return; } RVV rvv = (RVV) zjl; TextView textView2 = rvv.a.e; C12485ezB c12485ezB2 = rvv.b; textView2.setText(String.valueOf(c12485ezB2.e.get(c12485ezB2.b ? rvv.getBindingAdapterPosition() - 1 : rvv.getBindingAdapterPosition()).intValue())); Context context = rvv.a.a.getContext(); if (rvv.getBindingAdapterPosition() != c12485ezB2.h) { i2 = com.scb.phone.R.color.f13682131100876; } textView2.setTextColor(nMh.getColor(context, i2)); RelativeLayout relativeLayout = rvv.a.c; Context context2 = rvv.a.a.getContext(); if (rvv.getBindingAdapterPosition() != rvv.b.h) { i3 = com.scb.phone.R.drawable.bg_button_amount; } relativeLayout.setBackground(nMh.getDrawable(context2, i3)); return; } Sts sts = (Sts) zjl; RelativeLayout relativeLayout2 = sts.b.a; Context context3 = sts.b.b.getContext(); if (sts.getBindingAdapterPosition() != sts.a.h) { i3 = com.scb.phone.R.drawable.bg_button_amount; } relativeLayout2.setBackground(nMh.getDrawable(context3, i3)); ImageView imageView = sts.b.e; Context context4 = sts.b.b.getContext(); if (sts.getBindingAdapterPosition() != sts.a.h) { i2 = com.scb.phone.R.color.f13682131100876; } imageView.setColorFilter(nMh.getColor(context4, i2)); } /* renamed from: o.ezB$Sts */ /* loaded from: classes5.dex */ public final class Sts extends RecyclerView.zJl implements View.OnClickListener { final C12485ezB a; Sza b; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.a.h = getBindingAdapterPosition(); LWm lWm = this.a.d; if (lWm != null) { lWm.b(); } this.a.notifyDataSetChanged(); } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public Sts(C12485ezB c12485ezB, Sza sza) { super(sza.b); C14957gcv.e(sza, ""); this.a = c12485ezB; this.b = sza; sza.a.setOnClickListener(this); C12856fJS.HBt hBt = C12856fJS.c; this.b.b.setDefaultFocusHighlightEnabled(false); } } /* renamed from: o.ezB$RVV */ /* loaded from: classes5.dex */ public final class RVV extends RecyclerView.zJl implements View.OnClickListener { final Tsd a; final C12485ezB b; @Override // android.view.View.OnClickListener public final void onClick(View view) { double d; this.b.h = getBindingAdapterPosition(); LWm lWm = this.b.d; if (lWm != null) { C12485ezB c12485ezB = this.b; int i = c12485ezB.h; if (i >= 0) { List list = c12485ezB.e; if (c12485ezB.b) { i--; } d = list.get(i).intValue(); } else { d = 0.0d; } lWm.d(d); } this.b.notifyDataSetChanged(); } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public RVV(C12485ezB c12485ezB, Tsd tsd) { super(tsd.a); C14957gcv.e(tsd, ""); this.b = c12485ezB; this.a = tsd; tsd.c.setOnClickListener(this); } } public final void a(double d) { Iterator it = this.e.iterator(); int i = 0; while (true) { if (!it.hasNext()) { i = -1; break; } else if (it.next().intValue() == d) { break; } else { i++; } } if (this.b) { i++; } this.h = i; notifyDataSetChanged(); } /* renamed from: o.ezB$IeS */ /* loaded from: classes5.dex */ public final class IeS extends RecyclerView.zJl { final C12485ezB b; final lZq e; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public IeS(C12485ezB c12485ezB, lZq lzq) { super(lzq.a); C14957gcv.e(lzq, ""); this.b = c12485ezB; this.e = lzq; } } static { new HBt((byte) 0); } }