From 6fafbed8dffad4a85fd1f74d9376f1c9d1829138 Mon Sep 17 00:00:00 2001 From: Nebojsa Cvetkovic Date: Tue, 26 Nov 2013 13:30:30 +0000 Subject: Workspace: Show page outlines Change-Id: I5c62982e052423f16d2983888a30519e388568c4 --- res/values-sw720dp/config.xml | 2 ++ res/values/cm_strings.xml | 3 +++ res/values/config.xml | 2 ++ res/values/preferences_defaults.xml | 1 + res/xml/preferences_homescreen.xml | 6 ++++++ src/com/android/launcher3/Workspace.java | 19 +++++++++---------- .../android/launcher3/settings/SettingsProvider.java | 1 + 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/res/values-sw720dp/config.xml b/res/values-sw720dp/config.xml index 4f537a9f4..05fce66a2 100644 --- a/res/values-sw720dp/config.xml +++ b/res/values-sw720dp/config.xml @@ -11,6 +11,8 @@ false true + + true 18000 diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 131acc9e8..f5e3d5b5a 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -21,6 +21,9 @@ Screens and wallpaper Search bar Show persistent search bar at top of screen + Scrolling + Show outlines + Show outlines when scrolling homescreens Drawer diff --git a/res/values/config.xml b/res/values/config.xml index 497828125..892d1478f 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -46,6 +46,8 @@ false false + + false 0 diff --git a/res/values/preferences_defaults.xml b/res/values/preferences_defaults.xml index 99fe92405..b84e8f612 100644 --- a/res/values/preferences_defaults.xml +++ b/res/values/preferences_defaults.xml @@ -1,4 +1,5 @@ true + @bool/config_workspaceDefaultShowOutlines \ No newline at end of file diff --git a/res/xml/preferences_homescreen.xml b/res/xml/preferences_homescreen.xml index 8b2652b9a..7b56f56af 100644 --- a/res/xml/preferences_homescreen.xml +++ b/res/xml/preferences_homescreen.xml @@ -22,4 +22,10 @@ android:title="@string/preferences_interface_homescreen_search_title" android:summary="@string/preferences_interface_homescreen_search_summary" android:defaultValue="@bool/preferences_interface_homescreen_search_default" /> + + + diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 5163d7de6..531eb27e6 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -277,6 +277,7 @@ public class Workspace extends SmoothPagedView }; private boolean mShowSearchBar; + private boolean mShowOutlines; /** * Used to inflate the Workspace from XML. @@ -307,6 +308,9 @@ public class Workspace extends SmoothPagedView mShowSearchBar = SettingsProvider.getBoolean(context, SettingsProvider.SETTINGS_UI_HOMESCREEN_SEARCH, R.bool.preferences_interface_homescreen_search_default); + mShowOutlines = SettingsProvider.getBoolean(context, + SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_SHOW_OUTLINES, + R.bool.preferences_interface_homescreen_scrolling_show_outlines_default); mLauncher = (Launcher) context; final Resources res = getResources(); @@ -1054,10 +1058,7 @@ public class Workspace extends SmoothPagedView } } - // Only show page outlines as we pan if we are on large screen - if (LauncherAppState.getInstance().isScreenLarge()) { - showOutlines(); - } + if (mShowOutlines) showOutlines(); // If we are not fading in adjacent screens, we still need to restore the alpha in case the // user scrolls while we are transitioning (should not affect dispatchDraw optimizations) @@ -1084,10 +1085,8 @@ public class Workspace extends SmoothPagedView mDragController.forceTouchMove(); } } else { - // If we are not mid-dragging, hide the page outlines if we are on a large screen - if (LauncherAppState.getInstance().isScreenLarge()) { - hideOutlines(); - } + // If we are not mid-dragging, hide the page outlines + if (mShowOutlines) hideOutlines(); } if (mDelayedResizeRunnable != null) { @@ -1319,7 +1318,7 @@ public class Workspace extends SmoothPagedView } void showOutlines() { - if (!isSmall() && !mIsSwitchingState) { + if (!mIsSwitchingState) { if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel(); if (mChildrenOutlineFadeInAnimation != null) mChildrenOutlineFadeInAnimation.cancel(); mChildrenOutlineFadeInAnimation = LauncherAnimUtils.ofFloat(this, "childrenOutlineAlpha", 1.0f); @@ -1329,7 +1328,7 @@ public class Workspace extends SmoothPagedView } void hideOutlines() { - if (!isSmall() && !mIsSwitchingState) { + if (!mIsSwitchingState) { if (mChildrenOutlineFadeInAnimation != null) mChildrenOutlineFadeInAnimation.cancel(); if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel(); mChildrenOutlineFadeOutAnimation = LauncherAnimUtils.ofFloat(this, "childrenOutlineAlpha", 0.0f); diff --git a/src/com/android/launcher3/settings/SettingsProvider.java b/src/com/android/launcher3/settings/SettingsProvider.java index 96da0e0a6..679452126 100644 --- a/src/com/android/launcher3/settings/SettingsProvider.java +++ b/src/com/android/launcher3/settings/SettingsProvider.java @@ -26,6 +26,7 @@ public final class SettingsProvider { public static final String SETTINGS_UI_HOMESCREEN_DEFAULT_SCREEN_ID = "ui_homescreen_default_screen_id"; public static final String SETTINGS_UI_HOMESCREEN_SEARCH = "ui_homescreen_search"; + public static final String SETTINGS_UI_HOMESCREEN_SCROLLING_SHOW_OUTLINES = "ui_homescreen_scrolling_show_outlines"; public static SharedPreferences get(Context context) { return context.getSharedPreferences(SETTINGS_KEY, 0); -- cgit v1.2.3