package com.google.android.material.focus;

import android.R;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableWrapper;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.os.Build;
import android.util.AttributeSet;
import android.util.StateSet;
import android.util.TypedValue;
import android.view.animation.OvershootInterpolator;
import defpackage.AbstractC2172;
import defpackage.C0474;
import defpackage.C0792;
import defpackage.C1033;
import defpackage.C2140;
import defpackage.C2359;
import defpackage.C3235;
import defpackage.C3289;
import defpackage.C3347;
import defpackage.InterfaceC5120;
import java.io.IOException;
import java.lang.ref.WeakReference;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

/* JADX INFO: loaded from: classes3.dex */
public class FocusRingDrawable extends DrawableWrapper {

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public float f1051;

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public C0792 f1052;

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public boolean f1053;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public final C3289 f1054;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public boolean f1055;

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

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public WeakReference f1057;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public ObjectAnimator f1058;

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

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

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public boolean f1061;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final Path f1062;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final Path f1063;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final Matrix f1064;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public float f1065;

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public static final ColorDrawable f1048 = new ColorDrawable(0);

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public static final int[] f1047 = {R.attr.state_focused, R.attr.state_window_focused};

    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public static final OvershootInterpolator f1049 = new OvershootInterpolator(4.0f);

    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public static final C2359 f1050 = new C2359();

    public FocusRingDrawable() {
        super(null);
        this.f1056 = new Paint(1);
        this.f1060 = new RectF();
        this.f1059 = new Rect();
        this.f1062 = new Path();
        this.f1063 = new Path();
        this.f1064 = new Matrix();
        this.f1054 = C3289.m7527();
        this.f1065 = -1.0f;
        this.f1051 = 1.0f;
        this.f1055 = false;
        this.f1053 = false;
        this.f1052 = new C0792(null);
    }

    public FocusRingDrawable(Context context, Drawable drawable) {
        super(drawable);
        this.f1056 = new Paint(1);
        this.f1060 = new RectF();
        this.f1059 = new Rect();
        this.f1062 = new Path();
        this.f1063 = new Path();
        this.f1064 = new Matrix();
        this.f1054 = C3289.m7527();
        this.f1065 = -1.0f;
        this.f1051 = 1.0f;
        this.f1055 = false;
        this.f1053 = false;
        C0792 c0792 = new C0792(null);
        this.f1052 = c0792;
        if (drawable != null) {
            c0792.f3569 = drawable.getConstantState();
        }
        m828(context.getTheme());
    }

    public FocusRingDrawable(C0792 c0792, Resources resources) {
        super(null);
        Paint paint = new Paint(1);
        this.f1056 = paint;
        this.f1060 = new RectF();
        this.f1059 = new Rect();
        this.f1062 = new Path();
        this.f1063 = new Path();
        this.f1064 = new Matrix();
        this.f1054 = C3289.m7527();
        this.f1065 = -1.0f;
        this.f1051 = 1.0f;
        this.f1055 = false;
        this.f1053 = false;
        C0792 c07922 = new C0792(c0792);
        this.f1052 = c07922;
        Drawable.ConstantState constantState = c07922.f3569;
        if (constantState != null) {
            setDrawable(resources != null ? constantState.newDrawable(resources) : constantState.newDrawable());
        }
        paint.setStyle(Paint.Style.STROKE);
        if (Float.isNaN(this.f1052.f3568)) {
            return;
        }
        paint.setStrokeWidth(this.f1052.f3568);
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public static int m822(TypedArray typedArray, int i) {
        if (typedArray.getType(i) != 2) {
            return Integer.MIN_VALUE;
        }
        TypedValue typedValue = new TypedValue();
        if (typedArray.getValue(i, typedValue)) {
            return typedValue.data;
        }
        return Integer.MIN_VALUE;
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public static FocusRingDrawable m823(Context context, RippleDrawable rippleDrawable) {
        if (Build.VERSION.SDK_INT < 24 || !ᵶᵦ.ᵨᵼⁱ(context.getTheme(), ar.tvplayer.tv.R.attr.h, false)) {
            return null;
        }
        FocusRingDrawable focusRingDrawable = new FocusRingDrawable(context, f1048);
        rippleDrawable.addLayer(focusRingDrawable);
        focusRingDrawable.setCallback(rippleDrawable);
        return focusRingDrawable;
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public static float m824(float f, Resources.Theme theme, int i, TypedArray typedArray, int i2, int i3) {
        if (!Float.isNaN(f)) {
            return f;
        }
        Resources resources = theme.getResources();
        if (i != Float.MIN_VALUE) {
            TypedValue typedValue = new TypedValue();
            if (theme.resolveAttribute(i, typedValue, true)) {
                return typedValue.getDimension(resources.getDisplayMetrics());
            }
        }
        float dimension = typedArray.getDimension(i2, Float.NaN);
        if (!Float.isNaN(dimension)) {
            return dimension;
        }
        if (i3 == 0) {
            return Float.NaN;
        }
        return resources.getDimension(i3);
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final void applyTheme(Resources.Theme theme) {
        super.applyTheme(theme);
        m828(theme);
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final boolean canApplyTheme() {
        return true;
    }

    /* JADX WARN: Removed duplicated region for block: B:17:0x0049  */
    /* JADX WARN: Removed duplicated region for block: B:38:0x00b7  */
    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void draw(Canvas canvas) {
        float fMax;
        int radius;
        super.draw(canvas);
        C0792 c0792 = this.f1052;
        if (c0792.f3559 && this.f1055) {
            float f = c0792.f3563;
            float f2 = c0792.f3568 / 2.0f;
            float f3 = this.f1051;
            float f4 = (f2 * f3) + f;
            float f5 = ((c0792.f3566 / 2.0f) * f3) + f + c0792.f3553;
            Path path = this.f1063;
            if (path.isEmpty()) {
                WeakReference weakReference = this.f1057;
                if (weakReference == null || weakReference.get() == null) {
                    path = null;
                } else {
                    path = ((C3347) this.f1057.get()).f12850;
                    if (path.isEmpty()) {
                    }
                }
            }
            Path path2 = path;
            C0792 c07922 = this.f1052;
            if (path2 != null) {
                m825(canvas, path2, f5, c07922.f3566, c07922.f3555);
                C0792 c07923 = this.f1052;
                m825(canvas, path2, f4, c07923.f3568, c07923.f3574);
                return;
            }
            if (Float.isNaN(c07922.f3556)) {
                fMax = this.f1065;
                if (fMax < 0.0f) {
                    WeakReference weakReference2 = this.f1057;
                    if (weakReference2 == null || weakReference2.get() == null) {
                        Drawable drawable = getDrawable();
                        fMax = (!(drawable instanceof RippleDrawable) || (radius = ((RippleDrawable) drawable).getRadius()) < 0) ? 0.0f : radius;
                    } else {
                        C3347 c3347 = (C3347) this.f1057.get();
                        float fM7677 = c3347.m7677(c3347.m7682(), c3347.f12842.f16512.mo5171(), c3347.f12836);
                        if (fM7677 >= 0.0f) {
                            fM7677 *= c3347.f12842.f16516;
                        }
                        if (fM7677 >= 0.0f) {
                            fMax = Math.max(0.0f, fM7677 - (this.f1052.f3568 / 2.0f));
                        }
                    }
                }
            } else {
                fMax = this.f1052.f3556;
            }
            float fMax2 = Math.max(0.0f, fMax - (this.f1052.f3568 / 2.0f));
            C0792 c07924 = this.f1052;
            float f6 = c07924.f3566;
            int i = c07924.f3555;
            RectF rectF = this.f1060;
            m826(rectF);
            rectF.inset(f5, f5);
            float f7 = f6 * this.f1051;
            Paint paint = this.f1056;
            paint.setStrokeWidth(f7);
            paint.setColor(i);
            canvas.drawRoundRect(rectF, fMax2, fMax2, paint);
            C0792 c07925 = this.f1052;
            float f8 = c07925.f3568;
            int i2 = c07925.f3574;
            m826(rectF);
            rectF.inset(f4, f4);
            paint.setStrokeWidth(f8 * this.f1051);
            paint.setColor(i2);
            canvas.drawRoundRect(rectF, fMax, fMax, paint);
        }
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final Drawable.ConstantState getConstantState() {
        C0792 c0792 = this.f1052;
        if (c0792.f3569 == null) {
            return null;
        }
        c0792.f3551 = getChangingConfigurations();
        return this.f1052;
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final boolean hasFocusStateSpecified() {
        try {
            if (super.hasFocusStateSpecified()) {
                return true;
            }
            return this.f1052.f3559;
        } catch (NoSuchMethodError unused) {
            return this.f1052.f3559;
        }
    }

    @Override // android.graphics.drawable.Drawable
    public final void inflate(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet) throws XmlPullParserException, IOException {
        inflate(resources, xmlPullParser, attributeSet, null);
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final void inflate(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Resources.Theme theme) throws XmlPullParserException, IOException {
        super.inflate(resources, xmlPullParser, attributeSet, theme);
        int[] iArr = AbstractC2172.f8632;
        TypedArray typedArrayObtainStyledAttributes = theme != null ? theme.obtainStyledAttributes(attributeSet, iArr, 0, 0) : resources.obtainAttributes(attributeSet, iArr);
        this.f1052.f3572 = m822(typedArrayObtainStyledAttributes, 0);
        if (this.f1052.f3572 == Integer.MIN_VALUE && typedArrayObtainStyledAttributes.hasValue(0)) {
            C0792 c0792 = this.f1052;
            c0792.f3559 = typedArrayObtainStyledAttributes.getBoolean(0, c0792.f3559);
            this.f1052.f3564 = true;
        }
        this.f1052.f3570 = m822(typedArrayObtainStyledAttributes, 5);
        C0792 c07922 = this.f1052;
        if (c07922.f3570 == Integer.MIN_VALUE) {
            c07922.f3574 = typedArrayObtainStyledAttributes.getColor(5, Integer.MIN_VALUE);
        }
        this.f1052.f3573 = m822(typedArrayObtainStyledAttributes, 1);
        C0792 c07923 = this.f1052;
        if (c07923.f3573 == Integer.MIN_VALUE) {
            c07923.f3555 = typedArrayObtainStyledAttributes.getColor(1, Integer.MIN_VALUE);
        }
        this.f1052.f3571 = m822(typedArrayObtainStyledAttributes, 6);
        C0792 c07924 = this.f1052;
        if (c07924.f3571 == Integer.MIN_VALUE) {
            c07924.f3568 = typedArrayObtainStyledAttributes.getDimension(6, Float.NaN);
        }
        this.f1052.f3562 = m822(typedArrayObtainStyledAttributes, 3);
        C0792 c07925 = this.f1052;
        if (c07925.f3562 == Integer.MIN_VALUE) {
            c07925.f3566 = typedArrayObtainStyledAttributes.getDimension(3, Float.NaN);
        }
        this.f1052.f3562 = m822(typedArrayObtainStyledAttributes, 3);
        C0792 c07926 = this.f1052;
        if (c07926.f3562 == Integer.MIN_VALUE) {
            c07926.f3566 = typedArrayObtainStyledAttributes.getDimension(3, Float.NaN);
        }
        this.f1052.f3565 = m822(typedArrayObtainStyledAttributes, 7);
        C0792 c07927 = this.f1052;
        if (c07927.f3565 == Integer.MIN_VALUE) {
            c07927.f3556 = typedArrayObtainStyledAttributes.getDimension(7, Float.NaN);
        }
        this.f1052.f3567 = m822(typedArrayObtainStyledAttributes, 4);
        C0792 c07928 = this.f1052;
        if (c07928.f3567 == Integer.MIN_VALUE) {
            c07928.f3563 = typedArrayObtainStyledAttributes.getDimension(4, Float.NaN);
        }
        this.f1052.f3552 = m822(typedArrayObtainStyledAttributes, 2);
        C0792 c07929 = this.f1052;
        if (c07929.f3552 == Integer.MIN_VALUE) {
            c07929.f3553 = typedArrayObtainStyledAttributes.getDimension(2, Float.NaN);
        }
        this.f1052.f3557 = m822(typedArrayObtainStyledAttributes, 8);
        this.f1052.f3554 = typedArrayObtainStyledAttributes.getType(8) == 1 ? typedArrayObtainStyledAttributes.getResourceId(8, Integer.MIN_VALUE) : Integer.MIN_VALUE;
        typedArrayObtainStyledAttributes.recycle();
        int depth = xmlPullParser.getDepth();
        Drawable drawableCreateFromXmlInner = null;
        while (true) {
            int next = xmlPullParser.next();
            if (next == 1 || (next == 3 && xmlPullParser.getDepth() <= depth)) {
                break;
            } else if (next == 2) {
                drawableCreateFromXmlInner = Drawable.createFromXmlInner(resources, xmlPullParser, attributeSet, theme);
            }
        }
        if (drawableCreateFromXmlInner != null) {
            setDrawable(drawableCreateFromXmlInner);
            this.f1052.f3569 = drawableCreateFromXmlInner.getConstantState();
        } else {
            ColorDrawable colorDrawable = f1048;
            setDrawable(colorDrawable);
            this.f1052.f3569 = colorDrawable.getConstantState();
        }
    }

    @Override // android.graphics.drawable.Drawable
    public final boolean isProjected() {
        Drawable drawable = getDrawable();
        return drawable != null && drawable.isProjected();
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final boolean isStateful() {
        return super.isStateful() || this.f1052.f3559;
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final void jumpToCurrentState() {
        super.jumpToCurrentState();
        ObjectAnimator objectAnimator = this.f1058;
        if (objectAnimator != null) {
            objectAnimator.end();
            this.f1058 = null;
        }
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final Drawable mutate() {
        if (!this.f1053 && super.mutate() == this) {
            this.f1052 = new C0792(this.f1052);
            Drawable drawable = getDrawable();
            if (drawable != null) {
                this.f1052.f3569 = drawable.getConstantState();
            }
            this.f1053 = true;
        }
        return this;
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final void onBoundsChange(Rect rect) {
        float[] cornerRadii;
        float cornerRadius;
        C2140 c2140;
        super.onBoundsChange(rect);
        C0792 c0792 = this.f1052;
        if (c0792.f3559) {
            InterfaceC5120 interfaceC5120 = c0792.f3558;
            if (interfaceC5120 != null) {
                m827(interfaceC5120);
                return;
            }
            Drawable drawable = getDrawable();
            InterfaceC5120 interfaceC51202 = null;
            if (drawable instanceof ShapeDrawable) {
                ShapeDrawable shapeDrawable = (ShapeDrawable) drawable;
                if (Build.VERSION.SDK_INT >= 24) {
                    Outline outline = new Outline();
                    shapeDrawable.getOutline(outline);
                    if (outline.getRadius() > 0.0f) {
                        C0474 c0474 = new C0474();
                        C0474 c04742 = new C0474();
                        C0474 c04743 = new C0474();
                        C0474 c04744 = new C0474();
                        ᵱᵻᵧᵷ r5 = new ᵱᵻᵧᵷ();
                        ᵱᵻᵧᵷ r6 = new ᵱᵻᵧᵷ();
                        ᵱᵻᵧᵷ r7 = new ᵱᵻᵧᵷ();
                        ᵱᵻᵧᵷ r8 = new ᵱᵻᵧᵷ();
                        float radius = outline.getRadius();
                        C3235 c3235 = new C3235(radius);
                        C3235 c32352 = new C3235(radius);
                        C3235 c32353 = new C3235(radius);
                        C3235 c32354 = new C3235(radius);
                        c2140 = new C2140();
                        c2140.f8484 = c0474;
                        c2140.f8478 = c04742;
                        c2140.f8480 = c04743;
                        c2140.f8487 = c04744;
                        c2140.f8481 = c3235;
                        c2140.f8489 = c32352;
                        c2140.f8485 = c32353;
                        c2140.f8479 = c32354;
                        c2140.f8488 = r5;
                        c2140.f8483 = r6;
                        c2140.f8486 = r7;
                        c2140.f8482 = r8;
                        interfaceC51202 = c2140;
                    }
                }
            } else if (drawable instanceof GradientDrawable) {
                GradientDrawable gradientDrawable = (GradientDrawable) drawable;
                if (Build.VERSION.SDK_INT >= 24) {
                    try {
                        cornerRadii = gradientDrawable.getCornerRadii();
                    } catch (NullPointerException unused) {
                        cornerRadii = null;
                    }
                    if (cornerRadii != null) {
                        C0474 c04745 = new C0474();
                        C0474 c04746 = new C0474();
                        C0474 c04747 = new C0474();
                        C0474 c04748 = new C0474();
                        ᵱᵻᵧᵷ r52 = new ᵱᵻᵧᵷ();
                        ᵱᵻᵧᵷ r62 = new ᵱᵻᵧᵷ();
                        ᵱᵻᵧᵷ r72 = new ᵱᵻᵧᵷ();
                        ᵱᵻᵧᵷ r82 = new ᵱᵻᵧᵷ();
                        C3235 c32355 = new C3235(Math.min(cornerRadii[0], cornerRadii[1]));
                        C3235 c32356 = new C3235(Math.min(cornerRadii[2], cornerRadii[3]));
                        C3235 c32357 = new C3235(Math.min(cornerRadii[4], cornerRadii[5]));
                        C3235 c32358 = new C3235(Math.min(cornerRadii[6], cornerRadii[7]));
                        c2140 = new C2140();
                        c2140.f8484 = c04745;
                        c2140.f8478 = c04746;
                        c2140.f8480 = c04747;
                        c2140.f8487 = c04748;
                        c2140.f8481 = c32355;
                        c2140.f8489 = c32356;
                        c2140.f8485 = c32357;
                        c2140.f8479 = c32358;
                        c2140.f8488 = r52;
                        c2140.f8483 = r62;
                        c2140.f8486 = r72;
                        c2140.f8482 = r82;
                        interfaceC51202 = c2140;
                    } else {
                        try {
                            cornerRadius = gradientDrawable.getCornerRadius();
                        } catch (NullPointerException unused2) {
                            cornerRadius = -1.0f;
                        }
                        if (cornerRadius > 0.0f) {
                            C0474 c04749 = new C0474();
                            C0474 c047410 = new C0474();
                            C0474 c047411 = new C0474();
                            C0474 c047412 = new C0474();
                            ᵱᵻᵧᵷ r53 = new ᵱᵻᵧᵷ();
                            ᵱᵻᵧᵷ r63 = new ᵱᵻᵧᵷ();
                            ᵱᵻᵧᵷ r73 = new ᵱᵻᵧᵷ();
                            ᵱᵻᵧᵷ r83 = new ᵱᵻᵧᵷ();
                            C3235 c32359 = new C3235(cornerRadius);
                            C3235 c323510 = new C3235(cornerRadius);
                            C3235 c323511 = new C3235(cornerRadius);
                            C3235 c323512 = new C3235(cornerRadius);
                            C2140 c21402 = new C2140();
                            c21402.f8484 = c04749;
                            c21402.f8478 = c047410;
                            c21402.f8480 = c047411;
                            c21402.f8487 = c047412;
                            c21402.f8481 = c32359;
                            c21402.f8489 = c323510;
                            c21402.f8485 = c323511;
                            c21402.f8479 = c323512;
                            c21402.f8488 = r53;
                            c21402.f8483 = r63;
                            c21402.f8486 = r73;
                            c21402.f8482 = r83;
                            interfaceC51202 = c21402;
                        }
                    }
                }
            }
            if (interfaceC51202 != null) {
                m827(interfaceC51202);
            } else {
                this.f1065 = -1.0f;
                this.f1063.reset();
            }
        }
    }

    @Override // android.graphics.drawable.DrawableWrapper, android.graphics.drawable.Drawable
    public final boolean onStateChange(int[] iArr) {
        C0792 c0792 = this.f1052;
        if (!c0792.f3559) {
            this.f1055 = false;
            return super.onStateChange(iArr);
        }
        boolean zStateSetMatches = StateSet.stateSetMatches(c0792.f3560, iArr);
        boolean z = this.f1055 != zStateSetMatches;
        this.f1055 = zStateSetMatches;
        if (z && iArr.length > 0 && !this.f1061) {
            ObjectAnimator objectAnimator = this.f1058;
            if (objectAnimator != null) {
                objectAnimator.cancel();
                this.f1058 = null;
            }
            if (!zStateSetMatches) {
                this.f1051 = 1.0f;
            } else if (Build.VERSION.SDK_INT >= 24) {
                ObjectAnimator objectAnimatorOfFloat = ObjectAnimator.ofFloat(this, f1050, 0.0f, 1.0f);
                objectAnimatorOfFloat.setDuration(300L);
                objectAnimatorOfFloat.setInterpolator(f1049);
                objectAnimatorOfFloat.addListener(new C1033(3, this));
                this.f1058 = objectAnimatorOfFloat;
                objectAnimatorOfFloat.start();
            }
        }
        this.f1061 = iArr.length == 0;
        return super.onStateChange(iArr) || z;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m825(Canvas canvas, Path path, float f, float f2, int i) {
        RectF rectF = this.f1060;
        m826(rectF);
        float f3 = f * 2.0f;
        float fWidth = 1.0f - (f3 / rectF.width());
        float fHeight = 1.0f - (f3 / rectF.height());
        Matrix matrix = this.f1064;
        matrix.reset();
        matrix.postScale(fWidth, fHeight, rectF.centerX(), rectF.centerY());
        Path path2 = this.f1062;
        path.transform(matrix, path2);
        float f4 = f2 * this.f1051;
        Paint paint = this.f1056;
        paint.setStrokeWidth(f4);
        paint.setColor(i);
        canvas.drawPath(path2, paint);
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final void m826(RectF rectF) {
        Rect rect = this.f1052.f3561;
        if (rect != null) {
            rectF.set(rect);
            return;
        }
        WeakReference weakReference = this.f1057;
        if (weakReference != null && weakReference.get() != null) {
            rectF.set(((C3347) this.f1057.get()).getBounds());
            return;
        }
        if (!(getDrawable() instanceof RippleDrawable)) {
            rectF.set(getBounds());
            return;
        }
        RippleDrawable rippleDrawable = (RippleDrawable) getDrawable();
        Rect rect2 = this.f1059;
        rippleDrawable.getHotspotBounds(rect2);
        int radius = rippleDrawable.getRadius();
        if (radius > 0) {
            rect2.inset(Math.max(0, (rect2.width() / 2) - radius), Math.max(0, (rect2.height() / 2) - radius));
        }
        rectF.set(rect2);
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final void m827(InterfaceC5120 interfaceC5120) {
        RectF rectF = this.f1060;
        m826(rectF);
        C2140 c2140Mo5170 = interfaceC5120.mo5170(f1047);
        boolean zM5657 = c2140Mo5170.m5657(rectF);
        Path path = this.f1063;
        if (!zM5657) {
            this.f1054.m7528(c2140Mo5170, null, 1.0f, rectF, null, path);
            this.f1065 = -1.0f;
            return;
        }
        C0792 c0792 = this.f1052;
        float f = ((c0792.f3568 / 2.0f) * this.f1051) + c0792.f3563;
        rectF.inset(f, f);
        this.f1065 = c2140Mo5170.f8481.mo3204(rectF);
        path.reset();
    }

    /* JADX WARN: Removed duplicated region for block: B:27:0x005a  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x007c  */
    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m828(Resources.Theme theme) {
        TypedValue typedValue;
        if (Build.VERSION.SDK_INT < 24) {
            return;
        }
        TypedArray typedArrayObtainStyledAttributes = theme.obtainStyledAttributes(AbstractC2172.f8632);
        int i = this.f1052.f3572;
        if (i != Integer.MIN_VALUE && (typedValue = ᵶᵦ.ᵜᵪʾ(theme, i)) != null) {
            C0792 c0792 = this.f1052;
            c0792.f3559 = typedValue.data != 0;
            c0792.f3564 = true;
        }
        C0792 c07922 = this.f1052;
        if (!c07922.f3564) {
            c07922.f3559 = ᵶᵦ.ᵨᵼⁱ(theme, ar.tvplayer.tv.R.attr.h, c07922.f3559);
        }
        C0792 c07923 = this.f1052;
        if (c07923.f3559) {
            int color = c07923.f3574;
            int i2 = c07923.f3570;
            if (color == Integer.MIN_VALUE) {
                if (i2 != Integer.MIN_VALUE) {
                    TypedValue typedValue2 = new TypedValue();
                    color = theme.resolveAttribute(i2, typedValue2, true) ? typedValue2.data : typedArrayObtainStyledAttributes.getColor(5, -16777216);
                }
            }
            c07923.f3574 = color;
            C0792 c07924 = this.f1052;
            int color2 = c07924.f3555;
            int i3 = c07924.f3573;
            if (color2 == Integer.MIN_VALUE) {
                if (i3 != Integer.MIN_VALUE) {
                    TypedValue typedValue3 = new TypedValue();
                    color2 = theme.resolveAttribute(i3, typedValue3, true) ? typedValue3.data : typedArrayObtainStyledAttributes.getColor(1, -1);
                }
            }
            c07924.f3555 = color2;
            C0792 c07925 = this.f1052;
            c07925.f3568 = m824(c07925.f3568, theme, c07925.f3571, typedArrayObtainStyledAttributes, 6, ar.tvplayer.tv.R.dimen.h);
            C0792 c07926 = this.f1052;
            c07926.f3566 = m824(c07926.f3566, theme, c07926.f3562, typedArrayObtainStyledAttributes, 3, ar.tvplayer.tv.R.dimen.h);
            C0792 c07927 = this.f1052;
            c07927.f3556 = m824(c07927.f3556, theme, c07927.f3565, typedArrayObtainStyledAttributes, 7, 0);
            C0792 c07928 = this.f1052;
            c07928.f3563 = m824(c07928.f3563, theme, c07928.f3567, typedArrayObtainStyledAttributes, 4, 0);
            if (Float.isNaN(this.f1052.f3563)) {
                this.f1052.f3563 = 0.0f;
            }
            C0792 c07929 = this.f1052;
            c07929.f3553 = m824(c07929.f3553, theme, c07929.f3552, typedArrayObtainStyledAttributes, 2, ar.tvplayer.tv.R.dimen.h);
            C0792 c079210 = this.f1052;
            int i4 = c079210.f3554;
            int[] iArr = AbstractC2172.f8633;
            if (i4 != Integer.MIN_VALUE) {
                c079210.f3558 = C2140.m5656(theme.obtainStyledAttributes(i4, iArr), new C3235(0.0f)).m7053();
            } else {
                int i5 = c079210.f3557;
                if (i5 == Integer.MIN_VALUE) {
                    i5 = ar.tvplayer.tv.R.attr.h;
                }
                TypedValue typedValue4 = ᵶᵦ.ᵜᵪʾ(theme, i5);
                if (typedValue4 != null) {
                    this.f1052.f3558 = C2140.m5656(theme.obtainStyledAttributes(typedValue4.resourceId, iArr), new C3235(0.0f)).m7053();
                }
            }
        }
        typedArrayObtainStyledAttributes.recycle();
        Paint.Style style = Paint.Style.STROKE;
        Paint paint = this.f1056;
        paint.setStyle(style);
        if (Float.isNaN(this.f1052.f3568)) {
            return;
        }
        paint.setStrokeWidth(this.f1052.f3568);
    }
}
