diff options
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 06143126a..d0f4b86fb 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -496,6 +496,12 @@ public final class Launcher extends Activity return mDragLayer; } + boolean isDraggingEnabled() { + // We prevent dragging when we are loading the workspace as it is possible to pick up a view + // that is subsequently removed from the workspace in startBinding(). + return !mModel.isLoadingWorkspace(); + } + static int getScreen() { synchronized (sLock) { return sScreen; @@ -2082,14 +2088,9 @@ public final class Launcher extends Activity } public boolean onLongClick(View v) { - - if (mState != State.WORKSPACE) { - return false; - } - - if (isWorkspaceLocked()) { - return false; - } + if (!isDraggingEnabled()) return false; + if (isWorkspaceLocked()) return false; + if (mState != State.WORKSPACE) return false; if (!(v instanceof CellLayout)) { v = (View) v.getParent().getParent(); |