package defpackage;

import android.content.Context;
import android.graphics.PointF;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LinearInterpolator;
import androidx.recyclerview.widget.RecyclerView;

/* renamed from: ᵩᵷˆ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public class C3839 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public boolean f14276;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public boolean f14277;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final C0872 f14278;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public View f14279;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public AbstractC1935 f14280;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final DecelerateInterpolator f14281;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public int f14282 = -1;

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public int f14283;

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public float f14284;

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public int f14285;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public RecyclerView f14286;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public PointF f14287;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final DisplayMetrics f14288;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final LinearInterpolator f14289;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public boolean f14290;

    public C3839(Context context) {
        C0872 c0872 = new C0872();
        c0872.f3972 = -1;
        c0872.f3967 = false;
        c0872.f3970 = 0;
        c0872.f3971 = 0;
        c0872.f3969 = Integer.MIN_VALUE;
        c0872.f3968 = null;
        this.f14278 = c0872;
        this.f14289 = new LinearInterpolator();
        this.f14281 = new DecelerateInterpolator();
        this.f14277 = false;
        this.f14283 = 0;
        this.f14285 = 0;
        this.f14288 = context.getResources().getDisplayMetrics();
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static int m8482(int i, int i2, int i3, int i4, int i5) {
        if (i5 == -1) {
            return i3 - i;
        }
        if (i5 != 0) {
            if (i5 == 1) {
                return i4 - i2;
            }
            ᵹˉᵞ.ˌᵜᵹᵩ("snap preference should be one of the constants defined in SmoothScroller, starting with SNAP_");
            return 0;
        }
        int i6 = i3 - i;
        if (i6 > 0) {
            return i6;
        }
        int i7 = i4 - i2;
        if (i7 < 0) {
            return i7;
        }
        return 0;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public int mo8483(int i) {
        float fAbs = Math.abs(i);
        if (!this.f14277) {
            this.f14284 = mo8488(this.f14288);
            this.f14277 = true;
        }
        return (int) Math.ceil(fAbs * this.f14284);
    }

    /* JADX WARN: Removed duplicated region for block: B:50:0x00f1  */
    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m8484(int r9, int r10) {
        /*
            Method dump skipped, instructions count: 270
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3839.m8484(int, int):void");
    }

    /* renamed from: ˏˋٴ */
    public PointF mo1871(int i) {
        Object obj = this.f14280;
        if (obj instanceof InterfaceC0593) {
            return ((InterfaceC0593) obj).mo522(i);
        }
        return null;
    }

    /* renamed from: ˏᵙ */
    public int mo4923(View view, int i) {
        AbstractC1935 abstractC1935 = this.f14280;
        if (abstractC1935 == null || !abstractC1935.mo282()) {
            return 0;
        }
        C1923 c1923 = (C1923) view.getLayoutParams();
        return m8482(abstractC1935.mo307(view) - ((ViewGroup.MarginLayoutParams) c1923).topMargin, abstractC1935.mo299(view) + ((ViewGroup.MarginLayoutParams) c1923).bottomMargin, abstractC1935.m5447(), abstractC1935.f7784 - abstractC1935.m5428(), i);
    }

    /* JADX WARN: Removed duplicated region for block: B:10:0x0015  */
    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void mo8485(android.view.View r7, defpackage.C0872 r8) {
        /*
            r6 = this;
            android.graphics.PointF r0 = r6.f14287
            r1 = 0
            r2 = -1
            r3 = 1
            r4 = 0
            if (r0 == 0) goto L15
            float r0 = r0.x
            int r0 = (r0 > r4 ? 1 : (r0 == r4 ? 0 : -1))
            if (r0 != 0) goto Lf
            goto L15
        Lf:
            if (r0 <= 0) goto L13
            r0 = r3
            goto L16
        L13:
            r0 = r2
            goto L16
        L15:
            r0 = r1
        L16:
            int r0 = r6.mo4924(r7, r0)
            android.graphics.PointF r5 = r6.f14287
            if (r5 == 0) goto L2a
            float r5 = r5.y
            int r4 = (r5 > r4 ? 1 : (r5 == r4 ? 0 : -1))
            if (r4 != 0) goto L25
            goto L2a
        L25:
            if (r4 <= 0) goto L29
            r1 = r3
            goto L2a
        L29:
            r1 = r2
        L2a:
            int r7 = r6.mo4923(r7, r1)
            int r1 = r0 * r0
            int r2 = r7 * r7
            int r2 = r2 + r1
            double r1 = (double) r2
            double r1 = java.lang.Math.sqrt(r1)
            int r1 = (int) r1
            int r1 = r6.mo8483(r1)
            double r1 = (double) r1
            r4 = 4599717252057688074(0x3fd57a786c22680a, double:0.3356)
            double r1 = r1 / r4
            double r1 = java.lang.Math.ceil(r1)
            int r1 = (int) r1
            if (r1 <= 0) goto L59
            int r0 = -r0
            int r7 = -r7
            r8.f3970 = r0
            r8.f3971 = r7
            r8.f3969 = r1
            android.view.animation.DecelerateInterpolator r6 = r6.f14281
            r8.f3968 = r6
            r8.f3967 = r3
        L59:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3839.mo8485(android.view.View, ˆᵩᵡ):void");
    }

    /* renamed from: ᵴᵳ */
    public int mo4924(View view, int i) {
        AbstractC1935 abstractC1935 = this.f14280;
        if (abstractC1935 == null || !abstractC1935.mo271()) {
            return 0;
        }
        C1923 c1923 = (C1923) view.getLayoutParams();
        return m8482(abstractC1935.mo298(view) - ((ViewGroup.MarginLayoutParams) c1923).leftMargin, abstractC1935.mo315(view) + ((ViewGroup.MarginLayoutParams) c1923).rightMargin, abstractC1935.m5441(), abstractC1935.f7782 - abstractC1935.m5422(), i);
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final void m8486() {
        if (this.f14276) {
            this.f14276 = false;
            mo8487();
            this.f14286.f901.f6125 = -1;
            this.f14279 = null;
            this.f14282 = -1;
            this.f14290 = false;
            AbstractC1935 abstractC1935 = this.f14280;
            if (abstractC1935.f7775 == this) {
                abstractC1935.f7775 = null;
            }
            this.f14280 = null;
            this.f14286 = null;
        }
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public void mo8487() {
        this.f14285 = 0;
        this.f14283 = 0;
        this.f14287 = null;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public float mo8488(DisplayMetrics displayMetrics) {
        return 25.0f / displayMetrics.densityDpi;
    }
}
