what-the-bank/sources/com/scb/phone/view/adapter/deposit/DepositTransactionAdapter.java

525 lines
22 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.adapter.deposit;
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
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.deposit.DepositTransactionAdapter;
import com.scb.phone.view.custom.common.NoteEditTextWithButton;
import java.util.ArrayList;
import java.util.List;
import o.AbstractC0577Jw;
import o.AbstractC5347brN;
import o.C0568Jr;
import o.C0583Jz;
import o.C13072fPs;
import o.C16148leh;
import o.C6583cXR;
import o.CfC;
import o.ZGL;
import o.kIT;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public final class DepositTransactionAdapter extends BaseExpandableRecycleViewAdapter {
public String a;
public String c;
public ZGL d;
public int e;
private C16148leh f;
private int g;
public List<AbstractC0577Jw> h;
private HBt i;
private boolean j;
private View.OnClickListener l;
/* loaded from: classes5.dex */
public interface HBt {
void d(int i, String str);
void e(int i, int i2);
}
@FunctionalInterface
/* loaded from: classes5.dex */
public interface Sts {
void a(boolean z);
}
@Override // com.scb.phone.view.adapter.BaseExpandableRecycleViewAdapter, o.Qpt
public final boolean b(RecyclerView.zJl zjl) {
return false;
}
/* loaded from: classes5.dex */
public 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.viewVerticalLine = pyT.a(view, R.id.view_vertical_line, "field 'viewVerticalLine'");
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.textAnnotation = (TextView) pyT.e(view, R.id.text_annotation, "field 'textAnnotation'", TextView.class);
groupItemViewHolder.viewVerticalLineBelowDot = pyT.a(view, R.id.view_vertical_line_below_dot, "field 'viewVerticalLineBelowDot'");
}
@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.viewVerticalLine = null;
groupItemViewHolder.textTitle = null;
groupItemViewHolder.textAmount = null;
groupItemViewHolder.textTimestamp = null;
groupItemViewHolder.textAnnotation = null;
groupItemViewHolder.viewVerticalLineBelowDot = null;
super.a();
}
}
/* loaded from: classes5.dex */
public class ChildViewHolder_ViewBinding implements Unbinder {
private ChildViewHolder e;
public ChildViewHolder_ViewBinding(ChildViewHolder childViewHolder, View view) {
this.e = childViewHolder;
childViewHolder.viewGroupTxnDescription = (ViewGroup) pyT.e(view, R.id.view_group_txn_description, "field 'viewGroupTxnDescription'", ViewGroup.class);
childViewHolder.textDescription = (TextView) pyT.e(view, R.id.text_txn_description, "field 'textDescription'", TextView.class);
childViewHolder.textAddNote = (TextView) pyT.e(view, R.id.text_add_note, "field 'textAddNote'", TextView.class);
childViewHolder.layoutNoteEdit = (LinearLayout) pyT.e(view, R.id.ll_note_edit, "field 'layoutNoteEdit'", LinearLayout.class);
childViewHolder.layoutNoteView = (LinearLayout) pyT.e(view, R.id.ll_note_view, "field 'layoutNoteView'", LinearLayout.class);
childViewHolder.tvNote = (TextView) pyT.e(view, R.id.tv_note, "field 'tvNote'", TextView.class);
childViewHolder.ivEdit = (ImageView) pyT.e(view, R.id.iv_edit, "field 'ivEdit'", ImageView.class);
childViewHolder.noteEditText = (NoteEditTextWithButton) pyT.e(view, R.id.note_edit_text, "field 'noteEditText'", NoteEditTextWithButton.class);
childViewHolder.viewGroupTxnFixed = (ViewGroup) pyT.e(view, R.id.view_group_txn_fixed, "field 'viewGroupTxnFixed'", ViewGroup.class);
childViewHolder.textDepositDate = (TextView) pyT.e(view, R.id.text_txn_deposit_date, "field 'textDepositDate'", TextView.class);
childViewHolder.textTenor = (TextView) pyT.e(view, R.id.text_txn_tenor, "field 'textTenor'", TextView.class);
childViewHolder.textTenorTitle = (TextView) pyT.e(view, R.id.text_txn_tenor_title, "field 'textTenorTitle'", TextView.class);
childViewHolder.textInterestRate = (TextView) pyT.e(view, R.id.text_txn_interest_rate, "field 'textInterestRate'", TextView.class);
childViewHolder.textInterestAmount = (TextView) pyT.e(view, R.id.text_txn_interest, "field 'textInterestAmount'", TextView.class);
}
@Override // butterknife.Unbinder
public final void a() {
ChildViewHolder childViewHolder = this.e;
if (childViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.e = null;
childViewHolder.viewGroupTxnDescription = null;
childViewHolder.textDescription = null;
childViewHolder.textAddNote = null;
childViewHolder.layoutNoteEdit = null;
childViewHolder.layoutNoteView = null;
childViewHolder.tvNote = null;
childViewHolder.ivEdit = null;
childViewHolder.noteEditText = null;
childViewHolder.viewGroupTxnFixed = null;
childViewHolder.textDepositDate = null;
childViewHolder.textTenor = null;
childViewHolder.textTenorTitle = null;
childViewHolder.textInterestRate = null;
childViewHolder.textInterestAmount = null;
}
}
public DepositTransactionAdapter(Context context, C16148leh c16148leh, HBt hBt) {
super(context);
this.h = new ArrayList();
this.c = "";
this.j = false;
this.g = -1;
this.f = c16148leh;
this.l = new View.OnClickListener(this) { // from class: o.esW
private DepositTransactionAdapter d;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
DepositTransactionAdapter.a(this.d, view);
}
{
this.d = this;
}
};
this.i = hBt;
}
public final void e(boolean z, Sts sts) {
if (this.j != z) {
this.j = z;
if (z) {
this.h.add(null);
notifyItemInserted(this.h.size() - 1);
} else {
this.h.remove(r0.size() - 1);
notifyItemRemoved(this.h.size());
}
}
if (sts != null) {
sts.a(z);
}
}
@Override // o.pvT, o.Qpt
public final int c(int i) {
return this.h.get(i) == null ? 0 : 1;
}
@Override // o.Qpt
public final int d() {
return this.h.size();
}
@Override // o.Qpt
public final RecyclerView.zJl anX_(ViewGroup viewGroup, int i) {
if (i == 1) {
return new GroupItemViewHolder(this, LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559103, viewGroup, false), this.l);
}
if (i == 0) {
return new LWm(this, LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559248, viewGroup, false));
}
return null;
}
@Override // o.Qpt
public final RecyclerView.zJl anW_(ViewGroup viewGroup, int i) {
return new ChildViewHolder(this, LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.2131559104, viewGroup, false));
}
@Override // o.Qpt
public final void d(RecyclerView.zJl zjl, int i) {
if (zjl instanceof GroupItemViewHolder) {
GroupItemViewHolder groupItemViewHolder = (GroupItemViewHolder) zjl;
AbstractC0577Jw abstractC0577Jw = groupItemViewHolder.e.h.get(i);
groupItemViewHolder.textTitle.setText(abstractC0577Jw.i);
groupItemViewHolder.textTimestamp.setText(abstractC0577Jw.g);
groupItemViewHolder.textAnnotation.setText(abstractC0577Jw.c);
if (groupItemViewHolder.e.f.d(i)) {
groupItemViewHolder.textAnnotation.setVisibility(4);
} else {
groupItemViewHolder.textAnnotation.setVisibility(0);
}
groupItemViewHolder.viewVerticalLine.setVisibility(i == 0 ? 4 : 0);
groupItemViewHolder.viewVerticalLineBelowDot.setVisibility(i == groupItemViewHolder.e.h.size() - 1 ? 8 : 0);
if (groupItemViewHolder.e.d == ZGL.TYPE_LONG_TERM) {
groupItemViewHolder.itemView.setClickable(false);
groupItemViewHolder.expandIcon.setVisibility(8);
} else {
groupItemViewHolder.itemView.setClickable(true);
groupItemViewHolder.expandIcon.setVisibility(0);
}
Context context = groupItemViewHolder.itemView.getContext();
groupItemViewHolder.textAmount.setText(abstractC0577Jw.a);
groupItemViewHolder.textAmount.setTextColor(nMh.getColor(context, abstractC0577Jw.h));
DepositTransactionAdapter depositTransactionAdapter = groupItemViewHolder.e;
BaseExpandableRecycleViewAdapter.a(groupItemViewHolder);
}
}
@Override // o.Qpt
public final void c(RecyclerView.zJl zjl, final int i, int i2) {
if (zjl instanceof ChildViewHolder) {
final ChildViewHolder childViewHolder = (ChildViewHolder) zjl;
AbstractC0577Jw abstractC0577Jw = childViewHolder.a.h.get(i);
if (abstractC0577Jw instanceof C0568Jr) {
childViewHolder.viewGroupTxnFixed.setVisibility(8);
childViewHolder.viewGroupTxnDescription.setVisibility(0);
childViewHolder.layoutNoteEdit.setVisibility(8);
childViewHolder.tvNote.setText(abstractC0577Jw.c);
childViewHolder.noteEditText.setText(abstractC0577Jw.c);
if (abstractC0577Jw.d == AbstractC0577Jw.Sts.NO_ANNOTATION) {
childViewHolder.layoutNoteEdit.setVisibility(8);
childViewHolder.textAddNote.setVisibility(0);
childViewHolder.layoutNoteView.setVisibility(8);
} else {
childViewHolder.layoutNoteEdit.setVisibility(8);
childViewHolder.textAddNote.setVisibility(8);
childViewHolder.layoutNoteView.setVisibility(0);
}
childViewHolder.textDescription.setText(((C0568Jr) abstractC0577Jw).b);
childViewHolder.textAddNote.setOnClickListener(new View.OnClickListener(childViewHolder, i) { // from class: o.esX
private int b;
private DepositTransactionAdapter.ChildViewHolder d;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
DepositTransactionAdapter.ChildViewHolder.b(this.d, this.b);
}
{
this.d = childViewHolder;
this.b = i;
}
});
childViewHolder.noteEditText.setOnDoneButtonListener(new NoteEditTextWithButton.Sts(childViewHolder, i) { // from class: o.esV
private int a;
private DepositTransactionAdapter.ChildViewHolder e;
@Override // com.scb.phone.view.custom.common.NoteEditTextWithButton.Sts
public final void e() {
DepositTransactionAdapter.ChildViewHolder.c(this.e, this.a);
}
{
this.e = childViewHolder;
this.a = i;
}
});
childViewHolder.ivEdit.setOnClickListener(new View.OnClickListener(childViewHolder, i) { // from class: o.esZ
private int b;
private DepositTransactionAdapter.ChildViewHolder c;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
DepositTransactionAdapter.ChildViewHolder.d(this.c, this.b);
}
{
this.c = childViewHolder;
this.b = i;
}
});
return;
}
if (abstractC0577Jw instanceof C0583Jz) {
childViewHolder.viewGroupTxnDescription.setVisibility(8);
childViewHolder.viewGroupTxnFixed.setVisibility(0);
if ("MT".equalsIgnoreCase(childViewHolder.a.c)) {
childViewHolder.textTenor.setVisibility(0);
childViewHolder.textTenorTitle.setVisibility(0);
} else {
childViewHolder.textTenor.setVisibility(8);
childViewHolder.textTenorTitle.setVisibility(8);
}
C0583Jz c0583Jz = (C0583Jz) abstractC0577Jw;
childViewHolder.textDepositDate.setText(c0583Jz.b);
childViewHolder.textTenor.setText(c0583Jz.n);
childViewHolder.textInterestRate.setText(c0583Jz.k);
childViewHolder.textInterestAmount.setText(c0583Jz.l);
}
}
}
/* loaded from: classes5.dex */
class LWm extends AbstractC5347brN {
private DepositTransactionAdapter e;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
LWm(DepositTransactionAdapter depositTransactionAdapter, View view) {
super(view);
this.e = depositTransactionAdapter;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes5.dex */
public class GroupItemViewHolder extends BaseExpandableRecycleViewAdapter.BaseParentViewHolder {
@BindView
View container;
DepositTransactionAdapter e;
@BindView
TextView textAmount;
@BindView
TextView textAnnotation;
@BindView
TextView textTimestamp;
@BindView
TextView textTitle;
@BindView
View viewVerticalLine;
@BindView
View viewVerticalLineBelowDot;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
GroupItemViewHolder(DepositTransactionAdapter depositTransactionAdapter, View view, View.OnClickListener onClickListener) {
super(view);
this.e = depositTransactionAdapter;
ButterKnife.c(this, view);
this.container.setOnClickListener(onClickListener);
}
}
/* loaded from: classes5.dex */
public class ChildViewHolder extends AbstractC5347brN {
final DepositTransactionAdapter a;
@BindView
ImageView ivEdit;
@BindView
LinearLayout layoutNoteEdit;
@BindView
LinearLayout layoutNoteView;
@BindView
NoteEditTextWithButton noteEditText;
@BindView
TextView textAddNote;
@BindView
TextView textDepositDate;
@BindView
TextView textDescription;
@BindView
TextView textInterestAmount;
@BindView
TextView textInterestRate;
@BindView
TextView textTenor;
@BindView
TextView textTenorTitle;
@BindView
TextView tvNote;
@BindView
ViewGroup viewGroupTxnDescription;
@BindView
ViewGroup viewGroupTxnFixed;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
ChildViewHolder(DepositTransactionAdapter depositTransactionAdapter, View view) {
super(view);
this.a = depositTransactionAdapter;
ButterKnife.c(this, view);
}
private void b() {
((InputMethodManager) this.a.b.getSystemService("input_method")).showSoftInput(this.noteEditText.mNoteEditText, 1);
((InputMethodManager) this.a.b.getSystemService("input_method")).showSoftInput(this.noteEditText.mNoteEditText, 0);
}
public static /* synthetic */ void d(ChildViewHolder childViewHolder, int i) {
if (childViewHolder.a.i != null) {
childViewHolder.noteEditText.requestFocus();
childViewHolder.b();
childViewHolder.a.i.e(i, childViewHolder.itemView.getHeight());
}
childViewHolder.layoutNoteEdit.setVisibility(0);
childViewHolder.textAddNote.setVisibility(8);
childViewHolder.layoutNoteView.setVisibility(8);
}
public static /* synthetic */ void c(ChildViewHolder childViewHolder, int i) {
String trim = childViewHolder.noteEditText.mNoteEditText.getText().toString().trim();
if (!TextUtils.isEmpty(trim) && !((Boolean) C6583cXR.c(new Object[]{trim}, -1032102340, 1032102340, (int) System.currentTimeMillis())).booleanValue()) {
childViewHolder.noteEditText.d();
return;
}
if (childViewHolder.a.i != null) {
DepositTransactionAdapter depositTransactionAdapter = childViewHolder.a;
String trim2 = childViewHolder.noteEditText.mNoteEditText.getText().toString().trim();
depositTransactionAdapter.e = i;
depositTransactionAdapter.a = trim2;
childViewHolder.a.i.d(i, childViewHolder.noteEditText.mNoteEditText.getText().toString().trim());
}
}
public static /* synthetic */ void b(ChildViewHolder childViewHolder, int i) {
if (childViewHolder.a.i != null) {
childViewHolder.noteEditText.requestFocus();
childViewHolder.b();
childViewHolder.a.i.e(i, childViewHolder.itemView.getHeight());
}
childViewHolder.layoutNoteEdit.setVisibility(0);
childViewHolder.textAddNote.setVisibility(8);
childViewHolder.layoutNoteView.setVisibility(8);
}
}
public static /* synthetic */ void a(DepositTransactionAdapter depositTransactionAdapter, View view) {
int adapterPosition;
View currentFocus;
if (view.getId() != R.id.container || depositTransactionAdapter.d == ZGL.TYPE_LONG_TERM) {
return;
}
Context e = C13072fPs.e(depositTransactionAdapter.b);
if (e instanceof BaseActivity) {
((BaseActivity) e).aN_();
}
RecyclerView.zJl a = CfC.a(view);
if (a == null || (adapterPosition = a.getAdapterPosition()) == -1) {
return;
}
kIT kit = depositTransactionAdapter.f.j;
long c = kit == null ? -1L : kit.g.c(adapterPosition);
int i = (int) c;
if (((int) (c >>> 32)) == -1) {
Context e2 = C13072fPs.e(depositTransactionAdapter.b);
if (e2 != null && (currentFocus = ((Activity) e2).getCurrentFocus()) != null) {
currentFocus.clearFocus();
}
if (!depositTransactionAdapter.f.d(i)) {
depositTransactionAdapter.f.e();
kIT kit2 = depositTransactionAdapter.f.j;
if (kit2 != null) {
kit2.a(i, false);
}
} else {
kIT kit3 = depositTransactionAdapter.f.j;
if (kit3 != null) {
kit3.e(i, false);
}
}
}
if (a instanceof GroupItemViewHolder) {
int i2 = depositTransactionAdapter.g;
if (i2 >= 0 && i2 != adapterPosition) {
depositTransactionAdapter.notifyDataSetChanged();
}
if (depositTransactionAdapter.f.d(adapterPosition)) {
((GroupItemViewHolder) a).textAnnotation.setVisibility(4);
} else {
((GroupItemViewHolder) a).textAnnotation.setVisibility(0);
}
}
depositTransactionAdapter.g = adapterPosition;
}
public static void b(AbstractC0577Jw abstractC0577Jw) {
if (TextUtils.isEmpty(abstractC0577Jw.c)) {
abstractC0577Jw.d = AbstractC0577Jw.Sts.NO_ANNOTATION;
} else {
abstractC0577Jw.d = AbstractC0577Jw.Sts.HAVE_ANNOTATION;
}
}
}