Use android: namespaced attributes in themes
The preference inflater prefers app: namespaced attributes, so
using those in the theme would cause them to override android:
namespaced ones defined in the preference XML. Instead we should
use the android: ones in the theme so both the android: and app:
namespaced attributes in XML will override them as expected.
b/23939156
Change-Id: I112b522b9bf33dd44c081d6299dc36d9330d7828
diff --git a/v14/preference/res/values/styles.xml b/v14/preference/res/values/styles.xml
index daf683c..863d81d 100644
--- a/v14/preference/res/values/styles.xml
+++ b/v14/preference/res/values/styles.xml
@@ -17,47 +17,47 @@
<resources>
<style name="Preference.SwitchPreference">
- <item name="widgetLayout">@layout/preference_widget_switch</item>
- <item name="switchTextOn">@string/v7_preference_on</item>
- <item name="switchTextOff">@string/v7_preference_off</item>
+ <item name="android:widgetLayout">@layout/preference_widget_switch</item>
+ <item name="android:switchTextOn">@string/v7_preference_on</item>
+ <item name="android:switchTextOff">@string/v7_preference_off</item>
</style>
<style name="Preference.Material">
- <item name="layout">@layout/preference_material</item>
+ <item name="android:layout">@layout/preference_material</item>
</style>
<style name="Preference.Information.Material">
- <item name="layout">@layout/preference_information_material</item>
- <item name="enabled">false</item>
- <item name="shouldDisableView">false</item>
+ <item name="android:layout">@layout/preference_information_material</item>
+ <item name="android:enabled">false</item>
+ <item name="android:shouldDisableView">false</item>
</style>
<style name="Preference.Category.Material">
- <item name="layout">@layout/preference_category_material</item>
+ <item name="android:layout">@layout/preference_category_material</item>
</style>
<style name="Preference.CheckBoxPreference.Material">
- <item name="layout">@layout/preference_material</item>
+ <item name="android:layout">@layout/preference_material</item>
</style>
<style name="Preference.SwitchPreferenceCompat.Material">
- <item name="layout">@layout/preference_material</item>
+ <item name="android:layout">@layout/preference_material</item>
</style>
<style name="Preference.SwitchPreference.Material">
- <item name="layout">@layout/preference_material</item>
+ <item name="android:layout">@layout/preference_material</item>
</style>
<style name="Preference.PreferenceScreen.Material">
- <item name="layout">@layout/preference_material</item>
+ <item name="android:layout">@layout/preference_material</item>
</style>
<style name="Preference.DialogPreference.Material">
- <item name="layout">@layout/preference_material</item>
+ <item name="android:layout">@layout/preference_material</item>
</style>
<style name="Preference.DialogPreference.EditTextPreference.Material">
- <item name="layout">@layout/preference_material</item>
+ <item name="android:layout">@layout/preference_material</item>
</style>
<style name="Preference_TextAppearanceMaterialBody2">
diff --git a/v17/preference-leanback/res/values/styles.xml b/v17/preference-leanback/res/values/styles.xml
index 0b315a8..56554a4 100644
--- a/v17/preference-leanback/res/values/styles.xml
+++ b/v17/preference-leanback/res/values/styles.xml
@@ -18,48 +18,48 @@
<resources>
<style name="LeanbackPreference">
- <item name="layout">@layout/leanback_preference</item>
+ <item name="android:layout">@layout/leanback_preference</item>
</style>
<style name="LeanbackPreference.Information">
- <item name="layout">@layout/leanback_preference_information</item>
- <item name="enabled">false</item>
- <item name="shouldDisableView">false</item>
+ <item name="android:layout">@layout/leanback_preference_information</item>
+ <item name="android:enabled">false</item>
+ <item name="android:shouldDisableView">false</item>
</style>
<style name="LeanbackPreference.Category">
- <item name="layout">@layout/leanback_preference_category</item>
+ <item name="android:layout">@layout/leanback_preference_category</item>
<!-- The title should not dim if the category is disabled, instead only the preference children should dim. -->
- <item name="shouldDisableView">false</item>
- <item name="selectable">false</item>
+ <item name="android:shouldDisableView">false</item>
+ <item name="android:selectable">false</item>
</style>
<style name="LeanbackPreference.CheckBoxPreference">
- <item name="widgetLayout">@layout/preference_widget_checkbox</item>
+ <item name="android:widgetLayout">@layout/preference_widget_checkbox</item>
</style>
<style name="LeanbackPreference.SwitchPreferenceCompat">
- <item name="widgetLayout">@layout/preference_widget_switch_compat</item>
- <item name="switchTextOn">@string/v7_preference_on</item>
- <item name="switchTextOff">@string/v7_preference_off</item>
+ <item name="android:widgetLayout">@layout/preference_widget_switch_compat</item>
+ <item name="android:switchTextOn">@string/v7_preference_on</item>
+ <item name="android:switchTextOff">@string/v7_preference_off</item>
</style>
<style name="LeanbackPreference.SwitchPreference">
- <item name="widgetLayout">@layout/preference_widget_switch</item>
- <item name="switchTextOn">@string/v7_preference_on</item>
- <item name="switchTextOff">@string/v7_preference_off</item>
+ <item name="android:widgetLayout">@layout/preference_widget_switch</item>
+ <item name="android:switchTextOn">@string/v7_preference_on</item>
+ <item name="android:switchTextOff">@string/v7_preference_off</item>
</style>
<style name="LeanbackPreference.PreferenceScreen">
</style>
<style name="LeanbackPreference.DialogPreference">
- <item name="positiveButtonText">@android:string/ok</item>
- <item name="negativeButtonText">@android:string/cancel</item>
+ <item name="android:positiveButtonText">@android:string/ok</item>
+ <item name="android:negativeButtonText">@android:string/cancel</item>
</style>
<style name="LeanbackPreference.DialogPreference.EditTextPreference">
- <item name="dialogLayout">@layout/preference_dialog_edittext</item>
+ <item name="android:dialogLayout">@layout/preference_dialog_edittext</item>
</style>
</resources>
diff --git a/v7/preference/res/values/styles.xml b/v7/preference/res/values/styles.xml
index 3af31a4..4f34f1b 100644
--- a/v7/preference/res/values/styles.xml
+++ b/v7/preference/res/values/styles.xml
@@ -17,7 +17,7 @@
<resources>
<style name="Preference">
- <item name="layout">@layout/preference</item>
+ <item name="android:layout">@layout/preference</item>
</style>
<style name="PreferenceFragment">
@@ -26,38 +26,38 @@
</style>
<style name="Preference.Information">
- <item name="layout">@layout/preference_information</item>
- <item name="enabled">false</item>
- <item name="shouldDisableView">false</item>
+ <item name="android:layout">@layout/preference_information</item>
+ <item name="android:enabled">false</item>
+ <item name="android:shouldDisableView">false</item>
</style>
<style name="Preference.Category">
- <item name="layout">@layout/preference_category</item>
+ <item name="android:layout">@layout/preference_category</item>
<!-- The title should not dim if the category is disabled, instead only the preference children should dim. -->
- <item name="shouldDisableView">false</item>
- <item name="selectable">false</item>
+ <item name="android:shouldDisableView">false</item>
+ <item name="android:selectable">false</item>
</style>
<style name="Preference.CheckBoxPreference">
- <item name="widgetLayout">@layout/preference_widget_checkbox</item>
+ <item name="android:widgetLayout">@layout/preference_widget_checkbox</item>
</style>
<style name="Preference.SwitchPreferenceCompat">
- <item name="widgetLayout">@layout/preference_widget_switch_compat</item>
- <item name="switchTextOn">@string/v7_preference_on</item>
- <item name="switchTextOff">@string/v7_preference_off</item>
+ <item name="android:widgetLayout">@layout/preference_widget_switch_compat</item>
+ <item name="android:switchTextOn">@string/v7_preference_on</item>
+ <item name="android:switchTextOff">@string/v7_preference_off</item>
</style>
<style name="Preference.PreferenceScreen">
</style>
<style name="Preference.DialogPreference">
- <item name="positiveButtonText">@android:string/ok</item>
- <item name="negativeButtonText">@android:string/cancel</item>
+ <item name="android:positiveButtonText">@android:string/ok</item>
+ <item name="android:negativeButtonText">@android:string/cancel</item>
</style>
<style name="Preference.DialogPreference.EditTextPreference">
- <item name="dialogLayout">@layout/preference_dialog_edittext</item>
+ <item name="android:dialogLayout">@layout/preference_dialog_edittext</item>
</style>
<style name="PreferenceFragmentList">