package ῲ.ᕣ.K;

import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import android.widget.OverScroller;
import java.util.Arrays;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.ᨨ.C1729;

/* renamed from: ῲ.ᕣ.K.ඓ  reason: contains not printable characters */
/* compiled from: ViewDragHelper */
public class C1698 {

    /* renamed from: ᓆ  reason: contains not printable characters */
    public static final Interpolator f5970 = new animation.InterpolatorC1701();

    /* renamed from: ʬ  reason: contains not printable characters */
    public int f5971 = -1;

    /* renamed from: Ԕ  reason: contains not printable characters */
    public float f5972;

    /* renamed from: Ԛ  reason: contains not printable characters */
    public final ViewGroup f5973;

    /* renamed from: ؿ  reason: contains not printable characters */
    public int f5974;

    /* renamed from: ݜ  reason: contains not printable characters */
    public View f5975;

    /* renamed from: ඓ  reason: contains not printable characters */
    public float[] f5976;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public OverScroller f5977;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public int f5978;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public int[] f5979;

    /* renamed from: ῲ  reason: contains not printable characters */
    public int f5980;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public float[] f5981;

    /* renamed from: K  reason: contains not printable characters */
    public int f5982;

    /* renamed from: 㑃  reason: contains not printable characters */
    public VelocityTracker f5983;

    /* renamed from: 㗗  reason: contains not printable characters */
    public int f5984;

    /* renamed from: 㗽  reason: contains not printable characters */
    public final AbstractC1699 f5985;

    /* renamed from: 㳳  reason: contains not printable characters */
    public int[] f5986;

    /* renamed from: 㴹  reason: contains not printable characters */
    public float[] f5987;

    /* renamed from: 㶋  reason: contains not printable characters */
    public final Runnable f5988 = new RunnableC1700();

    /* renamed from: 㸾  reason: contains not printable characters */
    public float[] f5989;

    /* renamed from: 㿎  reason: contains not printable characters */
    public int[] f5990;

    /* renamed from: 䀟  reason: contains not printable characters */
    public boolean f5991;

    /* renamed from: 䁗  reason: contains not printable characters */
    public float f5992;

    /* renamed from: ῲ.ᕣ.K.ඓ$ʬ  reason: contains not printable characters */
    /* compiled from: ViewDragHelper */
    public static abstract class AbstractC1699 {
        public abstract int clampViewPositionHorizontal(View view, int i, int i2);

        public abstract int clampViewPositionVertical(View view, int i, int i2);

        public int getOrderedChildIndex(int i) {
            return i;
        }

        public int getViewHorizontalDragRange(View view) {
            return 0;
        }

        public int getViewVerticalDragRange(View view) {
            return 0;
        }

        public void onEdgeDragStarted(int i, int i2) {
        }

        public boolean onEdgeLock(int i) {
            return false;
        }

        public void onEdgeTouched(int i, int i2) {
        }

        public void onViewCaptured(View view, int i) {
        }

        public abstract void onViewDragStateChanged(int i);

        public abstract void onViewPositionChanged(View view, int i, int i2, int i3, int i4);

        public abstract void onViewReleased(View view, float f, float f2);

        public abstract boolean tryCaptureView(View view, int i);
    }

    /* renamed from: ῲ.ᕣ.K.ඓ$ῲ  reason: contains not printable characters */
    /* compiled from: ViewDragHelper */
    public class RunnableC1700 implements Runnable {
        public RunnableC1700() {
        }

        public void run() {
            C1698.this.m4371(0);
        }
    }

    /* renamed from: ῲ.ᕣ.K.ඓ$K  reason: contains not printable characters */
    /* compiled from: ViewDragHelper */
    public static class animation.InterpolatorC1701 implements Interpolator {
        public float getInterpolation(float f) {
            float f2 = f - 1.0f;
            return (f2 * f2 * f2 * f2 * f2) + 1.0f;
        }
    }

    public C1698(Context context, ViewGroup viewGroup, AbstractC1699 r4) {
        if (viewGroup == null) {
            throw new IllegalArgumentException("Parent view may not be null");
        } else if (r4 != null) {
            this.f5973 = viewGroup;
            this.f5985 = r4;
            ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
            this.f5984 = (int) ((context.getResources().getDisplayMetrics().density * 20.0f) + 0.5f);
            this.f5980 = viewConfiguration.getScaledTouchSlop();
            this.f5992 = (float) viewConfiguration.getScaledMaximumFlingVelocity();
            this.f5972 = (float) viewConfiguration.getScaledMinimumFlingVelocity();
            this.f5977 = new OverScroller(context, f5970);
        } else {
            throw new IllegalArgumentException("Callback may not be null");
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C1698 m4345(ViewGroup viewGroup, float f, AbstractC1699 r4) {
        C1698 r0 = new C1698(viewGroup.getContext(), viewGroup, r4);
        r0.f5980 = (int) ((1.0f / f) * ((float) r0.f5980));
        return r0;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:45:0x00dd, code lost:
        if (r12 != r11) goto L_0x00e6;
     */
    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean m4348(MotionEvent motionEvent) {
        boolean z;
        View r1;
        int actionMasked = motionEvent.getActionMasked();
        int actionIndex = motionEvent.getActionIndex();
        if (actionMasked == 0) {
            m4350();
        }
        if (this.f5983 == null) {
            this.f5983 = VelocityTracker.obtain();
        }
        this.f5983.addMovement(motionEvent);
        if (actionMasked != 0) {
            if (actionMasked != 1) {
                if (actionMasked != 2) {
                    if (actionMasked != 3) {
                        if (actionMasked == 5) {
                            int pointerId = motionEvent.getPointerId(actionIndex);
                            float x = motionEvent.getX(actionIndex);
                            float y = motionEvent.getY(actionIndex);
                            m4351(x, y, pointerId);
                            int i = this.f5982;
                            if (i == 0) {
                                int i2 = this.f5990[pointerId];
                                int i3 = this.f5974;
                                if ((i2 & i3) != 0) {
                                    this.f5985.onEdgeTouched(i2 & i3, pointerId);
                                }
                            } else if (i == 2 && (r1 = m4359((int) x, (int) y)) == this.f5975) {
                                m4355(r1, pointerId);
                            }
                        } else if (actionMasked == 6) {
                            m4363(motionEvent.getPointerId(actionIndex));
                        }
                    }
                } else if (!(this.f5989 == null || this.f5976 == null)) {
                    int pointerCount = motionEvent.getPointerCount();
                    for (int i4 = 0; i4 < pointerCount; i4++) {
                        int pointerId2 = motionEvent.getPointerId(i4);
                        if (m4347(pointerId2)) {
                            float x2 = motionEvent.getX(i4);
                            float y2 = motionEvent.getY(i4);
                            float f = x2 - this.f5989[pointerId2];
                            float f2 = y2 - this.f5976[pointerId2];
                            View r7 = m4359((int) x2, (int) y2);
                            boolean z2 = r7 != null && m4368(r7, f, f2);
                            if (z2) {
                                int left = r7.getLeft();
                                int i5 = (int) f;
                                int clampViewPositionHorizontal = this.f5985.clampViewPositionHorizontal(r7, left + i5, i5);
                                int top2 = r7.getTop();
                                int i6 = (int) f2;
                                int clampViewPositionVertical = this.f5985.clampViewPositionVertical(r7, top2 + i6, i6);
                                int viewHorizontalDragRange = this.f5985.getViewHorizontalDragRange(r7);
                                int viewVerticalDragRange = this.f5985.getViewVerticalDragRange(r7);
                                if (viewHorizontalDragRange != 0) {
                                    if (viewHorizontalDragRange > 0) {
                                    }
                                }
                                if (viewVerticalDragRange != 0) {
                                    if (viewVerticalDragRange > 0 && clampViewPositionVertical == top2) {
                                        break;
                                    }
                                } else {
                                    break;
                                }
                            }
                            m4362(f, f2, pointerId2);
                            if (this.f5982 != 1) {
                                if (z2 && m4355(r7, pointerId2)) {
                                    break;
                                }
                            } else {
                                break;
                            }
                        }
                    }
                    m4352(motionEvent);
                }
                z = false;
            }
            m4350();
            z = false;
        } else {
            float x3 = motionEvent.getX();
            float y3 = motionEvent.getY();
            z = false;
            int pointerId3 = motionEvent.getPointerId(0);
            m4351(x3, y3, pointerId3);
            View r2 = m4359((int) x3, (int) y3);
            if (r2 == this.f5975 && this.f5982 == 2) {
                m4355(r2, pointerId3);
            }
            int i7 = this.f5990[pointerId3];
            int i8 = this.f5974;
            if ((i7 & i8) != 0) {
                this.f5985.onEdgeTouched(i7 & i8, pointerId3);
            }
        }
        if (this.f5982 == 1) {
            return true;
        }
        return z;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m4350() {
        this.f5971 = -1;
        float[] fArr = this.f5989;
        if (fArr != null) {
            Arrays.fill(fArr, 0.0f);
            Arrays.fill(this.f5976, 0.0f);
            Arrays.fill(this.f5987, 0.0f);
            Arrays.fill(this.f5981, 0.0f);
            Arrays.fill(this.f5990, 0);
            Arrays.fill(this.f5979, 0);
            Arrays.fill(this.f5986, 0);
            this.f5978 = 0;
        }
        VelocityTracker velocityTracker = this.f5983;
        if (velocityTracker != null) {
            velocityTracker.recycle();
            this.f5983 = null;
        }
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public void m4371(int i) {
        this.f5973.removeCallbacks(this.f5988);
        if (this.f5982 != i) {
            this.f5982 = i;
            this.f5985.onViewDragStateChanged(i);
            if (this.f5982 == 0) {
                this.f5975 = null;
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m4365(View view, int i) {
        if (view.getParent() == this.f5973) {
            this.f5975 = view;
            this.f5971 = i;
            this.f5985.onViewCaptured(view, i);
            m4371(1);
            return;
        }
        StringBuilder r4 = C1293.m3416("captureChildView: parameter must be a descendant of the ViewDragHelper's tracked parent view (");
        r4.append(this.f5973);
        r4.append(")");
        throw new IllegalArgumentException(r4.toString());
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m4360() {
        m4350();
        if (this.f5982 == 2) {
            int currX = this.f5977.getCurrX();
            int currY = this.f5977.getCurrY();
            this.f5977.abortAnimation();
            int currX2 = this.f5977.getCurrX();
            int currY2 = this.f5977.getCurrY();
            this.f5985.onViewPositionChanged(this.f5975, currX2, currY2, currX2 - currX, currY2 - currY);
        }
        m4371(0);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m4356(View view, int i, int i2) {
        this.f5975 = view;
        this.f5971 = -1;
        boolean r1 = m4367(i, i2, 0, 0);
        if (!r1 && this.f5982 == 0 && this.f5975 != null) {
            this.f5975 = null;
        }
        return r1;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final boolean m4367(int i, int i2, int i3, int i4) {
        float f;
        float f2;
        float f3;
        float f4;
        int left = this.f5975.getLeft();
        int top2 = this.f5975.getTop();
        int i5 = i - left;
        int i6 = i2 - top2;
        if (i5 == 0 && i6 == 0) {
            this.f5977.abortAnimation();
            m4371(0);
            return false;
        }
        View view = this.f5975;
        int r11 = m4358(i3, (int) this.f5972, (int) this.f5992);
        int r12 = m4358(i4, (int) this.f5972, (int) this.f5992);
        int abs = Math.abs(i5);
        int abs2 = Math.abs(i6);
        int abs3 = Math.abs(r11);
        int abs4 = Math.abs(r12);
        int i7 = abs3 + abs4;
        int i8 = abs + abs2;
        if (r11 != 0) {
            f = (float) abs3;
            f2 = (float) i7;
        } else {
            f = (float) abs;
            f2 = (float) i8;
        }
        float f5 = f / f2;
        if (r12 != 0) {
            f4 = (float) abs4;
            f3 = (float) i7;
        } else {
            f4 = (float) abs2;
            f3 = (float) i8;
        }
        int r112 = m4349(i5, r11, this.f5985.getViewHorizontalDragRange(view));
        float r10 = ((float) m4349(i6, r12, this.f5985.getViewVerticalDragRange(view))) * (f4 / f3);
        this.f5977.startScroll(left, top2, i5, i6, (int) (r10 + (((float) r112) * f5)));
        m4371(2);
        return true;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m4354(int i, int i2) {
        if (this.f5991) {
            return m4367(i, i2, (int) this.f5983.getXVelocity(this.f5971), (int) this.f5983.getYVelocity(this.f5971));
        }
        throw new IllegalStateException("Cannot settleCapturedViewAt outside of a call to Callback#onViewReleased");
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final int m4349(int i, int i2, int i3) {
        int i4;
        if (i == 0) {
            return 0;
        }
        int width = this.f5973.getWidth();
        float f = (float) (width / 2);
        float sin = (((float) Math.sin((double) ((Math.min(1.0f, ((float) Math.abs(i)) / ((float) width)) - 0.5f) * 0.47123894f))) * f) + f;
        int abs = Math.abs(i2);
        if (abs > 0) {
            i4 = Math.round(Math.abs(sin / ((float) abs)) * 1000.0f) * 4;
        } else {
            i4 = (int) (((((float) Math.abs(i)) / ((float) i3)) + 1.0f) * 256.0f);
        }
        return Math.min(i4, 600);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final void m4351(float f, float f2, int i) {
        float[] fArr = this.f5989;
        int i2 = 0;
        if (fArr == null || fArr.length <= i) {
            int i3 = i + 1;
            float[] fArr2 = new float[i3];
            float[] fArr3 = new float[i3];
            float[] fArr4 = new float[i3];
            float[] fArr5 = new float[i3];
            int[] iArr = new int[i3];
            int[] iArr2 = new int[i3];
            int[] iArr3 = new int[i3];
            float[] fArr6 = this.f5989;
            if (fArr6 != null) {
                System.arraycopy(fArr6, 0, fArr2, 0, fArr6.length);
                float[] fArr7 = this.f5976;
                System.arraycopy(fArr7, 0, fArr3, 0, fArr7.length);
                float[] fArr8 = this.f5987;
                System.arraycopy(fArr8, 0, fArr4, 0, fArr8.length);
                float[] fArr9 = this.f5981;
                System.arraycopy(fArr9, 0, fArr5, 0, fArr9.length);
                int[] iArr4 = this.f5990;
                System.arraycopy(iArr4, 0, iArr, 0, iArr4.length);
                int[] iArr5 = this.f5979;
                System.arraycopy(iArr5, 0, iArr2, 0, iArr5.length);
                int[] iArr6 = this.f5986;
                System.arraycopy(iArr6, 0, iArr3, 0, iArr6.length);
            }
            this.f5989 = fArr2;
            this.f5976 = fArr3;
            this.f5987 = fArr4;
            this.f5981 = fArr5;
            this.f5990 = iArr;
            this.f5979 = iArr2;
            this.f5986 = iArr3;
        }
        float[] fArr10 = this.f5989;
        this.f5987[i] = f;
        fArr10[i] = f;
        float[] fArr11 = this.f5976;
        this.f5981[i] = f2;
        fArr11[i] = f2;
        int[] iArr7 = this.f5990;
        int i4 = (int) f;
        int i5 = (int) f2;
        if (i4 < this.f5973.getLeft() + this.f5984) {
            i2 = 1;
        }
        if (i5 < this.f5973.getTop() + this.f5984) {
            i2 |= 4;
        }
        if (i4 > this.f5973.getRight() - this.f5984) {
            i2 |= 2;
        }
        if (i5 > this.f5973.getBottom() - this.f5984) {
            i2 |= 8;
        }
        iArr7[i] = i2;
        this.f5978 |= 1 << i;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final int m4358(int i, int i2, int i3) {
        int abs = Math.abs(i);
        if (abs < i2) {
            return 0;
        }
        if (abs > i3) {
            return i > 0 ? i3 : -i3;
        }
        return i;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final float m4357(float f, float f2, float f3) {
        float abs = Math.abs(f);
        if (abs < f2) {
            return 0.0f;
        }
        if (abs > f3) {
            return f > 0.0f ? f3 : -f3;
        }
        return f;
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4370(boolean z) {
        if (this.f5982 == 2) {
            boolean computeScrollOffset = this.f5977.computeScrollOffset();
            int currX = this.f5977.getCurrX();
            int currY = this.f5977.getCurrY();
            int left = currX - this.f5975.getLeft();
            int top2 = currY - this.f5975.getTop();
            if (left != 0) {
                C1729.m4447(this.f5975, left);
            }
            if (top2 != 0) {
                C1729.m4503(this.f5975, top2);
            }
            if (!(left == 0 && top2 == 0)) {
                this.f5985.onViewPositionChanged(this.f5975, currX, currY, left, top2);
            }
            if (computeScrollOffset && currX == this.f5977.getFinalX() && currY == this.f5977.getFinalY()) {
                this.f5977.abortAnimation();
                computeScrollOffset = false;
            }
            if (!computeScrollOffset) {
                if (z) {
                    this.f5973.post(this.f5988);
                } else {
                    m4371(0);
                }
            }
        }
        if (this.f5982 == 2) {
            return true;
        }
        return false;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m4361(float f, float f2) {
        this.f5991 = true;
        this.f5985.onViewReleased(this.f5975, f, f2);
        this.f5991 = false;
        if (this.f5982 == 1) {
            m4371(0);
        }
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public final void m4346() {
        this.f5983.computeCurrentVelocity(1000, this.f5992);
        m4361(m4357(this.f5983.getXVelocity(this.f5971), this.f5972, this.f5992), m4357(this.f5983.getYVelocity(this.f5971), this.f5972, this.f5992));
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m4363(int i) {
        if (this.f5989 != null && m4353(i)) {
            this.f5989[i] = 0.0f;
            this.f5976[i] = 0.0f;
            this.f5987[i] = 0.0f;
            this.f5981[i] = 0.0f;
            this.f5990[i] = 0;
            this.f5979[i] = 0;
            this.f5986[i] = 0;
            this.f5978 = (~(1 << i)) & this.f5978;
        }
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public final boolean m4347(int i) {
        if (m4353(i)) {
            return true;
        }
        Log.e("ViewDragHelper", "Ignoring pointerId=" + i + " because ACTION_DOWN was not received " + "for this pointer before ACTION_MOVE. It likely happened because " + " ViewDragHelper did not receive all the events in the event stream.");
        return false;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m4364(MotionEvent motionEvent) {
        int i;
        int actionMasked = motionEvent.getActionMasked();
        int actionIndex = motionEvent.getActionIndex();
        if (actionMasked == 0) {
            m4350();
        }
        if (this.f5983 == null) {
            this.f5983 = VelocityTracker.obtain();
        }
        this.f5983.addMovement(motionEvent);
        int i2 = 0;
        if (actionMasked == 0) {
            float x = motionEvent.getX();
            float y = motionEvent.getY();
            int pointerId = motionEvent.getPointerId(0);
            View r2 = m4359((int) x, (int) y);
            m4351(x, y, pointerId);
            m4355(r2, pointerId);
            int i3 = this.f5990[pointerId];
            int i4 = this.f5974;
            if ((i3 & i4) != 0) {
                this.f5985.onEdgeTouched(i3 & i4, pointerId);
            }
        } else if (actionMasked == 1) {
            if (this.f5982 == 1) {
                m4346();
            }
            m4350();
        } else if (actionMasked != 2) {
            if (actionMasked == 3) {
                if (this.f5982 == 1) {
                    m4361(0.0f, 0.0f);
                }
                m4350();
            } else if (actionMasked == 5) {
                int pointerId2 = motionEvent.getPointerId(actionIndex);
                float x2 = motionEvent.getX(actionIndex);
                float y2 = motionEvent.getY(actionIndex);
                m4351(x2, y2, pointerId2);
                if (this.f5982 == 0) {
                    m4355(m4359((int) x2, (int) y2), pointerId2);
                    int i5 = this.f5990[pointerId2];
                    int i6 = this.f5974;
                    if ((i5 & i6) != 0) {
                        this.f5985.onEdgeTouched(i5 & i6, pointerId2);
                        return;
                    }
                    return;
                }
                if (m4369(this.f5975, (int) x2, (int) y2)) {
                    m4355(this.f5975, pointerId2);
                }
            } else if (actionMasked == 6) {
                int pointerId3 = motionEvent.getPointerId(actionIndex);
                if (this.f5982 == 1 && pointerId3 == this.f5971) {
                    int pointerCount = motionEvent.getPointerCount();
                    while (true) {
                        if (i2 >= pointerCount) {
                            i = -1;
                            break;
                        }
                        int pointerId4 = motionEvent.getPointerId(i2);
                        if (pointerId4 != this.f5971) {
                            View r5 = m4359((int) motionEvent.getX(i2), (int) motionEvent.getY(i2));
                            View view = this.f5975;
                            if (r5 == view && m4355(view, pointerId4)) {
                                i = this.f5971;
                                break;
                            }
                        }
                        i2++;
                    }
                    if (i == -1) {
                        m4346();
                    }
                }
                m4363(pointerId3);
            }
        } else if (this.f5982 != 1) {
            int pointerCount2 = motionEvent.getPointerCount();
            while (i2 < pointerCount2) {
                int pointerId5 = motionEvent.getPointerId(i2);
                if (m4347(pointerId5)) {
                    float x3 = motionEvent.getX(i2);
                    float y3 = motionEvent.getY(i2);
                    float f = x3 - this.f5989[pointerId5];
                    float f2 = y3 - this.f5976[pointerId5];
                    m4362(f, f2, pointerId5);
                    if (this.f5982 != 1) {
                        View r4 = m4359((int) x3, (int) y3);
                        if (m4368(r4, f, f2) && m4355(r4, pointerId5)) {
                            break;
                        }
                    } else {
                        break;
                    }
                }
                i2++;
            }
            m4352(motionEvent);
        } else if (m4347(this.f5971)) {
            int findPointerIndex = motionEvent.findPointerIndex(this.f5971);
            float x4 = motionEvent.getX(findPointerIndex);
            float y4 = motionEvent.getY(findPointerIndex);
            float[] fArr = this.f5987;
            int i7 = this.f5971;
            int i8 = (int) (x4 - fArr[i7]);
            int i9 = (int) (y4 - this.f5981[i7]);
            int left = this.f5975.getLeft() + i8;
            int top2 = this.f5975.getTop() + i9;
            int left2 = this.f5975.getLeft();
            int top3 = this.f5975.getTop();
            if (i8 != 0) {
                left = this.f5985.clampViewPositionHorizontal(this.f5975, left, i8);
                C1729.m4447(this.f5975, left - left2);
            }
            if (i9 != 0) {
                top2 = this.f5985.clampViewPositionVertical(this.f5975, top2, i9);
                C1729.m4503(this.f5975, top2 - top3);
            }
            if (!(i8 == 0 && i9 == 0)) {
                this.f5985.onViewPositionChanged(this.f5975, left, top2, left - left2, top2 - top3);
            }
            m4352(motionEvent);
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final void m4352(MotionEvent motionEvent) {
        int pointerCount = motionEvent.getPointerCount();
        for (int i = 0; i < pointerCount; i++) {
            int pointerId = motionEvent.getPointerId(i);
            if (m4347(pointerId)) {
                float x = motionEvent.getX(i);
                float y = motionEvent.getY(i);
                this.f5987[pointerId] = x;
                this.f5981[pointerId] = y;
            }
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m4353(int i) {
        return ((1 << i) & this.f5978) != 0;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m4355(View view, int i) {
        if (view == this.f5975 && this.f5971 == i) {
            return true;
        }
        if (view == null || !this.f5985.tryCaptureView(view, i)) {
            return false;
        }
        this.f5971 = i;
        m4365(view, i);
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m4362(float f, float f2, int i) {
        int i2 = 1;
        if (!m4366(f, f2, i, 1)) {
            i2 = 0;
        }
        if (m4366(f2, f, i, 4)) {
            i2 |= 4;
        }
        if (m4366(f, f2, i, 2)) {
            i2 |= 2;
        }
        if (m4366(f2, f, i, 8)) {
            i2 |= 8;
        }
        if (i2 != 0) {
            int[] iArr = this.f5979;
            iArr[i] = iArr[i] | i2;
            this.f5985.onEdgeDragStarted(i2, i);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final boolean m4366(float f, float f2, int i, int i2) {
        float abs = Math.abs(f);
        float abs2 = Math.abs(f2);
        if ((this.f5990[i] & i2) != i2 || (this.f5974 & i2) == 0 || (this.f5986[i] & i2) == i2 || (this.f5979[i] & i2) == i2) {
            return false;
        }
        int i3 = this.f5980;
        if (abs <= ((float) i3) && abs2 <= ((float) i3)) {
            return false;
        }
        if (abs < abs2 * 0.5f && this.f5985.onEdgeLock(i2)) {
            int[] iArr = this.f5986;
            iArr[i] = iArr[i] | i2;
            return false;
        } else if ((this.f5979[i] & i2) != 0 || abs <= ((float) this.f5980)) {
            return false;
        } else {
            return true;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final boolean m4368(View view, float f, float f2) {
        if (view == null) {
            return false;
        }
        boolean z = this.f5985.getViewHorizontalDragRange(view) > 0;
        boolean z2 = this.f5985.getViewVerticalDragRange(view) > 0;
        if (z && z2) {
            float f3 = f2 * f2;
            int i = this.f5980;
            if (f3 + (f * f) > ((float) (i * i))) {
                return true;
            }
            return false;
        } else if (z) {
            if (Math.abs(f) > ((float) this.f5980)) {
                return true;
            }
            return false;
        } else if (!z2 || Math.abs(f2) <= ((float) this.f5980)) {
            return false;
        } else {
            return true;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4369(View view, int i, int i2) {
        if (view != null && i >= view.getLeft() && i < view.getRight() && i2 >= view.getTop() && i2 < view.getBottom()) {
            return true;
        }
        return false;
    }

    /* renamed from: K  reason: contains not printable characters */
    public View m4359(int i, int i2) {
        for (int childCount = this.f5973.getChildCount() - 1; childCount >= 0; childCount--) {
            View childAt = this.f5973.getChildAt(this.f5985.getOrderedChildIndex(childCount));
            if (i >= childAt.getLeft() && i < childAt.getRight() && i2 >= childAt.getTop() && i2 < childAt.getBottom()) {
                return childAt;
            }
        }
        return null;
    }
}
