diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2014-07-18 15:20:34 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2014-07-18 16:33:32 -0700 |
commit | d40dd45c18a55d574d65b3a0ac16b59d76027049 (patch) | |
tree | f0aac03be6908bc27c829443bc16c82ac5205460 /res | |
parent | 3bd05152421757e8f0c19edc6ba30361f64ceb51 (diff) | |
download | packages_apps_Settings-d40dd45c18a55d574d65b3a0ac16b59d76027049.zip packages_apps_Settings-d40dd45c18a55d574d65b3a0ac16b59d76027049.tar.gz packages_apps_Settings-d40dd45c18a55d574d65b3a0ac16b59d76027049.tar.bz2 |
Fix overdraw and do some layout optimizations
- use a specific layout for the Dashboard and for the Preferences
- use a specific background for the Dashboard and for the Preferences
The main idea here is that you cannot have the same layout / background
because the Dashboard is using the "Z elevation" for having its card
"poping up"
Change-Id: I42b7c91efea14315b8a60cf3876938a7f1d1e0b3
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/preference_background.xml (renamed from res/drawable/preference_list_fragment_background.xml) | 4 | ||||
-rw-r--r-- | res/layout/preference_list_fragment.xml | 4 | ||||
-rw-r--r-- | res/layout/settings_main_dashboard.xml | 25 | ||||
-rw-r--r-- | res/layout/settings_main_prefs.xml (renamed from res/layout/settings_main.xml) | 6 | ||||
-rw-r--r-- | res/values/attrs.xml | 2 | ||||
-rw-r--r-- | res/values/colors.xml | 2 | ||||
-rw-r--r-- | res/values/themes.xml | 12 |
7 files changed, 39 insertions, 16 deletions
diff --git a/res/drawable/preference_list_fragment_background.xml b/res/drawable/preference_background.xml index 94e0381..f47bcf5 100644 --- a/res/drawable/preference_list_fragment_background.xml +++ b/res/drawable/preference_background.xml @@ -21,9 +21,7 @@ android:insetBottom="0dip"> <shape android:shape="rectangle"> - - <solid android:color="@color/preference_list_fragment_background_color" /> - + <solid android:color="@color/preference_background_color" /> </shape> </inset> diff --git a/res/layout/preference_list_fragment.xml b/res/layout/preference_list_fragment.xml index a97415e..8391641 100644 --- a/res/layout/preference_list_fragment.xml +++ b/res/layout/preference_list_fragment.xml @@ -36,8 +36,6 @@ android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle" android:clipToPadding="false" android:drawSelectorOnTop="false" - android:cacheColorHint="@android:color/white" - android:background="@drawable/preference_list_fragment_background" android:elevation="@dimen/dashboard_category_elevation" android:scrollbarAlwaysDrawVerticalTrack="true" /> @@ -82,6 +80,8 @@ android:text="@*android:string/next_button_label" /> </LinearLayout> + </RelativeLayout> + </LinearLayout> diff --git a/res/layout/settings_main_dashboard.xml b/res/layout/settings_main_dashboard.xml new file mode 100644 index 0000000..56f2737 --- /dev/null +++ b/res/layout/settings_main_dashboard.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2014, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/main_content" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:background="@color/dashboard_background_color" + /> diff --git a/res/layout/settings_main.xml b/res/layout/settings_main_prefs.xml index 56737a1..53fd918 100644 --- a/res/layout/settings_main.xml +++ b/res/layout/settings_main_prefs.xml @@ -20,8 +20,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_height="match_parent" - android:layout_width="match_parent" - android:background="?attr/dashboardBackgroundColor"> + android:layout_width="match_parent"> <LinearLayout android:orientation="vertical" @@ -37,9 +36,10 @@ /> <FrameLayout - android:id="@+id/prefs" + android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="?attr/preferenceBackgroundColor" /> </LinearLayout> diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 71e08d8..2987de1 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -101,5 +101,5 @@ <attr name="switchBarMarginStart" format="dimension" /> <attr name="switchBarMarginEnd" format="dimension" /> - <attr name="dashboardBackgroundColor" format="color" /> + <attr name="preferenceBackgroundColor" format="color" /> </resources> diff --git a/res/values/colors.xml b/res/values/colors.xml index 0b3ea39..e34097b 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -60,6 +60,6 @@ <color name="switch_accent_color">#ff7fcac3</color> <color name="default_preference_background_color">@android:color/white</color> - <color name="preference_list_fragment_background_color">@color/default_preference_background_color</color> + <color name="preference_background_color">@color/default_preference_background_color</color> <color name="search_panel_list_background_color">@color/default_preference_background_color</color> </resources> diff --git a/res/values/themes.xml b/res/values/themes.xml index 92bb3b2..4f8add7 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -33,7 +33,7 @@ <item name="ic_wps">@drawable/ic_wps_dark</item> <item name="setup_divider_color">@color/setup_divider_color_dark</item> <item name="wifi_signal">@drawable/wifi_signal_dark</item> - <item name="dashboardBackgroundColor">@color/dashboard_background_color</item> + <item name="preferenceBackgroundColor">@drawable/preference_background</item> </style> <style name="SetupWizardWifiTheme.Light" parent="android:Theme.Material.Light.NoActionBar"> @@ -48,7 +48,7 @@ <item name="ic_wps">@drawable/ic_wps_light</item> <item name="setup_divider_color">@color/setup_divider_color_light</item> <item name="wifi_signal">@drawable/wifi_signal_light</item> - <item name="dashboardBackgroundColor">@color/dashboard_background_color</item> + <item name="preferenceBackgroundColor">@drawable/preference_background</item> </style> <style name="Theme.WifiDialog" parent="@*android:style/Theme.Material.Dialog.Alert"> @@ -92,7 +92,7 @@ <item name="switchBarTheme">@style/Theme.SwitchBar.Settings</item> - <item name="dashboardBackgroundColor">@color/dashboard_background_color</item> + <item name="preferenceBackgroundColor">@drawable/preference_background</item> <!-- Redefine the ActionBar style for contentInsetStart --> <item name="android:actionBarStyle">@style/Theme.ActionBar</item> @@ -142,7 +142,7 @@ <!-- Redefine the ActionBar style for contentInsetStart --> <item name="android:actionBarStyle">@style/Theme.ActionBar</item> - <item name="dashboardBackgroundColor">@color/dashboard_background_color</item> + <item name="preferenceBackgroundColor">@drawable/preference_background</item> </style> <style name="Theme.CryptKeeper" parent="@android:style/Theme.Material.Light.NoActionBar"> @@ -156,7 +156,7 @@ <item name="android:actionBarWidgetTheme">@null</item> <item name="android:actionBarTheme">@android:style/ThemeOverlay.Material.Dark.ActionBar</item> - <item name="dashboardBackgroundColor">@color/dashboard_background_color</item> + <item name="preferenceBackgroundColor">@drawable/preference_background</item> </style> <style name="Theme.AlertDialog" parent="@*android:style/Theme.Material.Light.Dialog.Alert"> @@ -177,7 +177,7 @@ <item name="switchBarMarginStart">0dip</item> <item name="switchBarMarginEnd">0dip</item> - <item name="dashboardBackgroundColor">@android:color/transparent</item> + <item name="preferenceBackgroundColor">@android:color/transparent</item> </style> </resources> |