@@ -569,7 +569,7 @@ public boolean onTouchEvent(MotionEvent ev) {
569569 final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS ||
570570 (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && range > 0 );
571571
572- if (canOverscroll && overScrollBy (deltaX , 0 , mScrollX , 0 , range , 0 ,
572+ if (overScrollBy (deltaX , 0 , mScrollX , 0 , range , 0 ,
573573 mOverscrollDistance , 0 , true )) {
574574 // Break our velocity if we hit a scroll barrier.
575575 mVelocityTracker .clear ();
@@ -602,16 +602,12 @@ public boolean onTouchEvent(MotionEvent ev) {
602602 velocityTracker .computeCurrentVelocity (1000 , mMaximumVelocity );
603603 int initialVelocity = (int ) velocityTracker .getXVelocity (mActivePointerId );
604604
605- final int right = getScrollRange ();
606- final int overscrollMode = getOverScrollMode ();
607- final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS ||
608- (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && right > 0 );
609-
610- if (getChildCount () > 0 && canOverscroll ) {
605+ if (getChildCount () > 0 ) {
611606 if ((Math .abs (initialVelocity ) > mMinimumVelocity )) {
612607 fling (-initialVelocity );
613608 } else {
614- if (mScroller .springBack (mScrollX , mScrollY , 0 , right , 0 , 0 )) {
609+ if (mScroller .springBack (mScrollX , mScrollY , 0 ,
610+ getScrollRange (), 0 , 0 )) {
615611 invalidate ();
616612 }
617613 }
0 commit comments