package defpackage;

import android.content.res.Resources;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AnimationUtils;

/* renamed from: ᵨᵵ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class ViewOnTouchListenerC3763 implements View.OnTouchListener {

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public static final int f14017 = ViewConfiguration.getTapTimeout();

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

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public boolean f14019;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final float[] f14020;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final float[] f14021;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public boolean f14022;

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

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final float[] f14024;

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

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final float[] f14026;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public boolean f14027;

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

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final float[] f14029;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public boolean f14030;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public boolean f14031;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public RunnableC2802 f14032;

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

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

    public ViewOnTouchListenerC3763(C1073 c1073) {
        C2135 c2135 = new C2135();
        c2135.f8412 = Long.MIN_VALUE;
        c2135.f8413 = -1L;
        c2135.f8414 = 0L;
        this.f14028 = c2135;
        this.f14025 = new AccelerateInterpolator();
        float[] fArr = {0.0f, 0.0f};
        this.f14026 = fArr;
        float[] fArr2 = {Float.MAX_VALUE, Float.MAX_VALUE};
        this.f14024 = fArr2;
        float[] fArr3 = {0.0f, 0.0f};
        this.f14021 = fArr3;
        float[] fArr4 = {0.0f, 0.0f};
        this.f14020 = fArr4;
        float[] fArr5 = {Float.MAX_VALUE, Float.MAX_VALUE};
        this.f14029 = fArr5;
        this.f14033 = c1073;
        float f = Resources.getSystem().getDisplayMetrics().density;
        float f2 = ((int) ((1575.0f * f) + 0.5f)) / 1000.0f;
        fArr5[0] = f2;
        fArr5[1] = f2;
        float f3 = ((int) ((f * 315.0f) + 0.5f)) / 1000.0f;
        fArr4[0] = f3;
        fArr4[1] = f3;
        this.f14018 = 1;
        fArr2[0] = Float.MAX_VALUE;
        fArr2[1] = Float.MAX_VALUE;
        fArr[0] = 0.2f;
        fArr[1] = 0.2f;
        fArr3[0] = 0.001f;
        fArr3[1] = 0.001f;
        this.f14023 = f14017;
        c2135.f8417 = 500;
        c2135.f8418 = 500;
        this.f14034 = c1073;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static float m8387(float f, float f2, float f3) {
        return f > f3 ? f3 : f < f2 ? f2 : f;
    }

    /* JADX WARN: Code restructure failed: missing block: B:11:0x0014, code lost:
    
        if (r0 != 3) goto L30;
     */
    @Override // android.view.View.OnTouchListener
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean onTouch(android.view.View r8, android.view.MotionEvent r9) {
        /*
            r7 = this;
            boolean r0 = r7.f14019
            r1 = 0
            if (r0 != 0) goto L7
            goto L7c
        L7:
            int r0 = r9.getActionMasked()
            r2 = 1
            if (r0 == 0) goto L1b
            if (r0 == r2) goto L17
            r3 = 2
            if (r0 == r3) goto L1f
            r8 = 3
            if (r0 == r8) goto L17
            goto L7c
        L17:
            r7.m8391()
            return r1
        L1b:
            r7.f14022 = r2
            r7.f14027 = r1
        L1f:
            float r0 = r9.getX()
            int r3 = r8.getWidth()
            float r3 = (float) r3
            ˈᵜˈ r4 = r7.f14033
            int r5 = r4.getWidth()
            float r5 = (float) r5
            float r0 = r7.m8390(r0, r3, r5, r1)
            float r9 = r9.getY()
            int r8 = r8.getHeight()
            float r8 = (float) r8
            int r3 = r4.getHeight()
            float r3 = (float) r3
            float r8 = r7.m8390(r9, r8, r3, r2)
            יʾ r9 = r7.f14028
            r9.f8415 = r0
            r9.f8420 = r8
            boolean r8 = r7.f14030
            if (r8 != 0) goto L7c
            boolean r8 = r7.m8388()
            if (r8 == 0) goto L7c
            ᵜˀᐧʨ r8 = r7.f14032
            if (r8 != 0) goto L60
            ᵜˀᐧʨ r8 = new ᵜˀᐧʨ
            r8.<init>(r2, r7)
            r7.f14032 = r8
        L60:
            r7.f14030 = r2
            r7.f14031 = r2
            boolean r8 = r7.f14027
            if (r8 != 0) goto L75
            int r8 = r7.f14023
            if (r8 <= 0) goto L75
            ᵜˀᐧʨ r9 = r7.f14032
            long r5 = (long) r8
            java.util.WeakHashMap r8 = defpackage.AbstractC2873.f11133
            r4.postOnAnimationDelayed(r9, r5)
            goto L7a
        L75:
            ᵜˀᐧʨ r8 = r7.f14032
            r8.run()
        L7a:
            r7.f14027 = r2
        L7c:
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.ViewOnTouchListenerC3763.onTouch(android.view.View, android.view.MotionEvent):boolean");
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final boolean m8388() {
        C1073 c1073;
        int count;
        C2135 c2135 = this.f14028;
        float f = c2135.f8420;
        int iAbs = (int) (f / Math.abs(f));
        Math.abs(c2135.f8415);
        if (iAbs != 0 && (count = (c1073 = this.f14034).getCount()) != 0) {
            int childCount = c1073.getChildCount();
            int firstVisiblePosition = c1073.getFirstVisiblePosition();
            int i = firstVisiblePosition + childCount;
            if (iAbs <= 0 ? !(iAbs >= 0 || (firstVisiblePosition <= 0 && c1073.getChildAt(0).getTop() >= 0)) : !(i >= count && c1073.getChildAt(childCount - 1).getBottom() <= c1073.getHeight())) {
                return true;
            }
        }
        return false;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final float m8389(float f, float f2) {
        if (f2 != 0.0f) {
            int i = this.f14018;
            if (i == 0 || i == 1) {
                if (f < f2) {
                    if (f >= 0.0f) {
                        return 1.0f - (f / f2);
                    }
                    if (this.f14030 && i == 1) {
                        return 1.0f;
                    }
                }
            } else if (i == 2 && f < 0.0f) {
                return f / (-f2);
            }
        }
        return 0.0f;
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x003b A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:13:0x003c  */
    /* 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 float m8390(float r4, float r5, float r6, int r7) {
        /*
            r3 = this;
            float[] r0 = r3.f14026
            r0 = r0[r7]
            float[] r1 = r3.f14024
            r1 = r1[r7]
            float r0 = r0 * r5
            r2 = 0
            float r0 = m8387(r0, r2, r1)
            float r1 = r3.m8389(r4, r0)
            float r5 = r5 - r4
            float r4 = r3.m8389(r5, r0)
            float r4 = r4 - r1
            int r5 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1))
            android.view.animation.AccelerateInterpolator r0 = r3.f14025
            if (r5 >= 0) goto L25
            float r4 = -r4
            float r4 = r0.getInterpolation(r4)
            float r4 = -r4
            goto L2d
        L25:
            int r5 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1))
            if (r5 <= 0) goto L36
            float r4 = r0.getInterpolation(r4)
        L2d:
            r5 = -1082130432(0xffffffffbf800000, float:-1.0)
            r0 = 1065353216(0x3f800000, float:1.0)
            float r4 = m8387(r4, r5, r0)
            goto L37
        L36:
            r4 = r2
        L37:
            int r5 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1))
            if (r5 != 0) goto L3c
            return r2
        L3c:
            float[] r0 = r3.f14021
            r0 = r0[r7]
            float[] r1 = r3.f14020
            r1 = r1[r7]
            float[] r3 = r3.f14029
            r3 = r3[r7]
            float r0 = r0 * r6
            if (r5 <= 0) goto L51
            float r4 = r4 * r0
            float r3 = m8387(r4, r1, r3)
            return r3
        L51:
            float r4 = -r4
            float r4 = r4 * r0
            float r3 = m8387(r4, r1, r3)
            float r3 = -r3
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.ViewOnTouchListenerC3763.m8390(float, float, float, int):float");
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m8391() {
        int i = 0;
        if (this.f14031) {
            this.f14030 = false;
            return;
        }
        long jCurrentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
        C2135 c2135 = this.f14028;
        int i2 = (int) (jCurrentAnimationTimeMillis - c2135.f8412);
        int i3 = c2135.f8418;
        if (i2 > i3) {
            i = i3;
        } else if (i2 >= 0) {
            i = i2;
        }
        c2135.f8416 = i;
        c2135.f8419 = c2135.m5740(jCurrentAnimationTimeMillis);
        c2135.f8413 = jCurrentAnimationTimeMillis;
    }
}
