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.view.ActionMode;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.CheckedTextView;

/* JADX INFO: compiled from: AppCompatCheckedTextView.java */
/* JADX INFO: loaded from: classes.dex */
public class h extends CheckedTextView implements androidx.core.widget.l, androidx.core.view.w, androidx.core.widget.n {

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

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

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

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

    public h(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, c.a.f3168s);
    }

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

    @Override // android.widget.CheckedTextView, android.widget.TextView, android.view.View
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        c0 c0Var = this.f925g;
        if (c0Var != null) {
            c0Var.b();
        }
        e eVar = this.f924f;
        if (eVar != null) {
            eVar.b();
        }
        i iVar = this.f923e;
        if (iVar != null) {
            iVar.a();
        }
    }

    @Override // android.widget.TextView
    public ActionMode.Callback getCustomSelectionActionModeCallback() {
        return androidx.core.widget.j.p(super.getCustomSelectionActionModeCallback());
    }

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

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

    public ColorStateList getSupportCheckMarkTintList() {
        i iVar = this.f923e;
        if (iVar != null) {
            return iVar.b();
        }
        return null;
    }

    public PorterDuff.Mode getSupportCheckMarkTintMode() {
        i iVar = this.f923e;
        if (iVar != null) {
            return iVar.c();
        }
        return null;
    }

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

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

    @Override // android.widget.TextView, android.view.View
    public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
        return o.a(super.onCreateInputConnection(editorInfo), editorInfo, this);
    }

    @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.f924f;
        if (eVar != null) {
            eVar.f(drawable);
        }
    }

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

    @Override // android.widget.CheckedTextView
    public void setCheckMarkDrawable(Drawable drawable) {
        super.setCheckMarkDrawable(drawable);
        i iVar = this.f923e;
        if (iVar != null) {
            iVar.e();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        c0 c0Var = this.f925g;
        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.f925g;
        if (c0Var != null) {
            c0Var.p();
        }
    }

    @Override // android.widget.TextView
    public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
        super.setCustomSelectionActionModeCallback(androidx.core.widget.j.q(this, callback));
    }

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

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

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

    @Override // androidx.core.widget.l
    public void setSupportCheckMarkTintList(ColorStateList colorStateList) {
        i iVar = this.f923e;
        if (iVar != null) {
            iVar.f(colorStateList);
        }
    }

    @Override // androidx.core.widget.l
    public void setSupportCheckMarkTintMode(PorterDuff.Mode mode) {
        i iVar = this.f923e;
        if (iVar != null) {
            iVar.g(mode);
        }
    }

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

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

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i3) {
        super.setTextAppearance(context, i3);
        c0 c0Var = this.f925g;
        if (c0Var != null) {
            c0Var.q(context, i3);
        }
    }

    public h(Context context, AttributeSet attributeSet, int i3) {
        super(x0.b(context), attributeSet, i3);
        v0.a(this, getContext());
        c0 c0Var = new c0(this);
        this.f925g = c0Var;
        c0Var.m(attributeSet, i3);
        c0Var.b();
        e eVar = new e(this);
        this.f924f = eVar;
        eVar.e(attributeSet, i3);
        i iVar = new i(this);
        this.f923e = iVar;
        iVar.d(attributeSet, i3);
        getEmojiTextViewHelper().b(attributeSet, i3);
    }

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