diff options
author | Nebojsa Cvetkovic <nebkat@gmail.com> | 2013-11-26 13:30:30 +0000 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-01-24 16:24:23 -0800 |
commit | 6fafbed8dffad4a85fd1f74d9376f1c9d1829138 (patch) | |
tree | ca98beee8627bcceefb0a046feb31df686450f43 | |
parent | d14c5a17b22825ead2f56797efb5e52096375f9e (diff) | |
download | android_packages_apps_Trebuchet-6fafbed8dffad4a85fd1f74d9376f1c9d1829138.tar.gz android_packages_apps_Trebuchet-6fafbed8dffad4a85fd1f74d9376f1c9d1829138.tar.bz2 android_packages_apps_Trebuchet-6fafbed8dffad4a85fd1f74d9376f1c9d1829138.zip |
Workspace: Show page outlines
Change-Id: I5c62982e052423f16d2983888a30519e388568c4
-rw-r--r-- | res/values-sw720dp/config.xml | 2 | ||||
-rw-r--r-- | res/values/cm_strings.xml | 3 | ||||
-rw-r--r-- | res/values/config.xml | 2 | ||||
-rw-r--r-- | res/values/preferences_defaults.xml | 1 | ||||
-rw-r--r-- | res/xml/preferences_homescreen.xml | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 19 | ||||
-rw-r--r-- | src/com/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 @@ <bool name="config_useDropTargetDownTransition">false</bool> <!-- Whether or not to fade the side pages --> <bool name="config_workspaceFadeAdjacentScreens">true</bool> + <!-- Whether to show outlines on the screens when scrolling --> + <bool name="config_workspaceDefaultShowOutlines">true</bool> <!-- Camera distance for the overscroll effect --> <integer name="config_cameraDistance">18000</integer> 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 @@ <string name="preferences_interface_homescreen_summary">Screens and wallpaper</string> <string name="preferences_interface_homescreen_search_title">Search bar</string> <string name="preferences_interface_homescreen_search_summary">Show persistent search bar at top of screen</string> + <string name="preferences_interface_homescreen_scrolling_category">Scrolling</string> + <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Show outlines</string> + <string name="preferences_interface_homescreen_scrolling_show_outlines_summary">Show outlines when scrolling homescreens</string> <!-- Drawer --> <string name="preferences_interface_drawer_title">Drawer</string> 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 @@ <bool name="config_useDropTargetDownTransition">false</bool> <!-- Whether or not to fade the side pages --> <bool name="config_workspaceFadeAdjacentScreens">false</bool> + <!-- Whether to show outlines on the screens when scrolling --> + <bool name="config_workspaceDefaultShowOutlines">false</bool> <!-- The transition duration for the background of the drop targets --> <integer name="config_dropTargetBgTransitionDuration">0</integer> 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 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <bool name="preferences_interface_homescreen_search_default">true</bool> + <bool name="preferences_interface_homescreen_scrolling_show_outlines_default">@bool/config_workspaceDefaultShowOutlines</bool> </resources>
\ 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" /> + <PreferenceCategory android:title="@string/preferences_interface_homescreen_scrolling_category"> + <CheckBoxPreference android:key="ui_homescreen_scrolling_show_outlines" + android:title="@string/preferences_interface_homescreen_scrolling_show_outlines_title" + android:summary="@string/preferences_interface_homescreen_scrolling_show_outlines_summary" + android:defaultValue="@bool/config_workspaceDefaultShowOutlines" /> + </PreferenceCategory> </PreferenceScreen> 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); |