diff options
author | Adam Cohen <adamcohen@google.com> | 2013-09-19 19:01:37 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-19 19:01:38 +0000 |
commit | 437dec39ee89ba6817967ae5bd75d663eecad5db (patch) | |
tree | 41e9f73bbb500d32ac5a5fd832bb097276c01b32 /src/com | |
parent | b94f3f804f3954666c73e0564391444ec77dc4d4 (diff) | |
parent | 3f452c87db9c3639285eafd17fff6a6f9d28da44 (diff) | |
download | android_packages_apps_Trebuchet-437dec39ee89ba6817967ae5bd75d663eecad5db.tar.gz android_packages_apps_Trebuchet-437dec39ee89ba6817967ae5bd75d663eecad5db.tar.bz2 android_packages_apps_Trebuchet-437dec39ee89ba6817967ae5bd75d663eecad5db.zip |
Merge "Adding some assets / fixing a couple bugs" into jb-ub-now-indigo-rose
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 596ac1113..c0b2ae390 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1950,7 +1950,8 @@ public class Workspace extends SmoothPagedView AlphaUpdateListener.updateVisibility(getPageIndicator()); } searchBar.setAlpha(finalSearchBarAlpha); - AlphaUpdateListener.updateVisibility(mLauncher.getSearchBar()); + AlphaUpdateListener.updateVisibility(searchBar); + updateCustomContentVisibility(); } if (finalSearchBarAlpha == 0) { mLauncher.setVoiceButtonProxyVisible(false); @@ -2017,10 +2018,27 @@ public class Workspace extends SmoothPagedView private void onTransitionPrepare() { mIsSwitchingState = true; updateChildrenLayersEnabled(false); - if (mState != Workspace.State.NORMAL) { - if (hasCustomContent()) { - mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(INVISIBLE); - } + hideCustomContentIfNecessary(); + } + + void updateCustomContentVisibility() { + int visibility = mState == Workspace.State.NORMAL ? VISIBLE : INVISIBLE; + if (hasCustomContent()) { + mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(visibility); + } + } + + void showCustomContentIfNecessary() { + boolean show = mState == Workspace.State.NORMAL; + if (show && hasCustomContent()) { + mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(VISIBLE); + } + } + + void hideCustomContentIfNecessary() { + boolean hide = mState != Workspace.State.NORMAL; + if (hide && hasCustomContent()) { + mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(INVISIBLE); } } @@ -2037,11 +2055,7 @@ public class Workspace extends SmoothPagedView cl.setShortcutAndWidgetAlpha(1f); } } - if (mState == Workspace.State.NORMAL) { - if (hasCustomContent()) { - mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(VISIBLE); - } - } + showCustomContentIfNecessary(); } @Override |