what-the-bank/sources/com/scb/phone/view/custom/ntb/CustomInformationPanel.java

256 lines
10 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.custom.ntb;
import android.content.Context;
import android.content.res.TypedArray;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.scb.phone.R;
import com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle;
import java.util.List;
import o.C15715hv;
import o.GEP;
import o.Jel;
import o.MYp;
import o.PRA;
import o.SZ;
import o.YKU;
import o.nMh;
import o.pyT;
/* loaded from: classes5.dex */
public class CustomInformationPanel extends LinearLayout {
private String a;
private RVV c;
private List<SZ> d;
@BindView
TextView labelTitle;
@BindView
RecyclerView recyclerView;
/* loaded from: classes5.dex */
public interface RVV {
void b();
}
/* loaded from: classes5.dex */
class InformationAdapter extends RecyclerView.Sts<ItemViewHolder> {
final CustomInformationPanel b;
private List<SZ> e;
/* loaded from: classes5.dex */
public class ItemViewHolder_ViewBinding implements Unbinder {
private ItemViewHolder d;
public ItemViewHolder_ViewBinding(ItemViewHolder itemViewHolder, View view) {
this.d = itemViewHolder;
itemViewHolder.label = (TextView) pyT.e(view, R.id.label_item, "field 'label'", TextView.class);
itemViewHolder.text = (TextView) pyT.e(view, R.id.text_item, "field 'text'", TextView.class);
itemViewHolder.textDisclaimer = (TextView) pyT.e(view, R.id.text_disclaimer, "field 'textDisclaimer'", TextView.class);
itemViewHolder.spinnerItem = (CustomSpinnerWithTitle) pyT.e(view, R.id.layout_spinner_personal_item, "field 'spinnerItem'", CustomSpinnerWithTitle.class);
itemViewHolder.separator = pyT.a(view, R.id.view_separator, "field 'separator'");
}
@Override // butterknife.Unbinder
public final void a() {
ItemViewHolder itemViewHolder = this.d;
if (itemViewHolder == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.d = null;
itemViewHolder.label = null;
itemViewHolder.text = null;
itemViewHolder.textDisclaimer = null;
itemViewHolder.spinnerItem = null;
itemViewHolder.separator = null;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ void onBindViewHolder(ItemViewHolder itemViewHolder, int i) {
ItemViewHolder itemViewHolder2 = itemViewHolder;
List<SZ> list = this.e;
if (list != null) {
SZ sz = list.get(i);
itemViewHolder2.label.setText(sz.d);
itemViewHolder2.text.setText(sz.h);
if (TextUtils.isEmpty(sz.b)) {
itemViewHolder2.textDisclaimer.setVisibility(8);
} else {
itemViewHolder2.textDisclaimer.setVisibility(0);
itemViewHolder2.textDisclaimer.setText(sz.b);
}
List<String> list2 = sz.c;
List<String> list3 = sz.f;
if (list3 != null && !list3.isEmpty() && list2 != null && !list2.isEmpty()) {
if (list2.size() != 1) {
itemViewHolder2.text.setVisibility(8);
itemViewHolder2.label.setVisibility(8);
itemViewHolder2.spinnerItem.setVisibility(0);
itemViewHolder2.spinnerItem.setOnCustomSpinnerWithTitleCompletion(new CustomSpinnerWithTitle.LWm(this, itemViewHolder2, list2, list3, i) { // from class: com.scb.phone.view.custom.ntb.CustomInformationPanel.InformationAdapter.1
private ItemViewHolder a;
private List b;
private InformationAdapter c;
private List d;
private int e;
{
this.c = this;
this.a = itemViewHolder2;
this.b = list2;
this.d = list3;
this.e = i;
}
@Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm
public final void bn_() {
this.a.spinnerItem.setItemsWithPlaceholder(this.b, true);
}
@Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm
public final void bo_() {
((SZ) this.c.b.d.get(this.e)).g = (this.a.spinnerItem == null || ((MYp) this.a.spinnerItem.c.e()).c.getSelectedItemPosition() <= 0) ? "" : (String) this.d.get(((MYp) this.a.spinnerItem.c.e()).c.getSelectedItemPosition() - 1);
if (this.c.b.c != null) {
this.c.b.c.b();
}
}
});
} else {
((SZ) this.b.d.get(i)).g = list3.get(0);
if (this.b.c != null) {
RVV rvv = this.b.c;
list3.get(0);
rvv.b();
}
itemViewHolder2.label.setVisibility(0);
itemViewHolder2.text.setVisibility(0);
itemViewHolder2.spinnerItem.setVisibility(8);
}
} else {
itemViewHolder2.label.setVisibility(0);
itemViewHolder2.text.setVisibility(0);
itemViewHolder2.spinnerItem.setVisibility(8);
}
if (i == this.b.d.size() - 1) {
itemViewHolder2.separator.setVisibility(8);
} else {
itemViewHolder2.separator.setVisibility(0);
}
}
}
public InformationAdapter(CustomInformationPanel customInformationPanel, List<SZ> list) {
this.b = customInformationPanel;
this.e = list;
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final int getItemCount() {
List<SZ> list = this.e;
if (list != null) {
return list.size();
}
return 0;
}
/* loaded from: classes5.dex */
class ItemViewHolder extends RecyclerView.zJl {
private View c;
private InformationAdapter e;
@BindView
TextView label;
@BindView
View separator;
@BindView
CustomSpinnerWithTitle spinnerItem;
@BindView
TextView text;
@BindView
TextView textDisclaimer;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
ItemViewHolder(InformationAdapter informationAdapter, View view) {
super(view);
this.e = informationAdapter;
this.c = view;
ButterKnife.c(this, view);
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final /* synthetic */ ItemViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
return new ItemViewHolder(this, LayoutInflater.from(this.b.getContext()).inflate(R.layout.2131559051, viewGroup, false));
}
}
public CustomInformationPanel(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomInformationPanel, 0, 0);
this.a = obtainStyledAttributes.getString(0);
obtainStyledAttributes.recycle();
((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131559050, (ViewGroup) this, true);
ButterKnife.c(this);
this.labelTitle.setText(this.a);
}
public CustomInformationPanel(Context context) {
super(context);
}
public CustomInformationPanel(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
public void setTitle(String str) {
this.a = str;
this.labelTitle.setText(str);
}
public void setTitleBackground(int i) {
this.labelTitle.setBackgroundColor(nMh.getColor(getContext(), i));
}
public void setInformationItemList(List<SZ> list) {
this.d = list;
InformationAdapter informationAdapter = new InformationAdapter(this, list);
RecyclerView recyclerView = this.recyclerView;
getContext();
recyclerView.setLayoutManager(new LinearLayoutManager());
this.recyclerView.setNestedScrollingEnabled(false);
this.recyclerView.setFocusable(false);
this.recyclerView.setAdapter(informationAdapter);
}
public final List<SZ> e() {
YKU yku = new YKU(this.d);
return (List) new YKU(yku.a, new GEP(yku.b, new Jel() { // from class: o.eDD
@Override // o.Jel
public final boolean e(Object obj) {
boolean z;
z = ((SZ) obj).j;
return z;
}
})).a(new PRA.Sts(new PRA.AnonymousClass4(), new PRA.AnonymousClass8()));
}
public void setOnHasValueItemListener(RVV rvv) {
this.c = rvv;
}
}