382 lines
17 KiB
Java
382 lines
17 KiB
Java
package com.scb.phone.view.adapter.hml;
|
|
|
|
import android.os.Handler;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.Button;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import butterknife.BindView;
|
|
import butterknife.ButterKnife;
|
|
import butterknife.Unbinder;
|
|
import com.bumptech.glide.Glide;
|
|
import com.scb.phone.R;
|
|
import com.scb.phone.view.adapter.hml.HmlOutcomeCounterAdapter;
|
|
import com.scb.phone.view.custom.common.CustomDeltaInput;
|
|
import com.scb.phone.view.custom.common.CustomDeltaInputPressed;
|
|
import com.scb.phone.view.custom.hml.CustomLoanSuccessInformation;
|
|
import com.scb.phone.view.fragment.hml.HmlOutcomeCounterOfferFragment;
|
|
import java.util.List;
|
|
import o.C0732Ng;
|
|
import o.C14957gcv;
|
|
import o.C6583cXR;
|
|
import o.GEP;
|
|
import o.InterfaceC0755Nw;
|
|
import o.Jel;
|
|
import o.NP;
|
|
import o.PNS;
|
|
import o.WZ;
|
|
import o.YKU;
|
|
import o.fIU;
|
|
import o.pyT;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public final class HmlOutcomeCounterAdapter extends RecyclerView.Sts<RecyclerView.zJl> {
|
|
private fIU a;
|
|
private List<InterfaceC0755Nw> b;
|
|
private HmlOutcomeCounterOfferFragment.HBt c;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class CounterOfferViewHolder_ViewBinding implements Unbinder {
|
|
private CounterOfferViewHolder b;
|
|
|
|
public CounterOfferViewHolder_ViewBinding(CounterOfferViewHolder counterOfferViewHolder, View view) {
|
|
this.b = counterOfferViewHolder;
|
|
counterOfferViewHolder.headerTitle = (TextView) pyT.e(view, R.id.tv_loaninfo_header_title, "field 'headerTitle'", TextView.class);
|
|
counterOfferViewHolder.headerSeparator = pyT.a(view, R.id.v_separator, "field 'headerSeparator'");
|
|
counterOfferViewHolder.loanInfo = (CustomLoanSuccessInformation) pyT.e(view, R.id.clsi_counter_loaninfo, "field 'loanInfo'", CustomLoanSuccessInformation.class);
|
|
counterOfferViewHolder.acceptButton = (Button) pyT.e(view, R.id.bt_accept, "field 'acceptButton'", Button.class);
|
|
}
|
|
|
|
@Override // butterknife.Unbinder
|
|
public final void a() {
|
|
CounterOfferViewHolder counterOfferViewHolder = this.b;
|
|
if (counterOfferViewHolder == null) {
|
|
throw new IllegalStateException("Bindings already cleared.");
|
|
}
|
|
this.b = null;
|
|
counterOfferViewHolder.headerTitle = null;
|
|
counterOfferViewHolder.headerSeparator = null;
|
|
counterOfferViewHolder.loanInfo = null;
|
|
counterOfferViewHolder.acceptButton = null;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class UpsellOfferViewHolder_ViewBinding implements Unbinder {
|
|
private UpsellOfferViewHolder b;
|
|
|
|
public UpsellOfferViewHolder_ViewBinding(UpsellOfferViewHolder upsellOfferViewHolder, View view) {
|
|
this.b = upsellOfferViewHolder;
|
|
upsellOfferViewHolder.headerTitle = (TextView) pyT.e(view, R.id.tv_upsell_header_title, "field 'headerTitle'", TextView.class);
|
|
upsellOfferViewHolder.upsellIcon = (ImageView) pyT.e(view, R.id.iv_upsell_icon, "field 'upsellIcon'", ImageView.class);
|
|
upsellOfferViewHolder.upsellDescription = (TextView) pyT.e(view, R.id.tv_upsell_description, "field 'upsellDescription'", TextView.class);
|
|
upsellOfferViewHolder.loanAmount = (CustomDeltaInputPressed) pyT.e(view, R.id.cdi_loan_amount, "field 'loanAmount'", CustomDeltaInputPressed.class);
|
|
upsellOfferViewHolder.loanAmountRemark = (TextView) pyT.e(view, R.id.tv_loanamount_remark, "field 'loanAmountRemark'", TextView.class);
|
|
upsellOfferViewHolder.acceptBtn = (Button) pyT.e(view, R.id.bt_accept, "field 'acceptBtn'", Button.class);
|
|
}
|
|
|
|
@Override // butterknife.Unbinder
|
|
public final void a() {
|
|
UpsellOfferViewHolder upsellOfferViewHolder = this.b;
|
|
if (upsellOfferViewHolder == null) {
|
|
throw new IllegalStateException("Bindings already cleared.");
|
|
}
|
|
this.b = null;
|
|
upsellOfferViewHolder.headerTitle = null;
|
|
upsellOfferViewHolder.upsellIcon = null;
|
|
upsellOfferViewHolder.upsellDescription = null;
|
|
upsellOfferViewHolder.loanAmount = null;
|
|
upsellOfferViewHolder.loanAmountRemark = null;
|
|
upsellOfferViewHolder.acceptBtn = null;
|
|
}
|
|
}
|
|
|
|
public HmlOutcomeCounterAdapter(List<InterfaceC0755Nw> list, fIU fiu, HmlOutcomeCounterOfferFragment.HBt hBt) {
|
|
this.b = list;
|
|
this.a = fiu;
|
|
this.c = hBt;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Sts
|
|
public final RecyclerView.zJl onCreateViewHolder(ViewGroup viewGroup, int i) {
|
|
LayoutInflater from = LayoutInflater.from(viewGroup.getContext());
|
|
if (i == 2) {
|
|
return new UpsellOfferViewHolder(this, from.inflate(R.layout.2131559150, viewGroup, false));
|
|
}
|
|
return new CounterOfferViewHolder(this, from.inflate(R.layout.2131559149, viewGroup, false));
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Sts
|
|
public final void onBindViewHolder(RecyclerView.zJl zjl, int i) {
|
|
if (zjl instanceof CounterOfferViewHolder) {
|
|
final CounterOfferViewHolder counterOfferViewHolder = (CounterOfferViewHolder) zjl;
|
|
C0732Ng c0732Ng = (C0732Ng) this.b.get(i);
|
|
final fIU fiu = this.a;
|
|
if (c0732Ng.j != null) {
|
|
counterOfferViewHolder.headerTitle.setText(c0732Ng.j);
|
|
counterOfferViewHolder.headerTitle.setVisibility(0);
|
|
counterOfferViewHolder.headerSeparator.setVisibility(0);
|
|
}
|
|
TextView textView = null;
|
|
if (c0732Ng.c != null) {
|
|
counterOfferViewHolder.loanInfo.setIcon(c0732Ng.c);
|
|
} else {
|
|
ImageView imageView = counterOfferViewHolder.loanInfo.counterIcon;
|
|
if (imageView == null) {
|
|
C14957gcv.a("");
|
|
imageView = null;
|
|
}
|
|
imageView.setVisibility(8);
|
|
}
|
|
counterOfferViewHolder.loanInfo.setAmountTitle(c0732Ng.e);
|
|
counterOfferViewHolder.loanInfo.setAmount(c0732Ng.a);
|
|
counterOfferViewHolder.loanInfo.setRepayment(c0732Ng.d);
|
|
CustomLoanSuccessInformation customLoanSuccessInformation = counterOfferViewHolder.loanInfo;
|
|
customLoanSuccessInformation.setRepaymentTitle(customLoanSuccessInformation.getContext().getString(R.string.hml_outcome_counter_installments_title));
|
|
if (c0732Ng.b != null) {
|
|
CustomLoanSuccessInformation customLoanSuccessInformation2 = counterOfferViewHolder.loanInfo;
|
|
YKU c = YKU.c(c0732Ng.b);
|
|
customLoanSuccessInformation2.setPromotion((WZ) new YKU(c.a, new GEP(c.b, new Jel() { // from class: o.euO
|
|
@Override // o.Jel
|
|
public final boolean e(Object obj) {
|
|
boolean z;
|
|
z = ((WZ) obj).d;
|
|
return z;
|
|
}
|
|
})).c(1L).a());
|
|
TextView textView2 = counterOfferViewHolder.loanInfo.promotion.remark;
|
|
if (textView2 == null) {
|
|
C14957gcv.a("");
|
|
textView2 = null;
|
|
}
|
|
TextView textView3 = textView2;
|
|
C14957gcv.e(textView3, "");
|
|
textView3.setVisibility(8);
|
|
TextView textView4 = counterOfferViewHolder.loanInfo.promotion.promo;
|
|
if (textView4 != null) {
|
|
textView = textView4;
|
|
} else {
|
|
C14957gcv.a("");
|
|
}
|
|
TextView textView5 = textView;
|
|
C14957gcv.e(textView5, "");
|
|
textView5.setVisibility(8);
|
|
}
|
|
counterOfferViewHolder.acceptButton.setOnClickListener(new View.OnClickListener(counterOfferViewHolder, fiu) { // from class: o.euP
|
|
private fIU b;
|
|
private HmlOutcomeCounterAdapter.CounterOfferViewHolder d;
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
this.b.b(this.d.getAdapterPosition());
|
|
}
|
|
|
|
{
|
|
this.d = counterOfferViewHolder;
|
|
this.b = fiu;
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
if (zjl instanceof UpsellOfferViewHolder) {
|
|
final UpsellOfferViewHolder upsellOfferViewHolder = (UpsellOfferViewHolder) zjl;
|
|
final NP np = (NP) this.b.get(i);
|
|
final HmlOutcomeCounterOfferFragment.HBt hBt = this.c;
|
|
Glide.e(upsellOfferViewHolder.upsellIcon).c(np.b).b(new PNS().c(R.drawable.ic_offer_icon_placeholder)).Dq_(upsellOfferViewHolder.upsellIcon);
|
|
upsellOfferViewHolder.headerTitle.setText(np.i);
|
|
upsellOfferViewHolder.upsellDescription.setText(np.a);
|
|
upsellOfferViewHolder.loanAmount.setHint(R.string.auto_app_outcome_upselling_custom_placeholder);
|
|
upsellOfferViewHolder.loanAmount.setMaxValue(np.c);
|
|
upsellOfferViewHolder.loanAmount.setMinValue(np.d);
|
|
upsellOfferViewHolder.loanAmount.setDelta(np.e);
|
|
upsellOfferViewHolder.loanAmount.container.setBackgroundResource(R.color.f14042131100912);
|
|
upsellOfferViewHolder.loanAmount.setOnValueChangedListener(new CustomDeltaInput.HBt(upsellOfferViewHolder, np) { // from class: o.euL
|
|
private NP b;
|
|
private HmlOutcomeCounterAdapter.UpsellOfferViewHolder c;
|
|
|
|
@Override // com.scb.phone.view.custom.common.CustomDeltaInput.HBt
|
|
public final void c(double d, boolean z) {
|
|
HmlOutcomeCounterAdapter.UpsellOfferViewHolder.d(this.c, this.b, d, z);
|
|
}
|
|
|
|
{
|
|
this.c = upsellOfferViewHolder;
|
|
this.b = np;
|
|
}
|
|
});
|
|
upsellOfferViewHolder.loanAmount.setOnKeyboardDoneListener(new CustomDeltaInput.LWm(upsellOfferViewHolder) { // from class: o.euS
|
|
private HmlOutcomeCounterAdapter.UpsellOfferViewHolder a;
|
|
|
|
@Override // com.scb.phone.view.custom.common.CustomDeltaInput.LWm
|
|
public final void b() {
|
|
this.a.headerTitle.requestFocus();
|
|
}
|
|
|
|
{
|
|
this.a = upsellOfferViewHolder;
|
|
}
|
|
});
|
|
upsellOfferViewHolder.loanAmount.setOnDismissKeyboardListener(new CustomDeltaInput.RVV(upsellOfferViewHolder) { // from class: o.euT
|
|
private HmlOutcomeCounterAdapter.UpsellOfferViewHolder d;
|
|
|
|
@Override // com.scb.phone.view.custom.common.CustomDeltaInput.RVV
|
|
public final void aP_() {
|
|
this.d.headerTitle.requestFocus();
|
|
}
|
|
|
|
{
|
|
this.d = upsellOfferViewHolder;
|
|
}
|
|
});
|
|
upsellOfferViewHolder.loanAmount.setOnClickInputAmountListener(new View.OnClickListener(upsellOfferViewHolder) { // from class: o.euV
|
|
private HmlOutcomeCounterAdapter.UpsellOfferViewHolder c;
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
r1.d.removeCallbacks(this.c.c);
|
|
}
|
|
|
|
{
|
|
this.c = upsellOfferViewHolder;
|
|
}
|
|
});
|
|
upsellOfferViewHolder.loanAmount.setOnIncrementChangeListener(new CustomDeltaInput.Sts(upsellOfferViewHolder) { // from class: com.scb.phone.view.adapter.hml.HmlOutcomeCounterAdapter.UpsellOfferViewHolder.3
|
|
private UpsellOfferViewHolder b;
|
|
|
|
{
|
|
this.b = upsellOfferViewHolder;
|
|
}
|
|
|
|
@Override // com.scb.phone.view.custom.common.CustomDeltaInput.Sts
|
|
public final void j() {
|
|
this.b.d.removeCallbacks(this.b.c);
|
|
this.b.d.postDelayed(this.b.c, 2000L);
|
|
}
|
|
|
|
@Override // com.scb.phone.view.custom.common.CustomDeltaInput.Sts
|
|
public final void h() {
|
|
j();
|
|
}
|
|
});
|
|
upsellOfferViewHolder.loanAmountRemark.setText(upsellOfferViewHolder.loanAmount.getContext().getString(R.string.auto_app_outcome_upselling_custom_remarks, C6583cXR.b(np.d), C6583cXR.b(np.c)));
|
|
upsellOfferViewHolder.acceptBtn.setOnClickListener(new View.OnClickListener(upsellOfferViewHolder, hBt) { // from class: o.euU
|
|
private HmlOutcomeCounterAdapter.UpsellOfferViewHolder b;
|
|
private HmlOutcomeCounterOfferFragment.HBt e;
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
this.e.c(this.b.loanAmount.c);
|
|
}
|
|
|
|
{
|
|
this.b = upsellOfferViewHolder;
|
|
this.e = hBt;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Sts
|
|
public final int getItemViewType(int i) {
|
|
InterfaceC0755Nw interfaceC0755Nw = this.b.get(i);
|
|
if (interfaceC0755Nw instanceof C0732Ng) {
|
|
return 1;
|
|
}
|
|
return interfaceC0755Nw instanceof NP ? 2 : 0;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Sts
|
|
public final int getItemCount() {
|
|
return this.b.size();
|
|
}
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class CounterOfferViewHolder extends RecyclerView.zJl {
|
|
private HmlOutcomeCounterAdapter a;
|
|
|
|
@BindView
|
|
Button acceptButton;
|
|
|
|
@BindView
|
|
View headerSeparator;
|
|
|
|
@BindView
|
|
TextView headerTitle;
|
|
|
|
@BindView
|
|
CustomLoanSuccessInformation loanInfo;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public CounterOfferViewHolder(HmlOutcomeCounterAdapter hmlOutcomeCounterAdapter, View view) {
|
|
super(view);
|
|
this.a = hmlOutcomeCounterAdapter;
|
|
ButterKnife.c(this, view);
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class UpsellOfferViewHolder extends RecyclerView.zJl {
|
|
|
|
@BindView
|
|
Button acceptBtn;
|
|
private HmlOutcomeCounterAdapter b;
|
|
private Runnable c;
|
|
private Handler d;
|
|
|
|
@BindView
|
|
TextView headerTitle;
|
|
|
|
@BindView
|
|
CustomDeltaInputPressed loanAmount;
|
|
|
|
@BindView
|
|
TextView loanAmountRemark;
|
|
|
|
@BindView
|
|
TextView upsellDescription;
|
|
|
|
@BindView
|
|
ImageView upsellIcon;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public UpsellOfferViewHolder(HmlOutcomeCounterAdapter hmlOutcomeCounterAdapter, View view) {
|
|
super(view);
|
|
this.b = hmlOutcomeCounterAdapter;
|
|
this.d = new Handler();
|
|
this.c = new Runnable(this) { // from class: o.euR
|
|
private HmlOutcomeCounterAdapter.UpsellOfferViewHolder d;
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
HmlOutcomeCounterAdapter.UpsellOfferViewHolder.a(this.d);
|
|
}
|
|
|
|
{
|
|
this.d = this;
|
|
}
|
|
};
|
|
ButterKnife.c(this, view);
|
|
}
|
|
|
|
public static /* synthetic */ void d(UpsellOfferViewHolder upsellOfferViewHolder, NP np, double d, boolean z) {
|
|
upsellOfferViewHolder.loanAmountRemark.setVisibility(z ? 0 : 8);
|
|
upsellOfferViewHolder.acceptBtn.setEnabled(z);
|
|
if (d < np.d) {
|
|
CustomDeltaInputPressed customDeltaInputPressed = upsellOfferViewHolder.loanAmount;
|
|
customDeltaInputPressed.setErrorMessage(customDeltaInputPressed.getResources().getString(R.string.auto_app_outcome_upselling_custom_minimum_inline_error, C6583cXR.c().format(np.d)));
|
|
} else if (d > np.c) {
|
|
CustomDeltaInputPressed customDeltaInputPressed2 = upsellOfferViewHolder.loanAmount;
|
|
customDeltaInputPressed2.setErrorMessage(customDeltaInputPressed2.getResources().getString(R.string.auto_app_outcome_upselling_custom_maximum_inline_error, C6583cXR.c().format(np.c)));
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void a(UpsellOfferViewHolder upsellOfferViewHolder) {
|
|
upsellOfferViewHolder.headerTitle.requestFocus();
|
|
C6583cXR.d(upsellOfferViewHolder.loanAmount);
|
|
}
|
|
}
|
|
}
|