80 lines
3.0 KiB
Java
80 lines
3.0 KiB
Java
package androidx.appcompat.widget;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.ColorStateList;
|
|
import android.graphics.PorterDuff;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.util.AttributeSet;
|
|
import android.widget.CheckBox;
|
|
import androidx.appcompat.R$attr;
|
|
import androidx.appcompat.content.res.AppCompatResources;
|
|
import androidx.core.widget.TintableCompoundButton;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class AppCompatCheckBox extends CheckBox implements TintableCompoundButton {
|
|
private final AppCompatCompoundButtonHelper a;
|
|
|
|
public AppCompatCheckBox(Context context, AttributeSet attributeSet) {
|
|
this(context, attributeSet, R$attr.checkboxStyle);
|
|
}
|
|
|
|
@Override // android.widget.CompoundButton, android.widget.TextView
|
|
public int getCompoundPaddingLeft() {
|
|
int compoundPaddingLeft = super.getCompoundPaddingLeft();
|
|
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
|
return appCompatCompoundButtonHelper != null ? appCompatCompoundButtonHelper.a(compoundPaddingLeft) : compoundPaddingLeft;
|
|
}
|
|
|
|
public ColorStateList getSupportButtonTintList() {
|
|
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
|
if (appCompatCompoundButtonHelper != null) {
|
|
return appCompatCompoundButtonHelper.b();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public PorterDuff.Mode getSupportButtonTintMode() {
|
|
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
|
if (appCompatCompoundButtonHelper != null) {
|
|
return appCompatCompoundButtonHelper.c();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // android.widget.CompoundButton
|
|
public void setButtonDrawable(Drawable drawable) {
|
|
super.setButtonDrawable(drawable);
|
|
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
|
if (appCompatCompoundButtonHelper != null) {
|
|
appCompatCompoundButtonHelper.d();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.core.widget.TintableCompoundButton
|
|
public void setSupportButtonTintList(ColorStateList colorStateList) {
|
|
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
|
if (appCompatCompoundButtonHelper != null) {
|
|
appCompatCompoundButtonHelper.a(colorStateList);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.core.widget.TintableCompoundButton
|
|
public void setSupportButtonTintMode(PorterDuff.Mode mode) {
|
|
AppCompatCompoundButtonHelper appCompatCompoundButtonHelper = this.a;
|
|
if (appCompatCompoundButtonHelper != null) {
|
|
appCompatCompoundButtonHelper.a(mode);
|
|
}
|
|
}
|
|
|
|
public AppCompatCheckBox(Context context, AttributeSet attributeSet, int i) {
|
|
super(TintContextWrapper.b(context), attributeSet, i);
|
|
this.a = new AppCompatCompoundButtonHelper(this);
|
|
this.a.a(attributeSet, i);
|
|
}
|
|
|
|
@Override // android.widget.CompoundButton
|
|
public void setButtonDrawable(int i) {
|
|
setButtonDrawable(AppCompatResources.c(getContext(), i));
|
|
}
|
|
}
|