Bug 700559 - Fix crash in startSnap() [r=pcwalton]

There exist conditions where the position of the page can change
between the call to fling() and the running of the FlingRunnable,
since the FlingRunnable gets bounced off two threads. This can
cause the Axis to end up in state WAITING_TO_SNAP with no
overscroll. Instead of crashing, handle this case more gracefully.
This commit is contained in:
Kartikaya Gupta 2011-11-21 09:20:33 -05:00
parent a95c9c748e
commit edfd1f5c4a

View File

@ -516,7 +516,9 @@ public class PanZoomController
mSnapAnim = new EaseOutAnimation(viewportPos, viewportPos - getExcess());
break;
default:
throw new RuntimeException("Not overscrolled at startSnap()");
// no overscroll to deal with, so we're done
mFlingState = FlingStates.STOPPED;
return;
}
mFlingState = FlingStates.SNAPPING;