diff options
author | Matt Garnes <matt@cyngn.com> | 2015-06-25 15:02:00 -0700 |
---|---|---|
committer | Matt Garnes <matt@cyngn.com> | 2015-06-29 14:29:38 -0700 |
commit | 19074500747a39f78f50a69134cbb989619f6f83 (patch) | |
tree | 296fe8731900765a6ff85c3d7005c2be5348fb0f | |
parent | 4658e3e990b697413f937d7dc338b0d6105c5e38 (diff) | |
download | android_packages_apps_Trebuchet-19074500747a39f78f50a69134cbb989619f6f83.tar.gz android_packages_apps_Trebuchet-19074500747a39f78f50a69134cbb989619f6f83.tar.bz2 android_packages_apps_Trebuchet-19074500747a39f78f50a69134cbb989619f6f83.zip |
Hide workspace shortcuts during binding when AllApps is shown.
Previously, if All Apps was opened before the workspace items were
bound, the shortcuts would be come visible behind the app drawer when
the loading finished.
Set the alpha of the shortcuts to 0f to hide them if isAllAppsVisible()
returns true.
Change-Id: I399bf27435dfe179f64646456496b31eade864a3
(cherry picked from commit 31559aeea6b4540bacb26e621c2ad18e0e94c0dd)
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 16 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d335fd850..9b47db772 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -4987,9 +4987,13 @@ public class Launcher extends Activity } } + // If AllApps is visible, all icons should have alpha of 0f to remain hidden. + if (mWorkspace.isHidden()) { + shortcut.setAlpha(0f); + } workspace.addInScreenFromBind(shortcut, item.container, item.screenId, item.cellX, item.cellY, 1, 1); - if (animateIcons) { + if (animateIcons && !mWorkspace.isHidden()) { // Animate all the applications up now shortcut.setAlpha(0f); shortcut.setScaleX(0f); @@ -5011,7 +5015,15 @@ public class Launcher extends Activity } } - if (animateIcons) { + // Hide all cell layouts if AllApps is currently visible. + if (mWorkspace.isHidden()) { + for (Long screenId : mWorkspace.getScreenOrder()) { + CellLayout cl = mWorkspace.getScreenWithId(screenId); + cl.setShortcutAndWidgetAlpha(0f); + } + } + + if (animateIcons && !mWorkspace.isHidden()) { // Animate to the correct page if (newShortcutsScreenId > -1) { long currentScreenId = mWorkspace.getScreenIdForPageIndex(mWorkspace.getNextPage()); diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 48a3db6d6..bfe555a63 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1111,6 +1111,10 @@ public class Workspace extends SmoothPagedView return mIsSwitchingState; } + public boolean isHidden() { + return mState == State.NORMAL_HIDDEN; + } + /** This differs from isSwitchingState in that we take into account how far the transition * has completed. */ public boolean isFinishedSwitchingState() { |