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

103 lines
3.0 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.custom.common;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.custom.common.BubbleSelector;
import o.C15715hv;
import o.nMh;
/* loaded from: classes5.dex */
public class BubbleSelector extends FrameLayout {
public String a;
@BindView
Button button;
private boolean c;
public RVV d;
/* loaded from: classes5.dex */
public interface RVV {
void c(String str, boolean z);
}
public BubbleSelector(Context context) {
this(context, null);
}
public BubbleSelector(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public BubbleSelector(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = false;
((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131558924, (ViewGroup) this, true);
ButterKnife.c(this);
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C15715hv.jbe.BubbleSelector, 0, 0);
try {
String string = obtainStyledAttributes.getString(1);
String string2 = obtainStyledAttributes.getString(0);
if (string2 != null) {
setKey(string2);
}
if (string != null) {
this.button.setText(string);
}
obtainStyledAttributes.recycle();
this.button.setOnClickListener(new View.OnClickListener(this) { // from class: o.eBe
private BubbleSelector b;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
BubbleSelector.a(this.b);
}
{
this.b = this;
}
});
setSelected(false);
} catch (Throwable th) {
obtainStyledAttributes.recycle();
throw th;
}
}
@Override // android.view.View
public void setSelected(boolean z) {
this.c = z;
this.button.setSelected(z);
setTextColor(nMh.getColor(getContext(), z ? R.color.f14042131100912 : R.color.f13682131100876));
}
public void setTextColor(int i) {
this.button.setTextColor(i);
}
public static /* synthetic */ void a(BubbleSelector bubbleSelector) {
bubbleSelector.setSelected(!bubbleSelector.c);
RVV rvv = bubbleSelector.d;
if (rvv != null) {
rvv.c(bubbleSelector.a, bubbleSelector.c);
}
}
public void setKey(String str) {
this.a = str;
}
@Override // android.view.View
public boolean isSelected() {
return this.c;
}
}