what-the-bank/sources/com/scb/phone/view/adapter/bulktransfer/RecipientsAdapter.java

216 lines
8.2 KiB
Java

package com.scb.phone.view.adapter.bulktransfer;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
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.bulktransfer.RecipientsAdapter;
import com.scb.phone.view.custom.common.AmountEditText;
import java.util.List;
import o.C12891fKc;
import o.C6583cXR;
import o.FV;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class RecipientsAdapter extends RecyclerView.Sts<RecipientsHolder> {
public LWm a;
public List<FV> b;
/* loaded from: classes5.dex */
public interface LWm {
void d();
void e();
}
/* loaded from: classes5.dex */
public class RecipientsHolder_ViewBinding implements Unbinder {
private RecipientsHolder b;
public RecipientsHolder_ViewBinding(RecipientsHolder recipientsHolder, View view) {
this.b = recipientsHolder;
recipientsHolder.logo = (ImageView) pyT.e(view, R.id.logo_image_view, "field 'logo'", ImageView.class);
recipientsHolder.accountName = (TextView) pyT.e(view, R.id.account_name_text_view, "field 'accountName'", TextView.class);
recipientsHolder.accountNumber = (TextView) pyT.e(view, R.id.account_number_text_view, "field 'accountNumber'", TextView.class);
recipientsHolder.recipientSelected = (CheckBox) pyT.e(view, R.id.recipient_selected_checkbox, "field 'recipientSelected'", CheckBox.class);
recipientsHolder.error = (TextView) pyT.e(view, R.id.error_text_view, "field 'error'", TextView.class);
recipientsHolder.amountEditText = (AmountEditText) pyT.e(view, R.id.amount_edit_text, "field 'amountEditText'", AmountEditText.class);
}
@Override // butterknife.Unbinder
public final void a() {
RecipientsHolder recipientsHolder = this.b;
if (recipientsHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.b = null;
recipientsHolder.logo = null;
recipientsHolder.accountName = null;
recipientsHolder.accountNumber = null;
recipientsHolder.recipientSelected = null;
recipientsHolder.error = null;
recipientsHolder.amountEditText = null;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ void onBindViewHolder(RecipientsHolder recipientsHolder, int i) {
RecipientsHolder recipientsHolder2 = recipientsHolder;
FV fv = this.b.get(i);
LWm lWm = this.a;
recipientsHolder2.e = fv;
C12891fKc.azf_(recipientsHolder2.d.getContext(), R.drawable.shape_circle_lighter_gray_background, recipientsHolder2.logo, fv.a, recipientsHolder2.d.getContext().getResources().getDimensionPixelOffset(R.dimen.f15222131165286), nMh.getColor(recipientsHolder2.itemView.getContext(), R.color.f3412131099849));
recipientsHolder2.accountName.setText(fv.g);
recipientsHolder2.accountNumber.setText(fv.b);
recipientsHolder2.b = null;
recipientsHolder2.recipientSelected.setChecked(fv.i);
recipientsHolder2.amountEditText.setFormattedAmount(fv.c);
recipientsHolder2.b = lWm;
recipientsHolder2.a(fv.h);
}
public RecipientsAdapter(List<FV> list) {
this.b = list;
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
return this.b.size();
}
/* loaded from: classes5.dex */
public static class RecipientsHolder extends RecyclerView.zJl {
@BindView
TextView accountName;
@BindView
TextView accountNumber;
@BindView
AmountEditText amountEditText;
LWm b;
View d;
FV e;
@BindView
TextView error;
@BindView
ImageView logo;
@BindView
CheckBox recipientSelected;
RecipientsHolder(View view) {
super(view);
ButterKnife.c(this, view);
this.d = view;
this.recipientSelected.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(this) { // from class: o.ero
private RecipientsAdapter.RecipientsHolder d;
@Override // android.widget.CompoundButton.OnCheckedChangeListener
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
RecipientsAdapter.RecipientsHolder.a(this.d, z);
}
{
this.d = this;
}
});
this.amountEditText.setOnFocusChangeListener(new View.OnFocusChangeListener(this) { // from class: o.ern
private RecipientsAdapter.RecipientsHolder e;
@Override // android.view.View.OnFocusChangeListener
public final void onFocusChange(View view2, boolean z) {
RecipientsAdapter.RecipientsHolder.d(this.e, z);
}
{
this.e = this;
}
});
this.amountEditText.setOnAmountChangeListener(new AmountEditText.RVV(this) { // from class: com.scb.phone.view.adapter.bulktransfer.RecipientsAdapter.RecipientsHolder.3
private RecipientsHolder b;
{
this.b = this;
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void b(double d) {
if (this.b.b != null) {
String obj = this.b.amountEditText.getText().toString();
this.b.c(obj);
this.b.e.c = obj;
this.b.b.d();
}
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void a() {
if (this.b.b != null) {
this.b.b.e();
}
}
});
this.amountEditText.setMaximumDecimalDigit(15);
}
final void c(String str) {
if (TextUtils.isEmpty(str)) {
a(this.amountEditText.getResources().getString(R.string.incomplete_information));
} else if (C6583cXR.c(str).doubleValue() == 0.0d) {
a(this.amountEditText.getResources().getString(R.string.incorrect_amount));
} else {
a("");
}
}
final void a(String str) {
if (TextUtils.isEmpty(str)) {
this.amountEditText.setInvalidAmount(false);
this.error.setVisibility(8);
} else {
this.amountEditText.setInvalidAmount(true);
this.error.setVisibility(0);
}
this.e.h = str;
this.error.setText(str);
}
public static /* synthetic */ void d(RecipientsHolder recipientsHolder, boolean z) {
if (recipientsHolder.b == null || z) {
return;
}
String obj = recipientsHolder.amountEditText.getText().toString();
recipientsHolder.c(obj);
recipientsHolder.e.c = (String) C6583cXR.c(new Object[]{Double.valueOf(C6583cXR.c(obj).doubleValue())}, -150997759, 150997764, (int) System.currentTimeMillis());
recipientsHolder.b.d();
}
public static /* synthetic */ void a(RecipientsHolder recipientsHolder, boolean z) {
if (recipientsHolder.b != null) {
recipientsHolder.e.i = z;
recipientsHolder.b.d();
}
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ RecipientsHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
return new RecipientsHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559211, viewGroup, false));
}
}