package o;

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;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class K8 extends ToggleButton {
    public final C2689v7 l;
    public final A8 m;
    public Y7 n;

    public K8(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, R.attr.buttonStyleToggle);
        AbstractC1498if0.a(this, getContext());
        C2689v7 c2689v7 = new C2689v7(this);
        this.l = c2689v7;
        c2689v7.m(attributeSet, R.attr.buttonStyleToggle);
        A8 a8 = new A8(this);
        this.m = a8;
        a8.f(attributeSet, R.attr.buttonStyleToggle);
        getEmojiTextViewHelper().a(attributeSet, R.attr.buttonStyleToggle);
    }

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

    @Override // android.widget.ToggleButton, android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        C2689v7 c2689v7 = this.l;
        if (c2689v7 != null) {
            c2689v7.i();
        }
        A8 a8 = this.m;
        if (a8 != null) {
            a8.b();
        }
    }

    public ColorStateList getSupportBackgroundTintList() {
        C2689v7 c2689v7 = this.l;
        if (c2689v7 != null) {
            return c2689v7.j();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C2689v7 c2689v7 = this.l;
        if (c2689v7 != null) {
            return c2689v7.k();
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        return this.m.d();
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return this.m.e();
    }

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

    @Override // android.widget.ToggleButton, android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C2689v7 c2689v7 = this.l;
        if (c2689v7 != null) {
            c2689v7.o();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C2689v7 c2689v7 = this.l;
        if (c2689v7 != null) {
            c2689v7.p(i);
        }
    }

    @Override // android.widget.TextView
    public final void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        A8 a8 = this.m;
        if (a8 != null) {
            a8.b();
        }
    }

    @Override // android.widget.TextView
    public final void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        A8 a8 = this.m;
        if (a8 != null) {
            a8.b();
        }
    }

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

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

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C2689v7 c2689v7 = this.l;
        if (c2689v7 != null) {
            c2689v7.r(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C2689v7 c2689v7 = this.l;
        if (c2689v7 != null) {
            c2689v7.s(mode);
        }
    }

    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        A8 a8 = this.m;
        a8.k(colorStateList);
        a8.b();
    }

    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        A8 a8 = this.m;
        a8.l(mode);
        a8.b();
    }
}
