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

196 lines
5.6 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.custom;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.custom.CustomCheckboxGroupView;
import com.scb.phone.view.custom.CustomCheckboxView;
import java.util.Collections;
import o.C12015eqI;
import o.GEP;
import o.IQ;
import o.Jel;
import o.VPK;
import o.YKU;
import o.nMh;
import o.qsu;
import o.zEQ;
/* loaded from: classes5.dex */
public class CustomCheckboxGroupView extends ConstraintLayout {
private boolean a;
private IeS c;
@BindView
RecyclerView childrenContainer;
@BindView
Group childrenGroup;
private C12015eqI d;
@BindView
CustomCheckboxView mainCheckbox;
@BindView
TextView title;
/* loaded from: classes5.dex */
public interface IeS {
void c(String str, String str2, boolean z);
}
public CustomCheckboxGroupView(Context context) {
this(context, null, 0);
}
public CustomCheckboxGroupView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public CustomCheckboxGroupView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
LayoutInflater.from(context).inflate(R.layout.2131558943, (ViewGroup) this, true);
ButterKnife.c(this);
RecyclerView recyclerView = this.childrenContainer;
getContext();
recyclerView.setLayoutManager(new LinearLayoutManager());
C12015eqI c12015eqI = new C12015eqI(Collections.emptyList());
this.d = c12015eqI;
this.childrenContainer.setAdapter(c12015eqI);
VPK vpk = new VPK(getContext());
Drawable drawable = nMh.getDrawable(getContext(), R.drawable.rv_divider);
if (drawable != null) {
if (drawable != null) {
vpk.b = drawable;
this.childrenContainer.d(vpk, -1);
return;
}
throw new IllegalArgumentException("Drawable cannot be null.");
}
}
public void setChecked(boolean z) {
setChecked(null, z);
}
public void setChecked(final String str, final boolean z) {
zEQ d;
if (str == null) {
this.mainCheckbox.setChecked(z);
return;
}
final C12015eqI c12015eqI = this.d;
YKU yku = new YKU(c12015eqI.a);
YKU yku2 = new YKU(yku.a, new GEP(yku.b, new Jel(str) { // from class: o.eqM
private String b;
@Override // o.Jel
public final boolean e(Object obj) {
boolean equals;
equals = ((IO) obj).b.equals(this.b);
return equals;
}
{
this.b = str;
}
}));
if (yku2.b.hasNext()) {
d = zEQ.a(yku2.b.next());
} else {
d = zEQ.d();
}
qsu qsuVar = new qsu(c12015eqI, z) { // from class: o.eqK
private C12015eqI b;
private boolean d;
@Override // o.qsu
public final void d(Object obj) {
C12015eqI.b(this.b, this.d, (IO) obj);
}
{
this.b = c12015eqI;
this.d = z;
}
};
T t = d.d;
if (t != 0) {
qsuVar.d(t);
}
}
public static /* synthetic */ void e(CustomCheckboxGroupView customCheckboxGroupView, IQ iq, boolean z) {
if (customCheckboxGroupView.a) {
customCheckboxGroupView.childrenGroup.setVisibility(z ? 0 : 8);
}
IeS ieS = customCheckboxGroupView.c;
if (ieS != null) {
ieS.c(iq.c.b, null, z);
}
}
public static /* synthetic */ void c(CustomCheckboxGroupView customCheckboxGroupView, IQ iq, String str, boolean z) {
IeS ieS = customCheckboxGroupView.c;
if (ieS != null) {
ieS.c(iq.c.b, str, z);
}
}
public void setData(final IQ iq) {
this.title.setText(iq.b);
this.mainCheckbox.setData(iq.c);
this.mainCheckbox.setListener(new CustomCheckboxView.Sts(this, iq) { // from class: o.eAk
private CustomCheckboxGroupView a;
private IQ d;
@Override // com.scb.phone.view.custom.CustomCheckboxView.Sts
public final void b(boolean z) {
CustomCheckboxGroupView.e(this.a, this.d, z);
}
{
this.a = this;
this.d = iq;
}
});
if (this.a && !iq.c.a) {
this.childrenGroup.setVisibility(8);
}
this.d.a = iq.e;
this.d.notifyDataSetChanged();
this.d.b = new C12015eqI.IeS(this, iq) { // from class: o.eAi
private CustomCheckboxGroupView c;
private IQ d;
@Override // o.C12015eqI.IeS
public final void a(String str, boolean z) {
CustomCheckboxGroupView.c(this.c, this.d, str, z);
}
{
this.c = this;
this.d = iq;
}
};
}
public void setListener(IeS ieS) {
this.c = ieS;
}
public void setHideChildrenWhenUnchecked(boolean z) {
this.a = z;
}
}