package androidx.appcompat.widget;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.text.InputFilter;
import android.util.AttributeSet;
import android.widget.CheckBox;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.view.x0;
import l.a0;
import l.a1;
import l.f0;
import l.l3;
import l.m3;
import l.y;
import u0.s;
import u0.t;

/* JADX INFO: loaded from: classes.dex */
public class AppCompatCheckBox extends CheckBox implements s, x0, t {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final a0 f652a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final y f653b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final a1 f654c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public f0 f655d;

    public AppCompatCheckBox(@NonNull Context context) {
        this(context, null);
    }

    @NonNull
    private f0 getEmojiTextViewHelper() {
        if (this.f655d == null) {
            this.f655d = new f0(this);
        }
        return this.f655d;
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public void drawableStateChanged() {
        super.drawableStateChanged();
        y yVar = this.f653b;
        if (yVar != null) {
            yVar.a();
        }
        a1 a1Var = this.f654c;
        if (a1Var != null) {
            a1Var.b();
        }
    }

    @Override // androidx.core.view.x0
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public ColorStateList getSupportBackgroundTintList() {
        y yVar = this.f653b;
        if (yVar != null) {
            return yVar.b();
        }
        return null;
    }

    @Override // androidx.core.view.x0
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        y yVar = this.f653b;
        if (yVar != null) {
            return yVar.c();
        }
        return null;
    }

    @Override // u0.s
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public ColorStateList getSupportButtonTintList() {
        a0 a0Var = this.f652a;
        if (a0Var != null) {
            return a0Var.f29599b;
        }
        return null;
    }

    @Override // u0.s
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public PorterDuff.Mode getSupportButtonTintMode() {
        a0 a0Var = this.f652a;
        if (a0Var != null) {
            return a0Var.f29600c;
        }
        return null;
    }

    @Override // u0.t
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public ColorStateList getSupportCompoundDrawablesTintList() {
        return this.f654c.getCompoundDrawableTintList();
    }

    @Override // u0.t
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return this.f654c.getCompoundDrawableTintMode();
    }

    @Override // android.widget.TextView
    public void setAllCaps(boolean z10) {
        super.setAllCaps(z10);
        getEmojiTextViewHelper().b(z10);
    }

    @Override // android.view.View
    public void setBackgroundDrawable(@Nullable Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        y yVar = this.f653b;
        if (yVar != null) {
            yVar.d();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(@DrawableRes int i10) {
        super.setBackgroundResource(i10);
        y yVar = this.f653b;
        if (yVar != null) {
            yVar.e(i10);
        }
    }

    @Override // android.widget.CompoundButton
    public void setButtonDrawable(Drawable drawable) {
        super.setButtonDrawable(drawable);
        a0 a0Var = this.f652a;
        if (a0Var != null) {
            if (a0Var.f29603f) {
                a0Var.f29603f = false;
            } else {
                a0Var.f29603f = true;
                a0Var.a();
            }
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawables(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        a1 a1Var = this.f654c;
        if (a1Var != null) {
            a1Var.b();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelative(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        a1 a1Var = this.f654c;
        if (a1Var != null) {
            a1Var.b();
        }
    }

    public void setEmojiCompatEnabled(boolean z10) {
        getEmojiTextViewHelper().c(z10);
    }

    @Override // android.widget.TextView
    public void setFilters(@NonNull InputFilter[] inputFilterArr) {
        super.setFilters(getEmojiTextViewHelper().a(inputFilterArr));
    }

    @Override // androidx.core.view.x0
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportBackgroundTintList(@Nullable ColorStateList colorStateList) {
        y yVar = this.f653b;
        if (yVar != null) {
            yVar.g(colorStateList);
        }
    }

    @Override // androidx.core.view.x0
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode mode) {
        y yVar = this.f653b;
        if (yVar != null) {
            yVar.h(mode);
        }
    }

    @Override // u0.s
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportButtonTintList(@Nullable ColorStateList colorStateList) {
        a0 a0Var = this.f652a;
        if (a0Var != null) {
            a0Var.f29599b = colorStateList;
            a0Var.f29601d = true;
            a0Var.a();
        }
    }

    @Override // u0.s
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportButtonTintMode(@Nullable PorterDuff.Mode mode) {
        a0 a0Var = this.f652a;
        if (a0Var != null) {
            a0Var.setSupportButtonTintMode(mode);
        }
    }

    @Override // u0.t
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportCompoundDrawablesTintList(@Nullable ColorStateList colorStateList) {
        a1 a1Var = this.f654c;
        a1Var.setCompoundDrawableTintList(colorStateList);
        a1Var.b();
    }

    @Override // u0.t
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportCompoundDrawablesTintMode(@Nullable PorterDuff.Mode mode) {
        a1 a1Var = this.f654c;
        a1Var.setCompoundDrawableTintMode(mode);
        a1Var.b();
    }

    public AppCompatCheckBox(@NonNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, d.a.checkboxStyle);
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public AppCompatCheckBox(@NonNull Context context, @Nullable AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        m3.a(context);
        l3.a(getContext(), this);
        a0 a0Var = new a0(this);
        this.f652a = a0Var;
        a0Var.loadFromAttributes(attributeSet, i10);
        y yVar = new y(this);
        this.f653b = yVar;
        yVar.loadFromAttributes(attributeSet, i10);
        a1 a1Var = new a1(this);
        this.f654c = a1Var;
        a1Var.loadFromAttributes(attributeSet, i10);
        getEmojiTextViewHelper().loadFromAttributes(attributeSet, i10);
    }

    @Override // android.widget.CompoundButton
    public void setButtonDrawable(@DrawableRes int i10) {
        setButtonDrawable(f.a.getDrawable(getContext(), i10));
    }
}
