package defpackage;

import android.R;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableWrapper;
import android.graphics.drawable.RippleDrawable;
import android.util.AttributeSet;

/* renamed from: ᵰᵜˊˈ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4353 extends C0905 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public static final int[][] f16294 = {new int[]{R.attr.state_enabled, R.attr.state_checked}, new int[]{R.attr.state_enabled, -16842912}, new int[]{-16842910, R.attr.state_checked}, new int[]{-16842910, -16842912}};

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public boolean f16295;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public ColorStateList f16296;

    public C4353(Context context, AttributeSet attributeSet) {
        super(ᵙᵛᵯ.ᵶʔᵢˊ(context, attributeSet, ar.tvplayer.tv.R.attr._11_res_0x7f040524, ar.tvplayer.tv.R.style._11_res_0x7f1406af, new int[0]), attributeSet);
        Context context2 = getContext();
        ˁˈᵸ.ᵻᵢﹳᵰ(context2, attributeSet, ar.tvplayer.tv.R.attr._11_res_0x7f040524, ar.tvplayer.tv.R.style._11_res_0x7f1406af);
        int[] iArr = AbstractC0914.f4185;
        ˁˈᵸ.ˇʼʤˎ(context2, attributeSet, iArr, ar.tvplayer.tv.R.attr._11_res_0x7f040524, ar.tvplayer.tv.R.style._11_res_0x7f1406af, new int[0]);
        TypedArray typedArrayObtainStyledAttributes = context2.obtainStyledAttributes(attributeSet, iArr, ar.tvplayer.tv.R.attr._11_res_0x7f040524, ar.tvplayer.tv.R.style._11_res_0x7f1406af);
        if (typedArrayObtainStyledAttributes.hasValue(0)) {
            setButtonTintList(ˉˇʨ.ᵪʩ(context2, typedArrayObtainStyledAttributes, 0));
        }
        if (typedArrayObtainStyledAttributes.hasValue(1)) {
            setRippleColor(ˉˇʨ.ᵪʩ(context2, typedArrayObtainStyledAttributes, 1));
        }
        this.f16295 = typedArrayObtainStyledAttributes.getBoolean(2, false);
        typedArrayObtainStyledAttributes.recycle();
    }

    private ColorStateList getMaterialThemeColorsTintList() {
        if (this.f16296 == null) {
            int i = ᵙᵛᵯ.ˌʾˀ(this, ar.tvplayer.tv.R.attr._11_res_0x7f04013b);
            int i2 = ᵙᵛᵯ.ˌʾˀ(this, ar.tvplayer.tv.R.attr._11_res_0x7f040158);
            int i3 = ᵙᵛᵯ.ˌʾˀ(this, ar.tvplayer.tv.R.attr._11_res_0x7f040172);
            this.f16296 = new ColorStateList(f16294, new int[]{ᵙᵛᵯ.ᵿʗᵝʽ(1.0f, i3, i), ᵙᵛᵯ.ᵿʗᵝʽ(0.54f, i3, i2), ᵙᵛᵯ.ᵿʗᵝʽ(0.38f, i3, i2), ᵙᵛᵯ.ᵿʗᵝʽ(0.38f, i3, i2)});
        }
        return this.f16296;
    }

    private void setRippleColor(ColorStateList colorStateList) {
        if (colorStateList == null) {
            return;
        }
        Drawable background = getBackground();
        if (background instanceof DrawableWrapper) {
            background = ((DrawableWrapper) background).getDrawable();
        }
        if (background instanceof RippleDrawable) {
            ((RippleDrawable) background).setColor(colorStateList);
        }
    }

    @Override // android.widget.TextView, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (this.f16295 && getButtonTintList() == null) {
            setUseMaterialThemeColors(true);
        }
    }

    public void setUseMaterialThemeColors(boolean z) {
        this.f16295 = z;
        if (z) {
            setButtonTintList(getMaterialThemeColorsTintList());
        } else {
            setButtonTintList(null);
        }
    }
}
