@@ -3857,13 +3857,17 @@ public void run() {
38573857 firstChildTop == contentTop - mOverscrollDistance ) ||
38583858 (mFirstPosition + childCount == mItemCount &&
38593859 lastChildBottom == contentBottom + mOverscrollDistance ))) {
3860- if (mFlingRunnable == null ) {
3861- mFlingRunnable = new FlingRunnable ();
3860+ if (!dispatchNestedPreFling (0 , -initialVelocity )) {
3861+ if (mFlingRunnable == null ) {
3862+ mFlingRunnable = new FlingRunnable ();
3863+ }
3864+ reportScrollStateChange (OnScrollListener .SCROLL_STATE_FLING );
3865+ mFlingRunnable .start (-initialVelocity );
3866+ dispatchNestedFling (0 , -initialVelocity , true );
3867+ } else {
3868+ mTouchMode = TOUCH_MODE_REST ;
3869+ reportScrollStateChange (OnScrollListener .SCROLL_STATE_IDLE );
38623870 }
3863- reportScrollStateChange (OnScrollListener .SCROLL_STATE_FLING );
3864-
3865- mFlingRunnable .start (-initialVelocity );
3866- dispatchNestedFling (0 , -initialVelocity , true );
38673871 } else {
38683872 mTouchMode = TOUCH_MODE_REST ;
38693873 reportScrollStateChange (OnScrollListener .SCROLL_STATE_IDLE );
@@ -4029,7 +4033,9 @@ public boolean onNestedFling(View target, float velocityX, float velocityY, bool
40294033 if (mFlingRunnable == null ) {
40304034 mFlingRunnable = new FlingRunnable ();
40314035 }
4032- mFlingRunnable .start ((int ) velocityY );
4036+ if (!dispatchNestedPreFling (0 , velocityY )) {
4037+ mFlingRunnable .start ((int ) velocityY );
4038+ }
40334039 return true ;
40344040 }
40354041 return dispatchNestedFling (velocityX , velocityY , consumed );
0 commit comments