package androidx.appcompat.widget;

import android.R;
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.ToggleButton;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.view.x0;
import l.a1;
import l.f0;
import l.l3;
import l.y;
import u0.t;

/* JADX INFO: loaded from: classes.dex */
public class AppCompatToggleButton extends ToggleButton implements x0, t {

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

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

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

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

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

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

    @Override // androidx.core.view.x0
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public ColorStateList getSupportBackgroundTintList() {
        y yVar = this.f695a;
        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.f695a;
        if (yVar != null) {
            return yVar.c();
        }
        return null;
    }

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

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

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

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

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

    @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.f696b;
        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.f696b;
        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.f695a;
        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.f695a;
        if (yVar != null) {
            yVar.h(mode);
        }
    }

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

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

    public AppCompatToggleButton(@NonNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, R.attr.buttonStyleToggle);
    }

    public AppCompatToggleButton(@NonNull Context context, @Nullable AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        l3.a(getContext(), this);
        y yVar = new y(this);
        this.f695a = yVar;
        yVar.loadFromAttributes(attributeSet, i10);
        a1 a1Var = new a1(this);
        this.f696b = a1Var;
        a1Var.loadFromAttributes(attributeSet, i10);
        getEmojiTextViewHelper().loadFromAttributes(attributeSet, i10);
    }
}
