diff options
author | Michael Jurka <mikejurka@google.com> | 2011-01-26 00:00:44 -0800 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-01-26 00:03:19 -0800 |
commit | 0bb8563b1381d92b0d7dbb5b0f814ad656c2f9bd (patch) | |
tree | f94ab0d1367e8708b9960eaf7afae10d0d75caad /src/com/android/launcher2/SpringLoadedDragController.java | |
parent | 5cc7c35dca4d1279575285f33ecef1a1df339d11 (diff) | |
download | packages_apps_trebuchet-0bb8563b1381d92b0d7dbb5b0f814ad656c2f9bd.zip packages_apps_trebuchet-0bb8563b1381d92b0d7dbb5b0f814ad656c2f9bd.tar.gz packages_apps_trebuchet-0bb8563b1381d92b0d7dbb5b0f814ad656c2f9bd.tar.bz2 |
Fix issue with spring loaded mode
Bug # 3373320
Diffstat (limited to 'src/com/android/launcher2/SpringLoadedDragController.java')
-rw-r--r-- | src/com/android/launcher2/SpringLoadedDragController.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/launcher2/SpringLoadedDragController.java b/src/com/android/launcher2/SpringLoadedDragController.java index a734258..9007581 100644 --- a/src/com/android/launcher2/SpringLoadedDragController.java +++ b/src/com/android/launcher2/SpringLoadedDragController.java @@ -26,6 +26,8 @@ public class SpringLoadedDragController implements OnAlarmListener { // the screen the user is currently hovering over, if any private CellLayout mScreen; private Launcher mLauncher; + boolean mFinishedAnimation = false; + boolean mWaitingToReenter = false; public SpringLoadedDragController(Launcher launcher) { mLauncher = launcher; @@ -33,9 +35,16 @@ public class SpringLoadedDragController implements OnAlarmListener { mAlarm.setOnAlarmListener(this); } - public void onDragEnter(CellLayout cl) { + public void onDragEnter(CellLayout cl, boolean isSpringLoaded) { mScreen = cl; mAlarm.setAlarm(ENTER_SPRING_LOAD_HOVER_TIME); + mFinishedAnimation = isSpringLoaded; + mWaitingToReenter = false; + } + + public void onEnterSpringLoadedMode(boolean waitToReenter) { + mFinishedAnimation = true; + mWaitingToReenter = waitToReenter; } public void onDragExit() { @@ -43,7 +52,9 @@ public class SpringLoadedDragController implements OnAlarmListener { mScreen.onDragExit(); } mScreen = null; - mAlarm.setAlarm(EXIT_SPRING_LOAD_HOVER_TIME); + if (mFinishedAnimation && !mWaitingToReenter) { + mAlarm.setAlarm(EXIT_SPRING_LOAD_HOVER_TIME); + } } // this is called when our timer runs out |