Deprecated methods in VelocityTrackerCompat that got after before API 14.

Deprecated methods in VelocityTracker and removed their usage in the rest
of the support library.

Bug: 32794064
Test: ./gradlew assemble still works.
Change-Id: Ia805a39aeebce9ff69278836c6dad55218b8b2d5
diff --git a/api/current.txt b/api/current.txt
index fa9564f..90a739c 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -7156,9 +7156,9 @@
     method public abstract void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode);
   }
 
-  public final class VelocityTrackerCompat {
-    method public static float getXVelocity(android.view.VelocityTracker, int);
-    method public static float getYVelocity(android.view.VelocityTracker, int);
+  public final deprecated class VelocityTrackerCompat {
+    method public static deprecated float getXVelocity(android.view.VelocityTracker, int);
+    method public static deprecated float getYVelocity(android.view.VelocityTracker, int);
   }
 
   public class ViewCompat {
diff --git a/compat/honeycomb/android/support/v4/view/VelocityTrackerCompatHoneycomb.java b/compat/honeycomb/android/support/v4/view/VelocityTrackerCompatHoneycomb.java
deleted file mode 100644
index f83a39a..0000000
--- a/compat/honeycomb/android/support/v4/view/VelocityTrackerCompatHoneycomb.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.support.v4.view;
-
-import android.support.annotation.RequiresApi;
-import android.view.VelocityTracker;
-
-/**
- * Implementation of velocity tracker compatibility that can call Honeycomb APIs.
- */
-
-@RequiresApi(11)
-class VelocityTrackerCompatHoneycomb {
-    public static float getXVelocity(VelocityTracker tracker, int pointerId) {
-        return tracker.getXVelocity(pointerId);
-    }
-    public static float getYVelocity(VelocityTracker tracker, int pointerId) {
-        return tracker.getYVelocity(pointerId);
-    }
-}
diff --git a/compat/java/android/support/v4/view/GestureDetectorCompat.java b/compat/java/android/support/v4/view/GestureDetectorCompat.java
index 3809605..7b36166 100644
--- a/compat/java/android/support/v4/view/GestureDetectorCompat.java
+++ b/compat/java/android/support/v4/view/GestureDetectorCompat.java
@@ -251,159 +251,160 @@
             boolean handled = false;
 
             switch (action & MotionEventCompat.ACTION_MASK) {
-            case MotionEventCompat.ACTION_POINTER_DOWN:
-                mDownFocusX = mLastFocusX = focusX;
-                mDownFocusY = mLastFocusY = focusY;
-                // Cancel long press and taps
-                cancelTaps();
-                break;
+                case MotionEventCompat.ACTION_POINTER_DOWN:
+                    mDownFocusX = mLastFocusX = focusX;
+                    mDownFocusY = mLastFocusY = focusY;
+                    // Cancel long press and taps
+                    cancelTaps();
+                    break;
 
-            case MotionEventCompat.ACTION_POINTER_UP:
-                mDownFocusX = mLastFocusX = focusX;
-                mDownFocusY = mLastFocusY = focusY;
+                case MotionEventCompat.ACTION_POINTER_UP:
+                    mDownFocusX = mLastFocusX = focusX;
+                    mDownFocusY = mLastFocusY = focusY;
 
-                // Check the dot product of current velocities.
-                // If the pointer that left was opposing another velocity vector, clear.
-                mVelocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);
-                final int upIndex = MotionEventCompat.getActionIndex(ev);
-                final int id1 = ev.getPointerId(upIndex);
-                final float x1 = VelocityTrackerCompat.getXVelocity(mVelocityTracker, id1);
-                final float y1 = VelocityTrackerCompat.getYVelocity(mVelocityTracker, id1);
-                for (int i = 0; i < count; i++) {
-                    if (i == upIndex) continue;
+                    // Check the dot product of current velocities.
+                    // If the pointer that left was opposing another velocity vector, clear.
+                    mVelocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);
+                    final int upIndex = MotionEventCompat.getActionIndex(ev);
+                    final int id1 = ev.getPointerId(upIndex);
+                    final float x1 = mVelocityTracker.getXVelocity(id1);
+                    final float y1 = mVelocityTracker.getYVelocity(id1);
+                    for (int i = 0; i < count; i++) {
+                        if (i == upIndex) continue;
 
-                    final int id2 = ev.getPointerId(i);
-                    final float x = x1 * VelocityTrackerCompat.getXVelocity(mVelocityTracker, id2);
-                    final float y = y1 * VelocityTrackerCompat.getYVelocity(mVelocityTracker, id2);
+                        final int id2 = ev.getPointerId(i);
+                        final float x = x1 * mVelocityTracker.getXVelocity(id2);
+                        final float y = y1 * mVelocityTracker.getYVelocity(id2);
 
-                    final float dot = x + y;
-                    if (dot < 0) {
-                        mVelocityTracker.clear();
+                        final float dot = x + y;
+                        if (dot < 0) {
+                            mVelocityTracker.clear();
+                            break;
+                        }
+                    }
+                    break;
+
+                case MotionEvent.ACTION_DOWN:
+                    if (mDoubleTapListener != null) {
+                        boolean hadTapMessage = mHandler.hasMessages(TAP);
+                        if (hadTapMessage) mHandler.removeMessages(TAP);
+                        if ((mCurrentDownEvent != null) && (mPreviousUpEvent != null)
+                                && hadTapMessage && isConsideredDoubleTap(
+                                        mCurrentDownEvent, mPreviousUpEvent, ev)) {
+                            // This is a second tap
+                            mIsDoubleTapping = true;
+                            // Give a callback with the first tap of the double-tap
+                            handled |= mDoubleTapListener.onDoubleTap(mCurrentDownEvent);
+                            // Give a callback with down event of the double-tap
+                            handled |= mDoubleTapListener.onDoubleTapEvent(ev);
+                        } else {
+                            // This is a first tap
+                            mHandler.sendEmptyMessageDelayed(TAP, DOUBLE_TAP_TIMEOUT);
+                        }
+                    }
+
+                    mDownFocusX = mLastFocusX = focusX;
+                    mDownFocusY = mLastFocusY = focusY;
+                    if (mCurrentDownEvent != null) {
+                        mCurrentDownEvent.recycle();
+                    }
+                    mCurrentDownEvent = MotionEvent.obtain(ev);
+                    mAlwaysInTapRegion = true;
+                    mAlwaysInBiggerTapRegion = true;
+                    mStillDown = true;
+                    mInLongPress = false;
+                    mDeferConfirmSingleTap = false;
+
+                    if (mIsLongpressEnabled) {
+                        mHandler.removeMessages(LONG_PRESS);
+                        mHandler.sendEmptyMessageAtTime(LONG_PRESS, mCurrentDownEvent.getDownTime()
+                                + TAP_TIMEOUT + LONGPRESS_TIMEOUT);
+                    }
+                    mHandler.sendEmptyMessageAtTime(SHOW_PRESS,
+                            mCurrentDownEvent.getDownTime() + TAP_TIMEOUT);
+                    handled |= mListener.onDown(ev);
+                    break;
+
+                case MotionEvent.ACTION_MOVE:
+                    if (mInLongPress) {
                         break;
                     }
-                }
-                break;
-
-            case MotionEvent.ACTION_DOWN:
-                if (mDoubleTapListener != null) {
-                    boolean hadTapMessage = mHandler.hasMessages(TAP);
-                    if (hadTapMessage) mHandler.removeMessages(TAP);
-                    if ((mCurrentDownEvent != null) && (mPreviousUpEvent != null) && hadTapMessage &&
-                            isConsideredDoubleTap(mCurrentDownEvent, mPreviousUpEvent, ev)) {
-                        // This is a second tap
-                        mIsDoubleTapping = true;
-                        // Give a callback with the first tap of the double-tap
-                        handled |= mDoubleTapListener.onDoubleTap(mCurrentDownEvent);
-                        // Give a callback with down event of the double-tap
+                    final float scrollX = mLastFocusX - focusX;
+                    final float scrollY = mLastFocusY - focusY;
+                    if (mIsDoubleTapping) {
+                        // Give the move events of the double-tap
                         handled |= mDoubleTapListener.onDoubleTapEvent(ev);
-                    } else {
-                        // This is a first tap
-                        mHandler.sendEmptyMessageDelayed(TAP, DOUBLE_TAP_TIMEOUT);
-                    }
-                }
-
-                mDownFocusX = mLastFocusX = focusX;
-                mDownFocusY = mLastFocusY = focusY;
-                if (mCurrentDownEvent != null) {
-                    mCurrentDownEvent.recycle();
-                }
-                mCurrentDownEvent = MotionEvent.obtain(ev);
-                mAlwaysInTapRegion = true;
-                mAlwaysInBiggerTapRegion = true;
-                mStillDown = true;
-                mInLongPress = false;
-                mDeferConfirmSingleTap = false;
-
-                if (mIsLongpressEnabled) {
-                    mHandler.removeMessages(LONG_PRESS);
-                    mHandler.sendEmptyMessageAtTime(LONG_PRESS, mCurrentDownEvent.getDownTime()
-                            + TAP_TIMEOUT + LONGPRESS_TIMEOUT);
-                }
-                mHandler.sendEmptyMessageAtTime(SHOW_PRESS, mCurrentDownEvent.getDownTime() + TAP_TIMEOUT);
-                handled |= mListener.onDown(ev);
-                break;
-
-            case MotionEvent.ACTION_MOVE:
-                if (mInLongPress) {
-                    break;
-                }
-                final float scrollX = mLastFocusX - focusX;
-                final float scrollY = mLastFocusY - focusY;
-                if (mIsDoubleTapping) {
-                    // Give the move events of the double-tap
-                    handled |= mDoubleTapListener.onDoubleTapEvent(ev);
-                } else if (mAlwaysInTapRegion) {
-                    final int deltaX = (int) (focusX - mDownFocusX);
-                    final int deltaY = (int) (focusY - mDownFocusY);
-                    int distance = (deltaX * deltaX) + (deltaY * deltaY);
-                    if (distance > mTouchSlopSquare) {
+                    } else if (mAlwaysInTapRegion) {
+                        final int deltaX = (int) (focusX - mDownFocusX);
+                        final int deltaY = (int) (focusY - mDownFocusY);
+                        int distance = (deltaX * deltaX) + (deltaY * deltaY);
+                        if (distance > mTouchSlopSquare) {
+                            handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY);
+                            mLastFocusX = focusX;
+                            mLastFocusY = focusY;
+                            mAlwaysInTapRegion = false;
+                            mHandler.removeMessages(TAP);
+                            mHandler.removeMessages(SHOW_PRESS);
+                            mHandler.removeMessages(LONG_PRESS);
+                        }
+                        if (distance > mTouchSlopSquare) {
+                            mAlwaysInBiggerTapRegion = false;
+                        }
+                    } else if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) {
                         handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY);
                         mLastFocusX = focusX;
                         mLastFocusY = focusY;
-                        mAlwaysInTapRegion = false;
+                    }
+                    break;
+
+                case MotionEvent.ACTION_UP:
+                    mStillDown = false;
+                    MotionEvent currentUpEvent = MotionEvent.obtain(ev);
+                    if (mIsDoubleTapping) {
+                        // Finally, give the up event of the double-tap
+                        handled |= mDoubleTapListener.onDoubleTapEvent(ev);
+                    } else if (mInLongPress) {
                         mHandler.removeMessages(TAP);
-                        mHandler.removeMessages(SHOW_PRESS);
-                        mHandler.removeMessages(LONG_PRESS);
-                    }
-                    if (distance > mTouchSlopSquare) {
-                        mAlwaysInBiggerTapRegion = false;
-                    }
-                } else if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) {
-                    handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY);
-                    mLastFocusX = focusX;
-                    mLastFocusY = focusY;
-                }
-                break;
+                        mInLongPress = false;
+                    } else if (mAlwaysInTapRegion) {
+                        handled = mListener.onSingleTapUp(ev);
+                        if (mDeferConfirmSingleTap && mDoubleTapListener != null) {
+                            mDoubleTapListener.onSingleTapConfirmed(ev);
+                        }
+                    } else {
+                        // A fling must travel the minimum tap distance
+                        final VelocityTracker velocityTracker = mVelocityTracker;
+                        final int pointerId = ev.getPointerId(0);
+                        velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);
+                        final float velocityY = velocityTracker.getYVelocity(pointerId);
+                        final float velocityX = velocityTracker.getXVelocity(pointerId);
 
-            case MotionEvent.ACTION_UP:
-                mStillDown = false;
-                MotionEvent currentUpEvent = MotionEvent.obtain(ev);
-                if (mIsDoubleTapping) {
-                    // Finally, give the up event of the double-tap
-                    handled |= mDoubleTapListener.onDoubleTapEvent(ev);
-                } else if (mInLongPress) {
-                    mHandler.removeMessages(TAP);
-                    mInLongPress = false;
-                } else if (mAlwaysInTapRegion) {
-                    handled = mListener.onSingleTapUp(ev);
-                    if (mDeferConfirmSingleTap && mDoubleTapListener != null) {
-                        mDoubleTapListener.onSingleTapConfirmed(ev);
+                        if ((Math.abs(velocityY) > mMinimumFlingVelocity)
+                                || (Math.abs(velocityX) > mMinimumFlingVelocity)) {
+                            handled = mListener.onFling(
+                                    mCurrentDownEvent, ev, velocityX, velocityY);
+                        }
                     }
-                } else {
-                    // A fling must travel the minimum tap distance
-                    final VelocityTracker velocityTracker = mVelocityTracker;
-                    final int pointerId = ev.getPointerId(0);
-                    velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);
-                    final float velocityY = VelocityTrackerCompat.getYVelocity(
-                            velocityTracker, pointerId);
-                    final float velocityX = VelocityTrackerCompat.getXVelocity(
-                            velocityTracker, pointerId);
-
-                    if ((Math.abs(velocityY) > mMinimumFlingVelocity)
-                            || (Math.abs(velocityX) > mMinimumFlingVelocity)){
-                        handled = mListener.onFling(mCurrentDownEvent, ev, velocityX, velocityY);
+                    if (mPreviousUpEvent != null) {
+                        mPreviousUpEvent.recycle();
                     }
-                }
-                if (mPreviousUpEvent != null) {
-                    mPreviousUpEvent.recycle();
-                }
-                // Hold the event we obtained above - listeners may have changed the original.
-                mPreviousUpEvent = currentUpEvent;
-                if (mVelocityTracker != null) {
-                    // This may have been cleared when we called out to the
-                    // application above.
-                    mVelocityTracker.recycle();
-                    mVelocityTracker = null;
-                }
-                mIsDoubleTapping = false;
-                mDeferConfirmSingleTap = false;
-                mHandler.removeMessages(SHOW_PRESS);
-                mHandler.removeMessages(LONG_PRESS);
-                break;
+                    // Hold the event we obtained above - listeners may have changed the original.
+                    mPreviousUpEvent = currentUpEvent;
+                    if (mVelocityTracker != null) {
+                        // This may have been cleared when we called out to the
+                        // application above.
+                        mVelocityTracker.recycle();
+                        mVelocityTracker = null;
+                    }
+                    mIsDoubleTapping = false;
+                    mDeferConfirmSingleTap = false;
+                    mHandler.removeMessages(SHOW_PRESS);
+                    mHandler.removeMessages(LONG_PRESS);
+                    break;
 
-            case MotionEvent.ACTION_CANCEL:
-                cancel();
-                break;
+                case MotionEvent.ACTION_CANCEL:
+                    cancel();
+                    break;
             }
 
             return handled;
diff --git a/compat/java/android/support/v4/view/VelocityTrackerCompat.java b/compat/java/android/support/v4/view/VelocityTrackerCompat.java
index 3a02c37..327f21a 100644
--- a/compat/java/android/support/v4/view/VelocityTrackerCompat.java
+++ b/compat/java/android/support/v4/view/VelocityTrackerCompat.java
@@ -21,74 +21,33 @@
 /**
  * Helper for accessing features in {@link VelocityTracker}
  * introduced after API level 4 in a backwards compatible fashion.
+ *
+ * @deprecated Use {@link VelocityTracker} directly.
  */
+@Deprecated
 public final class VelocityTrackerCompat {
     /**
-     * Interface for the full API.
-     */
-    interface VelocityTrackerVersionImpl {
-        public float getXVelocity(VelocityTracker tracker, int pointerId);
-        public float getYVelocity(VelocityTracker tracker, int pointerId);
-    }
-
-    /**
-     * Interface implementation that doesn't use anything about v4 APIs.
-     */
-    static class BaseVelocityTrackerVersionImpl implements VelocityTrackerVersionImpl {
-        @Override
-        public float getXVelocity(VelocityTracker tracker, int pointerId) {
-            return tracker.getXVelocity();
-        }
-        @Override
-        public float getYVelocity(VelocityTracker tracker, int pointerId) {
-            return tracker.getYVelocity();
-        }
-    }
-
-    /**
-     * Interface implementation for devices with at least v11 APIs.
-     */
-    static class HoneycombVelocityTrackerVersionImpl implements VelocityTrackerVersionImpl {
-        @Override
-        public float getXVelocity(VelocityTracker tracker, int pointerId) {
-            return VelocityTrackerCompatHoneycomb.getXVelocity(tracker, pointerId);
-        }
-        @Override
-        public float getYVelocity(VelocityTracker tracker, int pointerId) {
-            return VelocityTrackerCompatHoneycomb.getYVelocity(tracker, pointerId);
-        }
-    }
-
-    /**
-     * Select the correct implementation to use for the current platform.
-     */
-    static final VelocityTrackerVersionImpl IMPL;
-    static {
-        if (android.os.Build.VERSION.SDK_INT >= 11) {
-            IMPL = new HoneycombVelocityTrackerVersionImpl();
-        } else {
-            IMPL = new BaseVelocityTrackerVersionImpl();
-        }
-    }
-
-    // -------------------------------------------------------------------
-
-    /**
      * Call {@link VelocityTracker#getXVelocity(int)}.
      * If running on a pre-{@link android.os.Build.VERSION_CODES#HONEYCOMB} device,
      * returns {@link VelocityTracker#getXVelocity()}.
+     *
+     * @deprecated Use {@link VelocityTracker#getXVelocity(int)} directly.
      */
+    @Deprecated
     public static float getXVelocity(VelocityTracker tracker, int pointerId) {
-        return IMPL.getXVelocity(tracker, pointerId);
+        return tracker.getXVelocity(pointerId);
     }
 
     /**
      * Call {@link VelocityTracker#getYVelocity(int)}.
      * If running on a pre-{@link android.os.Build.VERSION_CODES#HONEYCOMB} device,
      * returns {@link VelocityTracker#getYVelocity()}.
+     *
+     * @deprecated Use {@link VelocityTracker#getYVelocity(int)} directly.
      */
+    @Deprecated
     public static float getYVelocity(VelocityTracker tracker, int pointerId) {
-        return IMPL.getYVelocity(tracker, pointerId);
+        return tracker.getYVelocity(pointerId);
     }
 
     private VelocityTrackerCompat() {}
diff --git a/core-ui/java/android/support/v4/view/ViewPager.java b/core-ui/java/android/support/v4/view/ViewPager.java
index 47d224f..5b9fa8c 100644
--- a/core-ui/java/android/support/v4/view/ViewPager.java
+++ b/core-ui/java/android/support/v4/view/ViewPager.java
@@ -2266,8 +2266,7 @@
                 if (mIsBeingDragged) {
                     final VelocityTracker velocityTracker = mVelocityTracker;
                     velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
-                    int initialVelocity = (int) VelocityTrackerCompat.getXVelocity(
-                            velocityTracker, mActivePointerId);
+                    int initialVelocity = (int) velocityTracker.getXVelocity(mActivePointerId);
                     mPopulatePending = true;
                     final int width = getClientWidth();
                     final int scrollX = getScrollX();
@@ -2575,8 +2574,7 @@
         if (mAdapter != null) {
             final VelocityTracker velocityTracker = mVelocityTracker;
             velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
-            int initialVelocity = (int) VelocityTrackerCompat.getXVelocity(
-                    velocityTracker, mActivePointerId);
+            int initialVelocity = (int) velocityTracker.getXVelocity(mActivePointerId);
             mPopulatePending = true;
             final int width = getClientWidth();
             final int scrollX = getScrollX();
diff --git a/core-ui/java/android/support/v4/widget/NestedScrollView.java b/core-ui/java/android/support/v4/widget/NestedScrollView.java
index 44cc043..da44ccb 100644
--- a/core-ui/java/android/support/v4/widget/NestedScrollView.java
+++ b/core-ui/java/android/support/v4/widget/NestedScrollView.java
@@ -35,7 +35,6 @@
 import android.support.v4.view.NestedScrollingParent;
 import android.support.v4.view.NestedScrollingParentHelper;
 import android.support.v4.view.ScrollingView;
-import android.support.v4.view.VelocityTrackerCompat;
 import android.support.v4.view.ViewCompat;
 import android.support.v4.view.accessibility.AccessibilityEventCompat;
 import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
@@ -834,8 +833,7 @@
                 if (mIsBeingDragged) {
                     final VelocityTracker velocityTracker = mVelocityTracker;
                     velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
-                    int initialVelocity = (int) VelocityTrackerCompat.getYVelocity(velocityTracker,
-                            mActivePointerId);
+                    int initialVelocity = (int) velocityTracker.getYVelocity(mActivePointerId);
 
                     if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
                         flingWithNestedDispatch(-initialVelocity);
diff --git a/core-ui/java/android/support/v4/widget/ViewDragHelper.java b/core-ui/java/android/support/v4/widget/ViewDragHelper.java
index 171e292..5833708 100644
--- a/core-ui/java/android/support/v4/widget/ViewDragHelper.java
+++ b/core-ui/java/android/support/v4/widget/ViewDragHelper.java
@@ -19,7 +19,6 @@
 
 import android.content.Context;
 import android.support.v4.view.MotionEventCompat;
-import android.support.v4.view.VelocityTrackerCompat;
 import android.support.v4.view.ViewCompat;
 import android.util.Log;
 import android.view.MotionEvent;
@@ -570,8 +569,8 @@
         }
 
         return forceSettleCapturedViewAt(finalLeft, finalTop,
-                (int) VelocityTrackerCompat.getXVelocity(mVelocityTracker, mActivePointerId),
-                (int) VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId));
+                (int) mVelocityTracker.getXVelocity(mActivePointerId),
+                (int) mVelocityTracker.getYVelocity(mActivePointerId));
     }
 
     /**
@@ -703,8 +702,8 @@
         }
 
         mScroller.fling(mCapturedView.getLeft(), mCapturedView.getTop(),
-                (int) VelocityTrackerCompat.getXVelocity(mVelocityTracker, mActivePointerId),
-                (int) VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId),
+                (int) mVelocityTracker.getXVelocity(mActivePointerId),
+                (int) mVelocityTracker.getYVelocity(mActivePointerId),
                 minLeft, maxLeft, minTop, maxTop);
 
         setDragState(STATE_SETTLING);
@@ -1405,10 +1404,10 @@
     private void releaseViewForPointerUp() {
         mVelocityTracker.computeCurrentVelocity(1000, mMaxVelocity);
         final float xvel = clampMag(
-                VelocityTrackerCompat.getXVelocity(mVelocityTracker, mActivePointerId),
+                mVelocityTracker.getXVelocity(mActivePointerId),
                 mMinVelocity, mMaxVelocity);
         final float yvel = clampMag(
-                VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId),
+                mVelocityTracker.getYVelocity(mActivePointerId),
                 mMinVelocity, mMaxVelocity);
         dispatchViewReleased(xvel, yvel);
     }
diff --git a/design/src/android/support/design/widget/BottomSheetBehavior.java b/design/src/android/support/design/widget/BottomSheetBehavior.java
index 0bbdc22..a69b8bd 100644
--- a/design/src/android/support/design/widget/BottomSheetBehavior.java
+++ b/design/src/android/support/design/widget/BottomSheetBehavior.java
@@ -31,8 +31,6 @@
 import android.support.v4.os.ParcelableCompatCreatorCallbacks;
 import android.support.v4.view.AbsSavedState;
 import android.support.v4.view.MotionEventCompat;
-import android.support.v4.view.NestedScrollingChild;
-import android.support.v4.view.VelocityTrackerCompat;
 import android.support.v4.view.ViewCompat;
 import android.support.v4.widget.ViewDragHelper;
 import android.util.AttributeSet;
@@ -616,7 +614,7 @@
 
     private float getYVelocity() {
         mVelocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
-        return VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId);
+        return mVelocityTracker.getYVelocity(mActivePointerId);
     }
 
     void startSettlingAnimation(View child, int state) {
diff --git a/design/src/android/support/design/widget/HeaderBehavior.java b/design/src/android/support/design/widget/HeaderBehavior.java
index 5e555de..31dab82 100644
--- a/design/src/android/support/design/widget/HeaderBehavior.java
+++ b/design/src/android/support/design/widget/HeaderBehavior.java
@@ -19,7 +19,6 @@
 import android.content.Context;
 import android.support.design.widget.CoordinatorLayout.Behavior;
 import android.support.v4.view.MotionEventCompat;
-import android.support.v4.view.VelocityTrackerCompat;
 import android.support.v4.view.ViewCompat;
 import android.support.v4.widget.ScrollerCompat;
 import android.util.AttributeSet;
@@ -167,8 +166,7 @@
                 if (mVelocityTracker != null) {
                     mVelocityTracker.addMovement(ev);
                     mVelocityTracker.computeCurrentVelocity(1000);
-                    float yvel = VelocityTrackerCompat.getYVelocity(mVelocityTracker,
-                            mActivePointerId);
+                    float yvel = mVelocityTracker.getYVelocity(mActivePointerId);
                     fling(parent, child, -getScrollRangeForDragFling(child), 0, yvel);
                 }
                 // $FALLTHROUGH