From 130110f316db7592a7e2d15f74c8fb60d1e4cc2a Mon Sep 17 00:00:00 2001 From: Matt Garnes Date: Fri, 20 Jun 2014 14:19:43 -0700 Subject: Fix CustomContent/CMHome bugs with settings. 1. If Search Panel / CMHome is enabled, it would become visible in overview mode after any setting is toggled. Fixed. 2. If all icons on the last home screen were removed and Search Panel / CMHome is enabled, CMHome would become the only workspace, breaking most things. Fixed. Change-Id: I5a31e8058f71922c2790c6ac43b09ed7bcbe768a --- src/com/android/launcher3/Launcher.java | 1 + src/com/android/launcher3/Workspace.java | 20 ++------------------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 2947eda0f..a8f24ef38 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -4894,6 +4894,7 @@ public class Launcher extends Activity // Synchronized reload mModel.startLoader(true, mWorkspace.getCurrentPage()); + mWorkspace.updateCustomContentVisibility(); } } diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index c67ca9395..7e3584115 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1638,13 +1638,7 @@ public class Workspace extends SmoothPagedView } public int numCustomPages() { - // GEL integration is a special case (not a *real* screen) and should - // not be counted as custom content. - if(mLauncher.isGelIntegrationEnabled()) { - return 0; - } else { - return hasCustomContent() ? 1 : 0; - } + return hasCustomContent() ? 1 : 0; } public boolean isOnOrMovingToCustomContent() { @@ -2124,11 +2118,6 @@ public class Workspace extends SmoothPagedView int start = numCustomPages(); int end = getChildCount() - 1; - // For GEL integration, do not include the first page (GEL) - if(mLauncher.isGelIntegrationEnabled()) { - start += 1; - } - range[0] = Math.max(0, Math.min(start, getChildCount() - 1)); range[1] = Math.max(0, end); } @@ -4195,12 +4184,7 @@ public class Workspace extends SmoothPagedView } public int getCurrentPageOffsetFromCustomContent() { - int numCustomPages = numCustomPages(); - // Special case where the Gel Integration page must be counted below - if(mLauncher.isGelIntegrationEnabled() && mLauncher.isGelIntegrationSupported()) { - numCustomPages += 1; - } - return getNextPage() - numCustomPages; + return getNextPage() - numCustomPages(); } /** -- cgit v1.2.3