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

76 lines
2.0 KiB
Java

package com.scb.phone.view.custom;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import o.C10316eAl;
import o.IO;
/* loaded from: classes5.dex */
public class CustomCheckboxView extends ConstraintLayout {
private Sts b;
@BindView
TextView subtitle;
@BindView
TextView title;
@BindView
CheckBox toggleView;
/* loaded from: classes5.dex */
public interface Sts {
void b(boolean z);
}
public CustomCheckboxView(Context context) {
this(context, null);
}
public CustomCheckboxView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public CustomCheckboxView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
LayoutInflater.from(context).inflate(R.layout.2131558942, (ViewGroup) this, true);
ButterKnife.c(this);
}
public void setChecked(boolean z) {
this.toggleView.setOnCheckedChangeListener(null);
this.toggleView.setChecked(z);
this.toggleView.setOnCheckedChangeListener(new C10316eAl(this));
}
public static /* synthetic */ void d(CustomCheckboxView customCheckboxView, boolean z) {
Sts sts = customCheckboxView.b;
if (sts != null) {
sts.b(z);
}
}
public void setData(IO io2) {
this.title.setText(io2.c);
if (!TextUtils.isEmpty(io2.e)) {
this.subtitle.setVisibility(0);
this.subtitle.setText(io2.e);
}
setChecked(io2.a);
this.toggleView.setOnCheckedChangeListener(new C10316eAl(this));
}
public void setListener(Sts sts) {
this.b = sts;
}
}