diff options
author | Winson Chung <winsonc@google.com> | 2011-07-08 11:14:33 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-07-08 11:14:54 -0700 |
commit | b8dffaffa187f1d8d8b0fde10a9fd109d39874ff (patch) | |
tree | fb360269966020425a1b7eee83b170cf11300fc2 /src/com/android/launcher2/SpringLoadedDragController.java | |
parent | 358049b75f7af1862dfae9d4ec48dde542ae5cb2 (diff) | |
download | packages_apps_trebuchet-b8dffaffa187f1d8d8b0fde10a9fd109d39874ff.zip packages_apps_trebuchet-b8dffaffa187f1d8d8b0fde10a9fd109d39874ff.tar.gz packages_apps_trebuchet-b8dffaffa187f1d8d8b0fde10a9fd109d39874ff.tar.bz2 |
Fixing small bug where you could not cancel springloaded the first time you drag out of layout.
Change-Id: I29a76eb628b232a2853bc3ba3dd632328b376d4e
Diffstat (limited to 'src/com/android/launcher2/SpringLoadedDragController.java')
-rw-r--r-- | src/com/android/launcher2/SpringLoadedDragController.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher2/SpringLoadedDragController.java b/src/com/android/launcher2/SpringLoadedDragController.java index 0d4785d..7b4adf3 100644 --- a/src/com/android/launcher2/SpringLoadedDragController.java +++ b/src/com/android/launcher2/SpringLoadedDragController.java @@ -39,10 +39,8 @@ public class SpringLoadedDragController implements OnAlarmListener { // Set a new alarm to expire for the screen that we are hovering over now public void setAlarm(CellLayout cl) { - if (mScreen != cl) { - mAlarm.cancelAlarm(); - mAlarm.setAlarm(ENTER_SPRING_LOAD_HOVER_TIME); - } + mAlarm.cancelAlarm(); + mAlarm.setAlarm(ENTER_SPRING_LOAD_HOVER_TIME); mScreen = cl; } @@ -52,7 +50,9 @@ public class SpringLoadedDragController implements OnAlarmListener { // Snap to the screen that we are hovering over now Workspace w = mLauncher.getWorkspace(); int page = w.indexOfChild(mScreen); - w.snapToPage(page); + if (page != w.getCurrentPage()) { + w.snapToPage(page); + } } else { mLauncher.getDragController().cancelDrag(); } |