@Override public boolean onFling( final MotionEvent e1, final MotionEvent e2, final float velocityX, final float velocityY) { if (!mShouldCallbackDuringFling) { // We want to suppress selection changes // Remove any future code to set mSuppressSelectionChanged = false removeCallbacks(mDisableSuppressSelectionChangedRunnable); // This will get reset once we scroll into slots if (!mSuppressSelectionChanged) { mSuppressSelectionChanged = true; } } // Fling the Gallery! mFlingRunnable.startUsingVelocity((int) -velocityX); return true; }