package defpackage;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
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;
import ar.tvplayer.tv.R;

/* JADX INFO: renamed from: ˀᵜʕ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0579 extends CheckedTextView implements InterfaceC0259 {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final C2435 f2848;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final C2938 f2849;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final C4132 f2850;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public C0909 f2851;

    public C0579(Context context, AttributeSet attributeSet) {
        int resourceId;
        int resourceId2;
        super(context, attributeSet, R.attr.h);
        AbstractC2340.m6017(getContext(), this);
        C2938 c2938 = new C2938(this);
        this.f2849 = c2938;
        c2938.m7013(attributeSet, R.attr.h);
        c2938.m7012();
        C4132 c4132 = new C4132(this);
        this.f2850 = c4132;
        c4132.m9047(attributeSet, R.attr.h);
        this.f2848 = new C2435(this);
        Context context2 = getContext();
        int[] iArr = AbstractC0430.f2393;
        C5398 c5398M11010 = C5398.m11010(context2, attributeSet, iArr, R.attr.h);
        TypedArray typedArray = (TypedArray) c5398M11010.f20483;
        AbstractC2746.m6646(this, getContext(), iArr, attributeSet, (TypedArray) c5398M11010.f20483, R.attr.h);
        try {
            if (typedArray.hasValue(1) && (resourceId2 = typedArray.getResourceId(1, 0)) != 0) {
                try {
                    setCheckMarkDrawable(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), resourceId2));
                } catch (Resources.NotFoundException unused) {
                    if (typedArray.hasValue(0)) {
                        setCheckMarkDrawable(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), resourceId));
                    }
                }
            } else if (typedArray.hasValue(0) && (resourceId = typedArray.getResourceId(0, 0)) != 0) {
                setCheckMarkDrawable(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), resourceId));
            }
            if (typedArray.hasValue(2)) {
                setCheckMarkTintList(c5398M11010.m11016(2));
            }
            if (typedArray.hasValue(3)) {
                setCheckMarkTintMode(AbstractC0912.m3159(typedArray.getInt(3, -1), null));
            }
            c5398M11010.m11012();
            getEmojiTextViewHelper().m3154(attributeSet, R.attr.h);
        } catch (Throwable th) {
            c5398M11010.m11012();
            throw th;
        }
    }

    private C0909 getEmojiTextViewHelper() {
        if (this.f2851 == null) {
            this.f2851 = new C0909(this);
        }
        return this.f2851;
    }

    @Override // android.widget.CheckedTextView, android.widget.TextView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        C2938 c2938 = this.f2849;
        if (c2938 != null) {
            c2938.m7012();
        }
        C4132 c4132 = this.f2850;
        if (c4132 != null) {
            c4132.m9036();
        }
        C2435 c2435 = this.f2848;
        if (c2435 != null) {
            c2435.m6174();
        }
    }

    @Override // android.widget.TextView
    public ActionMode.Callback getCustomSelectionActionModeCallback() {
        return ᵷᵸˁ.ʿٴˇ(super.getCustomSelectionActionModeCallback());
    }

    public ColorStateList getSupportBackgroundTintList() {
        C4132 c4132 = this.f2850;
        if (c4132 != null) {
            return c4132.m9055();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C4132 c4132 = this.f2850;
        if (c4132 != null) {
            return c4132.m9058();
        }
        return null;
    }

    public ColorStateList getSupportCheckMarkTintList() {
        C2435 c2435 = this.f2848;
        if (c2435 != null) {
            return c2435.f9481;
        }
        return null;
    }

    public PorterDuff.Mode getSupportCheckMarkTintMode() {
        C2435 c2435 = this.f2848;
        if (c2435 != null) {
            return c2435.f9478;
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        return this.f2849.m7024();
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return this.f2849.m7021();
    }

    @Override // android.widget.TextView, android.view.View
    public final InputConnection onCreateInputConnection(EditorInfo editorInfo) {
        InputConnection inputConnectionOnCreateInputConnection = super.onCreateInputConnection(editorInfo);
        ᵗʓ.ᵯᵷʽ(editorInfo, inputConnectionOnCreateInputConnection, this);
        return inputConnectionOnCreateInputConnection;
    }

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

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C4132 c4132 = this.f2850;
        if (c4132 != null) {
            c4132.m9051();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C4132 c4132 = this.f2850;
        if (c4132 != null) {
            c4132.m9048(i);
        }
    }

    @Override // android.widget.CheckedTextView
    public void setCheckMarkDrawable(int i) {
        setCheckMarkDrawable(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), i));
    }

    @Override // android.widget.CheckedTextView
    public void setCheckMarkDrawable(Drawable drawable) {
        super.setCheckMarkDrawable(drawable);
        C2435 c2435 = this.f2848;
        if (c2435 != null) {
            if (c2435.f9480) {
                c2435.f9480 = false;
            } else {
                c2435.f9480 = true;
                c2435.m6174();
            }
        }
    }

    @Override // android.widget.TextView
    public final void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        C2938 c2938 = this.f2849;
        if (c2938 != null) {
            c2938.m7012();
        }
    }

    @Override // android.widget.TextView
    public final void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        C2938 c2938 = this.f2849;
        if (c2938 != null) {
            c2938.m7012();
        }
    }

    @Override // android.widget.TextView
    public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
        super.setCustomSelectionActionModeCallback(ᵷᵸˁ.ᵠˏˏ(callback, this));
    }

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

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C4132 c4132 = this.f2850;
        if (c4132 != null) {
            c4132.m9046(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C4132 c4132 = this.f2850;
        if (c4132 != null) {
            c4132.m9045(mode);
        }
    }

    public void setSupportCheckMarkTintList(ColorStateList colorStateList) {
        C2435 c2435 = this.f2848;
        if (c2435 != null) {
            c2435.f9481 = colorStateList;
            c2435.f9479 = true;
            c2435.m6174();
        }
    }

    public void setSupportCheckMarkTintMode(PorterDuff.Mode mode) {
        C2435 c2435 = this.f2848;
        if (c2435 != null) {
            c2435.f9478 = mode;
            c2435.f9482 = true;
            c2435.m6174();
        }
    }

    @Override // defpackage.InterfaceC0259
    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        C2938 c2938 = this.f2849;
        c2938.m7014(colorStateList);
        c2938.m7012();
    }

    @Override // defpackage.InterfaceC0259
    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        C2938 c2938 = this.f2849;
        c2938.m7018(mode);
        c2938.m7012();
    }

    @Override // android.widget.TextView
    public final void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        C2938 c2938 = this.f2849;
        if (c2938 != null) {
            c2938.m7023(context, i);
        }
    }
}
