Merge "Add activated text colors, update Material preference header" into lmp-dev
diff --git a/core/res/res/color/primary_text_activated_material_dark.xml b/core/res/res/color/primary_text_activated_material_dark.xml
new file mode 100644
index 0000000..f1b742a
--- /dev/null
+++ b/core/res/res/color/primary_text_activated_material_dark.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_activated="true"
+ android:color="@color/primary_text_default_material_light"/>
+ <item android:color="@color/primary_text_default_material_dark"/>
+</selector>
diff --git a/core/res/res/color/primary_text_activated_material_light.xml b/core/res/res/color/primary_text_activated_material_light.xml
new file mode 100644
index 0000000..d92da63
--- /dev/null
+++ b/core/res/res/color/primary_text_activated_material_light.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_activated="true"
+ android:color="@color/primary_text_default_material_dark"/>
+ <item android:color="@color/primary_text_default_material_light"/>
+</selector>
diff --git a/core/res/res/color/secondary_text_activated_material_dark.xml b/core/res/res/color/secondary_text_activated_material_dark.xml
new file mode 100644
index 0000000..7a8428a
--- /dev/null
+++ b/core/res/res/color/secondary_text_activated_material_dark.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_activated="true"
+ android:color="@color/secondary_text_default_material_light"/>
+ <item android:color="@color/secondary_text_default_material_dark"/>
+</selector>
diff --git a/core/res/res/color/secondary_text_activated_material_light.xml b/core/res/res/color/secondary_text_activated_material_light.xml
new file mode 100644
index 0000000..36ff408
--- /dev/null
+++ b/core/res/res/color/secondary_text_activated_material_light.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_activated="true"
+ android:color="@color/secondary_text_default_material_dark"/>
+ <item android:color="@color/secondary_text_default_material_light"/>
+</selector>
diff --git a/core/res/res/layout/preference_header_item_material.xml b/core/res/res/layout/preference_header_item_material.xml
index 88e1cb2..ffb18ae 100644
--- a/core/res/res/layout/preference_header_item_material.xml
+++ b/core/res/res/layout/preference_header_item_material.xml
@@ -46,6 +46,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItem"
+ android:textColor="?android:attr/textColorPrimaryActivated"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
@@ -55,6 +56,7 @@
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
+ android:textColor="?android:attr/textColorSecondaryActivated"
android:ellipsize="end"
android:maxLines="2" />
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 719adca..251652e 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -110,6 +110,11 @@
<!-- Dim inverse text color. This does not differentiate the disabled state. -->
<attr name="textColorSecondaryInverseNoDisable" format="reference|color" />
+ <!-- Bright text color for use over activated backgrounds. -->
+ <attr name="textColorPrimaryActivated" format="reference|color" />
+ <!-- Dim text color for use over activated backgrounds. -->
+ <attr name="textColorSecondaryActivated" format="reference|color" />
+
<!-- Text color for urls in search suggestions, used by things like global search and the browser. @hide -->
<attr name="textColorSearchUrl" format="reference|color" />
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 7a9e1d5..d983440 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -74,6 +74,8 @@
<item name="textColorPrimaryInverse">@color/primary_text_light</item>
<item name="textColorSecondaryInverse">@color/secondary_text_light</item>
<item name="textColorTertiaryInverse">@color/tertiary_text_light</item>
+ <item name="textColorPrimaryActivated">@color/primary_text_dark</item>
+ <item name="textColorSecondaryActivated">@color/secondary_text_dark</item>
<item name="textColorPrimaryDisableOnly">@color/primary_text_dark_disable_only</item>
<item name="textColorPrimaryInverseDisableOnly">@color/primary_text_light_disable_only</item>
<item name="textColorPrimaryNoDisable">@color/primary_text_dark_nodisable</item>
@@ -478,6 +480,8 @@
<item name="textColorPrimaryInverse">@color/primary_text_dark</item>
<item name="textColorSecondaryInverse">@color/secondary_text_dark</item>
<item name="textColorTertiaryInverse">@color/tertiary_text_dark</item>
+ <item name="textColorPrimaryActivated">@color/primary_text_light</item>
+ <item name="textColorSecondaryActivated">@color/secondary_text_light</item>
<item name="textColorPrimaryDisableOnly">@color/primary_text_light_disable_only</item>
<item name="textColorPrimaryInverseDisableOnly">@color/primary_text_dark_disable_only</item>
<item name="textColorPrimaryNoDisable">@color/primary_text_light_nodisable</item>
diff --git a/core/res/res/values/themes_holo.xml b/core/res/res/values/themes_holo.xml
index 9c1d0f3..c30b3d5 100644
--- a/core/res/res/values/themes_holo.xml
+++ b/core/res/res/values/themes_holo.xml
@@ -93,6 +93,8 @@
<item name="textColorPrimaryInverse">@color/primary_text_holo_light</item>
<item name="textColorSecondaryInverse">@color/secondary_text_holo_light</item>
<item name="textColorTertiaryInverse">@color/tertiary_text_holo_light</item>
+ <item name="textColorPrimaryActivated">@color/primary_text_holo_dark</item>
+ <item name="textColorSecondaryActivated">@color/secondary_text_holo_dark</item>
<item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_holo_dark</item>
<item name="textColorPrimaryInverseDisableOnly">@color/primary_text_disable_only_holo_light</item>
<item name="textColorPrimaryNoDisable">@color/primary_text_nodisable_holo_dark</item>
@@ -429,6 +431,8 @@
<item name="textColorPrimaryInverse">@color/primary_text_holo_dark</item>
<item name="textColorSecondaryInverse">@color/secondary_text_holo_dark</item>
<item name="textColorTertiaryInverse">@color/tertiary_text_holo_dark</item>
+ <item name="textColorPrimaryActivated">@color/primary_text_holo_light</item>
+ <item name="textColorSecondaryActivated">@color/secondary_text_holo_light</item>
<item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_holo_light</item>
<item name="textColorPrimaryInverseDisableOnly">@color/primary_text_disable_only_holo_dark</item>
<item name="textColorPrimaryNoDisable">@color/primary_text_nodisable_holo_light</item>
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index 6420153..b51974e 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -55,9 +55,11 @@
<item name="textColorPrimary">@color/primary_text_material_dark</item>
<item name="textColorPrimaryInverse">@color/primary_text_material_light</item>
+ <item name="textColorPrimaryActivated">@color/primary_text_activated_material_dark</item>
<item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_material_dark</item>
<item name="textColorSecondary">@color/secondary_text_material_dark</item>
<item name="textColorSecondaryInverse">@color/secondary_text_material_light</item>
+ <item name="textColorSecondaryActivated">@color/secondary_text_activated_material_dark</item>
<item name="textColorTertiary">@color/secondary_text_material_dark</item>
<item name="textColorTertiaryInverse">@color/secondary_text_material_light</item>
<item name="textColorHint">@color/hint_foreground_material_dark</item>
@@ -402,8 +404,10 @@
<item name="textColorPrimary">@color/primary_text_material_light</item>
<item name="textColorPrimaryInverse">@color/primary_text_material_dark</item>
+ <item name="textColorPrimaryActivated">@color/primary_text_activated_material_light</item>
<item name="textColorSecondary">@color/secondary_text_material_light</item>
<item name="textColorSecondaryInverse">@color/secondary_text_material_dark</item>
+ <item name="textColorSecondaryActivated">@color/secondary_text_activated_material_light</item>
<item name="textColorTertiary">@color/secondary_text_material_light</item>
<item name="textColorTertiaryInverse">@color/secondary_text_material_dark</item>
<item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_material_light</item>
@@ -757,8 +761,10 @@
<item name="textColorPrimary">@color/primary_text_material_light</item>
<item name="textColorPrimaryInverse">@color/primary_text_material_dark</item>
+ <item name="textColorPrimaryActivated">@color/primary_text_activated_material_light</item>
<item name="textColorSecondary">@color/secondary_text_material_light</item>
<item name="textColorSecondaryInverse">@color/secondary_text_material_dark</item>
+ <item name="textColorSecondaryActivated">@color/secondary_text_activated_material_light</item>
<item name="textColorTertiary">@color/secondary_text_material_light</item>
<item name="textColorTertiaryInverse">@color/secondary_text_material_dark</item>
<item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_material_light</item>
@@ -794,9 +800,11 @@
<item name="textColorPrimary">@color/primary_text_material_dark</item>
<item name="textColorPrimaryInverse">@color/primary_text_material_light</item>
+ <item name="textColorPrimaryActivated">@color/primary_text_activated_material_dark</item>
<item name="textColorPrimaryDisableOnly">@color/primary_text_disable_only_material_dark</item>
<item name="textColorSecondary">@color/secondary_text_material_dark</item>
<item name="textColorSecondaryInverse">@color/secondary_text_material_light</item>
+ <item name="textColorSecondaryActivated">@color/secondary_text_activated_material_dark</item>
<item name="textColorTertiary">@color/secondary_text_material_dark</item>
<item name="textColorTertiaryInverse">@color/secondary_text_material_light</item>
<item name="textColorHint">@color/hint_foreground_material_dark</item>