diff options
author | Joe Onorato <joeo@android.com> | 2010-08-31 09:59:21 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-08-31 12:02:32 -0700 |
commit | fdf5fd63c6e76fffd28df6d032ee6bac1417edf6 (patch) | |
tree | 7860d1a83f5c757d24019e0abb0ae5beb3596ba2 /src/com/android/launcher2 | |
parent | f5ed4f1141ae41e25e249f6e085c7080f11dc968 (diff) | |
download | packages_apps_trebuchet-fdf5fd63c6e76fffd28df6d032ee6bac1417edf6.zip packages_apps_trebuchet-fdf5fd63c6e76fffd28df6d032ee6bac1417edf6.tar.gz packages_apps_trebuchet-fdf5fd63c6e76fffd28df6d032ee6bac1417edf6.tar.bz2 |
DO NOT MERGE - Allow the workspace to swipe while it's loading.
You still can't modify the contents of the workspace while it's loading,
but this makes it appear a little bit more responsive. Launching apps
while the launcher is loading has always been possible.
Bug: 2748595
Change-Id: Icf252beaee5b801b30216202ce6032c4d565cde3
Diffstat (limited to 'src/com/android/launcher2')
-rw-r--r-- | src/com/android/launcher2/AllApps3D.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 12 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java index b8aa8ec..308ad28 100644 --- a/src/com/android/launcher2/AllApps3D.java +++ b/src/com/android/launcher2/AllApps3D.java @@ -726,7 +726,12 @@ public class AllApps3D extends RSSurfaceView } public boolean onLongClick(View v) { - if (mLocks != 0 || !isVisible()) { + // We don't accept long click events in these cases + // - If the workspace isn't ready to accept a drop + // - If we're not done loading (because we might be confused about which item + // to pick up + // - If we're not visible + if (!isVisible() || mLauncher.isWorkspaceLocked() || mLocks != 0) { return true; } if (sRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index c337c30..30b1494 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -558,9 +558,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) { int screen = indexOfChild(child); if (screen != mCurrentScreen || !mScroller.isFinished()) { - if (!mLauncher.isWorkspaceLocked()) { - snapToScreen(screen); - } + snapToScreen(screen); return true; } return false; @@ -625,7 +623,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag @Override public boolean dispatchTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { - if (mLauncher.isWorkspaceLocked() || mLauncher.isAllAppsVisible()) { + if (mLauncher.isAllAppsVisible()) { return false; } } @@ -634,9 +632,8 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag @Override public boolean onInterceptTouchEvent(MotionEvent ev) { - final boolean workspaceLocked = mLauncher.isWorkspaceLocked(); final boolean allAppsVisible = mLauncher.isAllAppsVisible(); - if (workspaceLocked || allAppsVisible) { + if (allAppsVisible) { return false; // We don't want the events. Let them fall through to the all apps view. } @@ -840,9 +837,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag @Override public boolean onTouchEvent(MotionEvent ev) { - if (mLauncher.isWorkspaceLocked()) { - return false; // We don't want the events. Let them fall through to the all apps view. - } if (mLauncher.isAllAppsVisible()) { // Cancel any scrolling that is in progress. if (!mScroller.isFinished()) { |