From 4a65b0c3022357d2b14db196224931cc35f14417 Mon Sep 17 00:00:00 2001 From: Matt Garnes Date: Fri, 20 Jun 2014 13:39:50 -0700 Subject: Add support for CMHome (1/2) Add permission for DashClock extensions. Change Trebuchet to allow viewing additional screen. Add setting that to configure Google Now / CMHome. Change-Id: I63286a2cce87455ed411bd4c77680200eec89be7 --- src/com/android/launcher3/Workspace.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/com/android/launcher3/Workspace.java') diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 63e893da1..7501dbf7d 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1309,8 +1309,6 @@ public class Workspace extends SmoothPagedView int customPageIndex = getPageIndexForScreenId(CUSTOM_CONTENT_SCREEN_ID); if (hasCustomContent() && whichPage == customPageIndex && !mCustomContentShowing) { if(!isInOverviewMode()) { - mCustomContentShowing = true; - // Start Google Now and register the gesture to return to Trebuchet mLauncher.onCustomContentLaunch(); } } @@ -1833,10 +1831,14 @@ public class Workspace extends SmoothPagedView int customPageIndex = getPageIndexForScreenId(CUSTOM_CONTENT_SCREEN_ID); // mCustomContentShowing can be lost if the Activity is recreated, // So make sure it is set to the right value. + boolean restoreCustomContentShowing = ((customPageIndex == getCurrentPage()) + || (customPageIndex == getNextPage())) + && hasCustomContent(); mCustomContentShowing = mCustomContentShowing - || (customPageIndex == getCurrentPage() - && hasCustomContent()); - if (mCustomContentShowing && mLauncher.isGelIntegrationEnabled()) { + || restoreCustomContentShowing; + if (mCustomContentShowing + && (mLauncher.getCustomContentMode() == Launcher.CustomContentMode.GEL) + && !isInOverviewMode()) { moveToScreen((customPageIndex + 1), true); } } @@ -4931,7 +4933,7 @@ public class Workspace extends SmoothPagedView int idx = getPageIndexForScreenId(mDefaultScreenId); int ccIndex = getPageIndexForScreenId(CUSTOM_CONTENT_SCREEN_ID); if(hasCustomContent() && (idx == ccIndex || idx == -1) - && mLauncher.isGelIntegrationEnabled()) { + && !isInOverviewMode()) { idx = 1; } moveToScreen(idx, animate); -- cgit v1.2.3