package androidx.media3.ui;

import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import defpackage.AbstractC0375;
import defpackage.AbstractC3558;
import defpackage.C5572;
import defpackage.InterfaceC4300;
import defpackage.InterfaceC5070;
import defpackage.RunnableC3566;
import java.util.Collections;
import java.util.Formatter;
import java.util.Iterator;
import java.util.Locale;
import java.util.concurrent.CopyOnWriteArraySet;

/* loaded from: classes3.dex */
public class DefaultTimeBar extends View implements InterfaceC4300 {

    /* renamed from: ᵠᵪˀᵻ, reason: contains not printable characters */
    public static final /* synthetic */ int f666 = 0;

    /* renamed from: ʽᵢˊ, reason: contains not printable characters */
    public final int f667;

    /* renamed from: ʾᵻᵭٴ, reason: contains not printable characters */
    public boolean f668;

    /* renamed from: ˀˁᵨ, reason: contains not printable characters */
    public Rect f669;

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final Paint f670;

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public final Formatter f671;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final int f672;

    /* renamed from: ˆᵴᵜˏ, reason: contains not printable characters */
    public long f673;

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public final RunnableC3566 f674;

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public int f675;

    /* renamed from: ˊʾˊ, reason: contains not printable characters */
    public final ValueAnimator f676;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public final StringBuilder f677;

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public final CopyOnWriteArraySet f678;

    /* renamed from: ˌᵹᵨˑ, reason: contains not printable characters */
    public boolean f679;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final Paint f680;

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public long f681;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public final int f682;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final Paint f683;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final int f684;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public final int f685;

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public long f686;

    /* renamed from: ᵠᵿː, reason: contains not printable characters */
    public boolean f687;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final Paint f688;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public final int f689;

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public final float f690;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final Paint f691;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final Rect f692;

    /* renamed from: ᵣᵟᵔ, reason: contains not printable characters */
    public long f693;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final RectF f694;

    /* renamed from: ᵤᵼˑʠ, reason: contains not printable characters */
    public long f695;

    /* renamed from: ᵥʩᵩˑ, reason: contains not printable characters */
    public long f696;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final Drawable f697;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final Rect f698;

    /* renamed from: ᵨٴ, reason: contains not printable characters */
    public int f699;

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public long f700;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final Paint f701;

    /* renamed from: ᵲᵟ, reason: contains not printable characters */
    public float f702;

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public final Point f703;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final int f704;

    /* renamed from: ᵷᵱ, reason: contains not printable characters */
    public float f705;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public int f706;

    /* renamed from: ᵺᵠ, reason: contains not printable characters */
    public boolean f707;

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public int f708;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final RectF f709;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final Rect f710;

    /* renamed from: ﹶـ, reason: contains not printable characters */
    public long f711;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final int f712;

    public DefaultTimeBar(Context context) {
        this(context, null);
    }

    public DefaultTimeBar(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public DefaultTimeBar(Context context, AttributeSet attributeSet, int i) {
        this(context, attributeSet, i, attributeSet);
    }

    public DefaultTimeBar(Context context, AttributeSet attributeSet, int i, AttributeSet attributeSet2) {
        this(context, attributeSet, i, attributeSet2, 0);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r8v2 */
    /* JADX WARN: Type inference failed for: r8v3, types: [boolean, int] */
    /* JADX WARN: Type inference failed for: r8v4 */
    public DefaultTimeBar(Context context, AttributeSet attributeSet, int i, AttributeSet attributeSet2, int i2) {
        ?? r8;
        super(context, attributeSet, i);
        this.f702 = 1.0f;
        this.f699 = -1;
        this.f667 = -10066330;
        this.f698 = new Rect();
        this.f692 = new Rect();
        this.f710 = new Rect();
        this.f709 = new RectF();
        this.f694 = new RectF();
        Paint paint = new Paint();
        this.f691 = paint;
        Paint paint2 = new Paint();
        this.f670 = paint2;
        Paint paint3 = new Paint();
        this.f688 = paint3;
        Paint paint4 = new Paint();
        this.f683 = paint4;
        Paint paint5 = new Paint();
        this.f680 = paint5;
        Paint paint6 = new Paint();
        this.f701 = paint6;
        paint6.setAntiAlias(true);
        this.f678 = new CopyOnWriteArraySet();
        this.f703 = new Point();
        float f = context.getResources().getDisplayMetrics().density;
        this.f690 = f;
        this.f682 = m412(-50, f);
        int iM412 = m412(3, f);
        int iM4122 = m412(26, f);
        int iM4123 = m412(4, f);
        int iM4124 = m412(9, f);
        int iM4125 = m412(0, f);
        int iM4126 = m412(16, f);
        if (attributeSet2 != null) {
            TypedArray typedArrayObtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet2, AbstractC0375.f2163, i, i2);
            try {
                Drawable drawable = typedArrayObtainStyledAttributes.getDrawable(10);
                this.f697 = drawable;
                if (drawable != null) {
                    drawable.setLayoutDirection(getLayoutDirection());
                    iM4122 = Math.max(drawable.getMinimumHeight(), iM4122);
                }
                this.f706 = typedArrayObtainStyledAttributes.getDimensionPixelSize(3, iM412);
                this.f684 = typedArrayObtainStyledAttributes.getDimensionPixelSize(12, iM4122);
                this.f704 = typedArrayObtainStyledAttributes.getInt(2, 0);
                typedArrayObtainStyledAttributes.getDimensionPixelSize(1, iM4123);
                this.f672 = typedArrayObtainStyledAttributes.getDimensionPixelSize(11, iM4124);
                this.f712 = typedArrayObtainStyledAttributes.getDimensionPixelSize(8, iM4125);
                this.f685 = typedArrayObtainStyledAttributes.getDimensionPixelSize(9, iM4126);
                int i3 = typedArrayObtainStyledAttributes.getInt(6, -1);
                int i4 = typedArrayObtainStyledAttributes.getInt(7, -1);
                int i5 = typedArrayObtainStyledAttributes.getInt(4, -855638017);
                int i6 = typedArrayObtainStyledAttributes.getInt(13, -10066330);
                this.f667 = i6;
                int i7 = typedArrayObtainStyledAttributes.getInt(0, -1291845888);
                int i8 = typedArrayObtainStyledAttributes.getInt(5, 872414976);
                paint.setColor(i3);
                paint6.setColor(i4);
                paint2.setColor(i5);
                paint3.setColor(i6);
                paint4.setColor(i7);
                paint5.setColor(i8);
                typedArrayObtainStyledAttributes.recycle();
            } catch (Throwable th) {
                typedArrayObtainStyledAttributes.recycle();
                throw th;
            }
        } else {
            this.f706 = iM412;
            this.f684 = iM4122;
            this.f704 = 0;
            this.f672 = iM4124;
            this.f712 = iM4125;
            this.f685 = iM4126;
            paint.setColor(-1);
            paint6.setColor(-1);
            paint2.setColor(-855638017);
            paint3.setColor(-10066330);
            paint4.setColor(-1291845888);
            paint5.setColor(872414976);
            this.f697 = null;
        }
        StringBuilder sb = new StringBuilder();
        this.f677 = sb;
        this.f671 = new Formatter(sb, Locale.getDefault());
        this.f674 = new RunnableC3566(19, this);
        Drawable drawable2 = this.f697;
        if (drawable2 != null) {
            r8 = 1;
            this.f689 = (drawable2.getMinimumWidth() + 1) / 2;
        } else {
            r8 = 1;
            this.f689 = (Math.max(this.f712, Math.max(this.f672, this.f685)) + 1) / 2;
        }
        this.f705 = 1.0f;
        ValueAnimator valueAnimator = new ValueAnimator();
        this.f676 = valueAnimator;
        valueAnimator.addUpdateListener(new C5572(this, r8));
        this.f673 = -9223372036854775807L;
        this.f681 = -9223372036854775807L;
        this.f700 = -9223372036854775807L;
        this.f675 = 20;
        setFocusable((boolean) r8);
        if (getImportantForAccessibility() == 0) {
            setImportantForAccessibility(r8);
        }
    }

    private String getProgressText() {
        return AbstractC3558.m8124(this.f677, this.f671, this.f711);
    }

    private long getScrubberPosition() {
        if (this.f692.width() <= 0 || this.f673 == -9223372036854775807L) {
            return 0L;
        }
        return ((long) (this.f709.width() * this.f673)) / r0.width();
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static int m412(int i, float f) {
        return (int) ((i * f) + 0.5f);
    }

    @Override // android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        Drawable drawable = this.f697;
        if (drawable != null && drawable.isStateful() && drawable.setState(getDrawableState())) {
            invalidate();
        }
    }

    @Override // defpackage.InterfaceC4300
    public long getPreferredUpdateDelay() {
        int iWidth = (int) (this.f692.width() / this.f690);
        if (iWidth == 0) {
            return Long.MAX_VALUE;
        }
        long j = this.f673;
        if (j == 0 || j == -9223372036854775807L) {
            return Long.MAX_VALUE;
        }
        return j / iWidth;
    }

    @Override // android.view.View
    public final void jumpDrawablesToCurrentState() {
        super.jumpDrawablesToCurrentState();
        Drawable drawable = this.f697;
        if (drawable != null) {
            drawable.jumpToCurrentState();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:17:0x0099  */
    /* JADX WARN: Removed duplicated region for block: B:18:0x00ab  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void onDraw(android.graphics.Canvas r20) {
        /*
            Method dump skipped, instructions count: 282
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.media3.ui.DefaultTimeBar.onDraw(android.graphics.Canvas):void");
    }

    @Override // android.view.View
    public final void onFocusChanged(boolean z, int i, Rect rect) {
        super.onFocusChanged(z, i, rect);
        ValueAnimator duration = ValueAnimator.ofFloat(0.0f, 1.0f).setDuration(150L);
        duration.addUpdateListener(new C5572(this, 0));
        duration.start();
        if (z) {
            return;
        }
        m414(false);
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        super.onInitializeAccessibilityEvent(accessibilityEvent);
        if (accessibilityEvent.getEventType() == 4) {
            accessibilityEvent.getText().add(getProgressText());
        }
        accessibilityEvent.setClassName("android.widget.SeekBar");
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName("android.widget.SeekBar");
        accessibilityNodeInfo.setContentDescription(getProgressText());
        if (this.f673 <= 0) {
            return;
        }
        accessibilityNodeInfo.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
        accessibilityNodeInfo.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
    }

    /* JADX WARN: Code restructure failed: missing block: B:14:0x0022, code lost:
    
        if (m416(-m418(true)) == false) goto L28;
     */
    /* JADX WARN: Code restructure failed: missing block: B:22:0x0036, code lost:
    
        if (m416(m418(false)) == false) goto L28;
     */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x0038, code lost:
    
        return true;
     */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0039  */
    @Override // android.view.View, android.view.KeyEvent.Callback
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean onKeyDown(int r4, android.view.KeyEvent r5) {
        /*
            r3 = this;
            boolean r0 = r3.isEnabled()
            if (r0 == 0) goto L41
            r0 = 66
            r1 = 0
            r2 = 1
            if (r4 == r0) goto L39
            switch(r4) {
                case 19: goto L25;
                case 20: goto L10;
                case 21: goto L10;
                case 22: goto L25;
                case 23: goto L39;
                default: goto Lf;
            }
        Lf:
            goto L41
        L10:
            r0 = 20
            if (r4 != r0) goto L19
            boolean r0 = r3.f668
            if (r0 != 0) goto L19
            goto L41
        L19:
            long r0 = r3.m418(r2)
            long r0 = -r0
            boolean r0 = r3.m416(r0)
            if (r0 == 0) goto L41
            goto L38
        L25:
            r0 = 19
            if (r4 != r0) goto L2e
            boolean r0 = r3.f707
            if (r0 != 0) goto L2e
            goto L41
        L2e:
            long r0 = r3.m418(r1)
            boolean r0 = r3.m416(r0)
            if (r0 == 0) goto L41
        L38:
            return r2
        L39:
            boolean r0 = r3.f687
            if (r0 == 0) goto L41
            r3.m414(r1)
            return r2
        L41:
            boolean r3 = super.onKeyDown(r4, r5)
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.media3.ui.DefaultTimeBar.onKeyDown(int, android.view.KeyEvent):boolean");
    }

    @Override // android.view.View, android.view.KeyEvent.Callback
    public final boolean onKeyUp(int i, KeyEvent keyEvent) {
        if (!isEnabled() || !this.f687 || (i != 21 && i != 22 && ((i != 20 || !this.f668) && (i != 19 || !this.f707)))) {
            return super.onKeyUp(i, keyEvent);
        }
        m419();
        return true;
    }

    @Override // android.view.View
    public final void onLayout(boolean z, int i, int i2, int i3, int i4) {
        int paddingBottom;
        int iMax;
        Rect rect;
        int i5 = i3 - i;
        int i6 = i4 - i2;
        int paddingLeft = getPaddingLeft();
        int paddingRight = i5 - getPaddingRight();
        int i7 = this.f679 ? 0 : this.f689;
        int i8 = this.f704;
        int i9 = this.f684;
        if (i8 == 1) {
            paddingBottom = (i6 - getPaddingBottom()) - i9;
            int paddingBottom2 = i6 - getPaddingBottom();
            int i10 = this.f706;
            iMax = (paddingBottom2 - i10) - Math.max(i7 - (i10 / 2), 0);
        } else {
            paddingBottom = (i6 - i9) / 2;
            iMax = (i6 - this.f706) / 2;
        }
        Rect rect2 = this.f698;
        rect2.set(paddingLeft, paddingBottom, paddingRight, i9 + paddingBottom);
        this.f692.set(rect2.left + i7, iMax, rect2.right - i7, this.f706 + iMax);
        if (Build.VERSION.SDK_INT >= 29 && ((rect = this.f669) == null || rect.width() != i5 || this.f669.height() != i6)) {
            Rect rect3 = new Rect(0, 0, i5, i6);
            this.f669 = rect3;
            setSystemGestureExclusionRects(Collections.singletonList(rect3));
        }
        m417();
    }

    @Override // android.view.View
    public final void onMeasure(int i, int i2) {
        int mode = View.MeasureSpec.getMode(i2);
        int size = View.MeasureSpec.getSize(i2);
        int i3 = this.f684;
        if (mode == 0) {
            size = i3;
        } else if (mode != 1073741824) {
            size = Math.min(i3, size);
        }
        setMeasuredDimension(View.MeasureSpec.getSize(i), size);
        Drawable drawable = this.f697;
        if (drawable != null && drawable.isStateful() && drawable.setState(getDrawableState())) {
            invalidate();
        }
    }

    @Override // android.view.View
    public final void onRtlPropertiesChanged(int i) {
        Drawable drawable = this.f697;
        if (drawable == null || !drawable.setLayoutDirection(i)) {
            return;
        }
        invalidate();
    }

    /* JADX WARN: Removed duplicated region for block: B:27:0x008a  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean onTouchEvent(android.view.MotionEvent r15) {
        /*
            r14 = this;
            boolean r0 = r14.isEnabled()
            r1 = 0
            if (r0 == 0) goto Lbf
            long r2 = r14.f673
            r4 = 0
            int r0 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1))
            if (r0 > 0) goto L11
            goto Lbf
        L11:
            float r0 = r15.getX()
            int r0 = (int) r0
            float r2 = r15.getY()
            int r2 = (int) r2
            android.graphics.Point r3 = r14.f703
            r3.set(r0, r2)
            int r0 = r3.x
            int r2 = r3.y
            int r3 = r15.getAction()
            android.graphics.Rect r4 = r14.f692
            android.graphics.RectF r5 = r14.f709
            r6 = 1
            if (r3 == 0) goto L99
            r7 = 3
            if (r3 == r6) goto L8a
            r8 = 2
            if (r3 == r8) goto L39
            if (r3 == r7) goto L8a
            goto Lbf
        L39:
            boolean r15 = r14.f687
            if (r15 == 0) goto Lbf
            int r15 = r14.f682
            if (r2 >= r15) goto L54
            int r15 = r14.f708
            int r0 = r0 - r15
            int r0 = r0 / r7
            int r0 = r0 + r15
            float r15 = (float) r0
            int r0 = r4.left
            float r0 = (float) r0
            int r1 = r4.right
            float r1 = (float) r1
            float r15 = defpackage.AbstractC3558.m8127(r15, r0, r1)
            r5.right = r15
            goto L63
        L54:
            r14.f708 = r0
            float r15 = (float) r0
            int r0 = r4.left
            float r0 = (float) r0
            int r1 = r4.right
            float r1 = (float) r1
            float r15 = defpackage.AbstractC3558.m8127(r15, r0, r1)
            r5.right = r15
        L63:
            long r8 = r14.getScrubberPosition()
            r14.f695 = r8
            java.util.concurrent.CopyOnWriteArraySet r15 = r14.f678
            java.util.Iterator r15 = r15.iterator()
        L6f:
            boolean r0 = r15.hasNext()
            if (r0 == 0) goto L83
            java.lang.Object r0 = r15.next()
            r7 = r0
            ᵹᵪ r7 = (defpackage.InterfaceC5070) r7
            r12 = 0
            r10 = r8
            r7.mo3841(r8, r10, r12)
            goto L6f
        L83:
            r14.m417()
            r14.invalidate()
            return r6
        L8a:
            boolean r0 = r14.f687
            if (r0 == 0) goto Lbf
            int r15 = r15.getAction()
            if (r15 != r7) goto L95
            r1 = r6
        L95:
            r14.m414(r1)
            return r6
        L99:
            float r15 = (float) r0
            float r0 = (float) r2
            int r2 = (int) r15
            int r0 = (int) r0
            android.graphics.Rect r3 = r14.f698
            boolean r0 = r3.contains(r2, r0)
            if (r0 == 0) goto Lbf
            int r0 = r4.left
            float r0 = (float) r0
            int r1 = r4.right
            float r1 = (float) r1
            float r15 = defpackage.AbstractC3558.m8127(r15, r0, r1)
            r5.right = r15
            long r0 = r14.getScrubberPosition()
            r14.m415(r0)
            r14.m417()
            r14.invalidate()
            return r6
        Lbf:
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.media3.ui.DefaultTimeBar.onTouchEvent(android.view.MotionEvent):boolean");
    }

    @Override // android.view.View
    public final boolean performAccessibilityAction(int i, Bundle bundle) {
        if (super.performAccessibilityAction(i, bundle)) {
            return true;
        }
        if (this.f673 <= 0) {
            return false;
        }
        if (i == 8192) {
            if (m420(-m418(true))) {
                m414(false);
            }
        } else {
            if (i != 4096) {
                return false;
            }
            if (m420(m418(false))) {
                m414(false);
            }
        }
        sendAccessibilityEvent(4);
        return true;
    }

    public void setAdMarkerColor(int i) {
        this.f683.setColor(i);
        invalidate(this.f698);
    }

    public void setBufferedColor(int i) {
        this.f670.setColor(i);
        invalidate(this.f698);
    }

    @Override // defpackage.InterfaceC4300
    public void setBufferedPosition(long j) {
        if (this.f696 == j) {
            return;
        }
        this.f696 = j;
        m417();
    }

    @Override // defpackage.InterfaceC4300
    public void setDuration(long j) {
        if (this.f673 == j) {
            return;
        }
        this.f673 = j;
        if (j == -9223372036854775807L) {
            m414(true);
        }
        if (this.f687) {
            return;
        }
        m417();
    }

    @Override // android.view.View, defpackage.InterfaceC4300
    public void setEnabled(boolean z) {
        super.setEnabled(z);
        if (z) {
            return;
        }
        m414(true);
    }

    public void setKeyCountIncrement(int i) {
        ᵛᵾˏ.ᵯٴᵦ(i > 0);
        this.f675 = i;
        this.f681 = -9223372036854775807L;
        this.f700 = -9223372036854775807L;
    }

    public void setPlayedAdMarkerColor(int i) {
        this.f680.setColor(i);
        invalidate(this.f698);
    }

    public void setPlayedColor(int i) {
        this.f691.setColor(i);
        invalidate(this.f698);
    }

    public void setScrubPosition(long j) {
        if (this.f687) {
            this.f695 = j;
            m417();
        }
    }

    public void setScrubberColor(int i) {
        this.f699 = i;
        if (isEnabled()) {
            this.f701.setColor(i);
            invalidate(this.f698);
        }
    }

    public void setScrubbingWithDownEnabled(boolean z) {
        this.f668 = z;
    }

    public void setScrubbingWithUpEnabled(boolean z) {
        this.f707 = z;
    }

    public void setUnplayedColor(int i) {
        this.f688.setColor(i);
        invalidate(this.f698);
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final void m413(long j, long j2) {
        if (this.f711 == j && this.f693 == j2) {
            return;
        }
        this.f711 = j;
        this.f693 = j2;
        setContentDescription(getProgressText());
        m417();
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final void m414(boolean z) {
        if (this.f687) {
            this.f687 = false;
            removeCallbacks(this.f674);
            setPressed(false);
            ViewParent parent = getParent();
            if (parent != null) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
            invalidate();
            Iterator it = this.f678.iterator();
            while (it.hasNext()) {
                ((InterfaceC5070) it.next()).mo3839(z, this.f695);
            }
        }
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final void m415(long j) {
        if (this.f687) {
            return;
        }
        this.f687 = true;
        setPressed(true);
        ViewParent parent = getParent();
        if (parent != null) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
        Iterator it = this.f678.iterator();
        while (it.hasNext()) {
            ((InterfaceC5070) it.next()).mo3840(j);
        }
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final boolean m416(long j) {
        if (!m420(j)) {
            return false;
        }
        RunnableC3566 runnableC3566 = this.f674;
        removeCallbacks(runnableC3566);
        postDelayed(runnableC3566, 550L);
        return true;
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final void m417() {
        Rect rect = this.f710;
        Rect rect2 = this.f692;
        rect.set(rect2);
        RectF rectF = this.f709;
        rectF.set(rect2);
        RectF rectF2 = this.f694;
        rectF2.set(rect2);
        if (this.f673 > 0) {
            rect.right = Math.min(rect2.left + ((int) ((rect2.width() * this.f696) / this.f673)), rect2.right);
            rectF.right = Math.min(rect2.left + (((this.f687 ? this.f695 : this.f711) / this.f673) * rect2.width()), rect2.right);
            rectF2.right = Math.min(rect2.left + ((this.f693 / this.f673) * rect2.width()), rect2.right);
        } else {
            int i = rect2.left;
            rect.right = i;
            float f = i;
            rectF.right = f;
            rectF2.right = f;
        }
        invalidate(this.f698);
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final long m418(boolean z) {
        long j = z ? this.f681 : this.f700;
        if (j != -9223372036854775807L) {
            return j;
        }
        long j2 = this.f673;
        if (j2 == -9223372036854775807L) {
            return 0L;
        }
        return j2 / this.f675;
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final void m419() {
        long jCurrentTimeMillis = System.currentTimeMillis();
        if (this.f686 > jCurrentTimeMillis) {
            this.f686 = 0L;
        }
        if (jCurrentTimeMillis - this.f686 > 550) {
            m414(false);
        }
        this.f686 = jCurrentTimeMillis;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final boolean m420(long j) {
        long jMin = this.f673;
        if (jMin <= 0) {
            return false;
        }
        long j2 = this.f687 ? this.f695 : this.f711;
        long j3 = j2 + j;
        long j4 = this.f693;
        if (j4 > 0) {
            jMin = Math.min(j4, jMin);
        }
        long jM8153 = AbstractC3558.m8153(j3, 0L, jMin);
        if (jM8153 == j2 && j3 >= 0) {
            return false;
        }
        m415(jM8153);
        this.f695 = jM8153;
        Iterator it = this.f678.iterator();
        while (it.hasNext()) {
            long j5 = j3;
            ((InterfaceC5070) it.next()).mo3841(j5, jM8153, j);
            j3 = j5;
        }
        m417();
        return true;
    }
}
