package com.martsnew.tv.customviews;

import P6.g;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.TextView;
import com.martsnew.tv.R;
import r5.AbstractC1509n;

/* JADX INFO: loaded from: classes.dex */
@SuppressLint({"AppCompatCustomView"})
public final class TvButton extends TextView {
    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public TvButton(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, 0);
        g.e(context, "context");
        TypedArray typedArrayObtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, AbstractC1509n.f16579a, 0, 0);
        g.d(typedArrayObtainStyledAttributes, "obtainStyledAttributes(...)");
        int dimensionPixelSize = typedArrayObtainStyledAttributes.getDimensionPixelSize(1, R.dimen.dp_16);
        Drawable drawable = typedArrayObtainStyledAttributes.getDrawable(3);
        int i = typedArrayObtainStyledAttributes.getInt(0, 8388611);
        boolean z8 = typedArrayObtainStyledAttributes.getBoolean(2, false);
        if (drawable != null) {
            drawable.setBounds(0, 0, dimensionPixelSize, dimensionPixelSize);
        }
        if (i == 48) {
            setCompoundDrawables(null, drawable, null, null);
        } else if (i == 80) {
            setCompoundDrawables(null, null, null, drawable);
        } else if (i == 8388611) {
            setCompoundDrawables(drawable, null, null, null);
        } else if (i == 8388613) {
            setCompoundDrawables(null, null, drawable, null);
        }
        if (z8) {
            requestFocus();
        }
    }
}
