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;

/* JADX INFO: compiled from: AppCompatCheckBox.java */
/* JADX INFO: loaded from: classes.dex */
public class g extends CheckBox implements androidx.core.widget.m, androidx.core.view.w, androidx.core.widget.n {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private final j f907e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final e f908f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private final c0 f909g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private n f910h;

    public g(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, c.a.f3167r);
    }

    private n getEmojiTextViewHelper() {
        if (this.f910h == null) {
            this.f910h = new n(this);
        }
        return this.f910h;
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        e eVar = this.f908f;
        if (eVar != null) {
            eVar.b();
        }
        c0 c0Var = this.f909g;
        if (c0Var != null) {
            c0Var.b();
        }
    }

    @Override // android.widget.CompoundButton, android.widget.TextView
    public int getCompoundPaddingLeft() {
        int compoundPaddingLeft = super.getCompoundPaddingLeft();
        j jVar = this.f907e;
        return jVar != null ? jVar.b(compoundPaddingLeft) : compoundPaddingLeft;
    }

    @Override // androidx.core.view.w
    public ColorStateList getSupportBackgroundTintList() {
        e eVar = this.f908f;
        if (eVar != null) {
            return eVar.c();
        }
        return null;
    }

    @Override // androidx.core.view.w
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        e eVar = this.f908f;
        if (eVar != null) {
            return eVar.d();
        }
        return null;
    }

    @Override // androidx.core.widget.m
    public ColorStateList getSupportButtonTintList() {
        j jVar = this.f907e;
        if (jVar != null) {
            return jVar.c();
        }
        return null;
    }

    public PorterDuff.Mode getSupportButtonTintMode() {
        j jVar = this.f907e;
        if (jVar != null) {
            return jVar.d();
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        return this.f909g.j();
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return this.f909g.k();
    }

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

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        e eVar = this.f908f;
        if (eVar != null) {
            eVar.f(drawable);
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i3) {
        super.setBackgroundResource(i3);
        e eVar = this.f908f;
        if (eVar != null) {
            eVar.g(i3);
        }
    }

    @Override // android.widget.CompoundButton
    public void setButtonDrawable(Drawable drawable) {
        super.setButtonDrawable(drawable);
        j jVar = this.f907e;
        if (jVar != null) {
            jVar.f();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        c0 c0Var = this.f909g;
        if (c0Var != null) {
            c0Var.p();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        c0 c0Var = this.f909g;
        if (c0Var != null) {
            c0Var.p();
        }
    }

    public void setEmojiCompatEnabled(boolean z2) {
        getEmojiTextViewHelper().d(z2);
    }

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

    @Override // androidx.core.view.w
    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        e eVar = this.f908f;
        if (eVar != null) {
            eVar.i(colorStateList);
        }
    }

    @Override // androidx.core.view.w
    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        e eVar = this.f908f;
        if (eVar != null) {
            eVar.j(mode);
        }
    }

    @Override // androidx.core.widget.m
    public void setSupportButtonTintList(ColorStateList colorStateList) {
        j jVar = this.f907e;
        if (jVar != null) {
            jVar.g(colorStateList);
        }
    }

    @Override // androidx.core.widget.m
    public void setSupportButtonTintMode(PorterDuff.Mode mode) {
        j jVar = this.f907e;
        if (jVar != null) {
            jVar.h(mode);
        }
    }

    @Override // androidx.core.widget.n
    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        this.f909g.w(colorStateList);
        this.f909g.b();
    }

    @Override // androidx.core.widget.n
    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        this.f909g.x(mode);
        this.f909g.b();
    }

    public g(Context context, AttributeSet attributeSet, int i3) {
        super(x0.b(context), attributeSet, i3);
        v0.a(this, getContext());
        j jVar = new j(this);
        this.f907e = jVar;
        jVar.e(attributeSet, i3);
        e eVar = new e(this);
        this.f908f = eVar;
        eVar.e(attributeSet, i3);
        c0 c0Var = new c0(this);
        this.f909g = c0Var;
        c0Var.m(attributeSet, i3);
        getEmojiTextViewHelper().b(attributeSet, i3);
    }

    @Override // android.widget.CompoundButton
    public void setButtonDrawable(int i3) {
        setButtonDrawable(d.a.b(getContext(), i3));
    }
}
