summaryrefslogtreecommitdiffstats
path: root/core/res
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-05-21 18:10:53 -0700
committerAlan Viverette <alanv@google.com>2014-05-21 18:10:53 -0700
commit0a1c6f021be032f5aecb341c2794efb06c0a8a0d (patch)
tree82a605f2da8c3fcd0d1221b60445e9207e81bd10 /core/res
parentc106c12e566d48e81a0ad0bf7ee614c50c6aef39 (diff)
downloadframeworks_base-0a1c6f021be032f5aecb341c2794efb06c0a8a0d.zip
frameworks_base-0a1c6f021be032f5aecb341c2794efb06c0a8a0d.tar.gz
frameworks_base-0a1c6f021be032f5aecb341c2794efb06c0a8a0d.tar.bz2
Style and asset cleanup
Updates button drawable and colors, cleans up Quantum styles, updates highlight attribute name and color, fixes popup backgrounds. Also fixes GradientDrawable opacity check. Change-Id: I75dd35e815a8a33ec9f0b16e881e774edfb8c092
Diffstat (limited to 'core/res')
-rw-r--r--core/res/res/color/btn_default_quantum_dark.xml20
-rw-r--r--core/res/res/color/btn_default_quantum_light.xml20
-rw-r--r--core/res/res/drawable/btn_borderless_quantum.xml21
-rw-r--r--core/res/res/drawable/btn_cab_done_quantum.xml4
-rw-r--r--core/res/res/drawable/btn_default_quantum.xml30
-rw-r--r--core/res/res/drawable/item_background_quantum.xml2
-rw-r--r--core/res/res/drawable/list_selector_quantum.xml2
-rw-r--r--core/res/res/values/attrs.xml6
-rw-r--r--core/res/res/values/public.xml2
-rw-r--r--core/res/res/values/styles_quantum.xml57
-rw-r--r--core/res/res/values/themes.xml8
-rw-r--r--core/res/res/values/themes_quantum.xml12
12 files changed, 107 insertions, 77 deletions
diff --git a/core/res/res/color/btn_default_quantum_dark.xml b/core/res/res/color/btn_default_quantum_dark.xml
new file mode 100644
index 0000000..f2e772d
--- /dev/null
+++ b/core/res/res/color/btn_default_quantum_dark.xml
@@ -0,0 +1,20 @@
+<?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_enabled="false" android:alpha="0.5" android:color="@color/quantum_grey_700"/>
+ <item android:color="@color/quantum_grey_700"/>
+</selector>
diff --git a/core/res/res/color/btn_default_quantum_light.xml b/core/res/res/color/btn_default_quantum_light.xml
new file mode 100644
index 0000000..de1bd2c
--- /dev/null
+++ b/core/res/res/color/btn_default_quantum_light.xml
@@ -0,0 +1,20 @@
+<?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_enabled="false" android:alpha="0.5" android:color="@color/quantum_grey_300"/>
+ <item android:color="@color/quantum_grey_300"/>
+</selector>
diff --git a/core/res/res/drawable/btn_borderless_quantum.xml b/core/res/res/drawable/btn_borderless_quantum.xml
index eaf2550..a8def44 100644
--- a/core/res/res/drawable/btn_borderless_quantum.xml
+++ b/core/res/res/drawable/btn_borderless_quantum.xml
@@ -15,7 +15,22 @@
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="?attr/colorButtonPressed">
- <item android:id="@id/mask"
- android:drawable="@drawable/btn_qntm_alpha" />
+ android:tint="?attr/colorControlHighlight">
+ <item android:id="@id/mask">
+ <inset
+ android:insetLeft="4dp"
+ android:insetTop="4dp"
+ android:insetBottom="4dp"
+ android:insetRight="4dp">
+ <shape android:shape="rectangle">
+ <solid android:color="@color/white" />
+ <corners android:radius="2dp" />
+ <padding
+ android:left="4dp"
+ android:top="4dp"
+ android:bottom="4dp"
+ android:right="4dp" />
+ </shape>
+ </inset>
+ </item>
</ripple>
diff --git a/core/res/res/drawable/btn_cab_done_quantum.xml b/core/res/res/drawable/btn_cab_done_quantum.xml
index c03ab0a..51e06bb 100644
--- a/core/res/res/drawable/btn_cab_done_quantum.xml
+++ b/core/res/res/drawable/btn_cab_done_quantum.xml
@@ -18,11 +18,11 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:autoMirrored="true">
<item android:state_pressed="true">
- <color android:color="?attr/colorButtonPressed" />
+ <color android:color="?attr/colorControlHighlight" />
</item>
<item android:state_focused="true" android:state_enabled="true">
<nine-patch android:src="@drawable/btn_cab_done_qntm_alpha"
- android:tint="?attr/colorButtonPressed" />
+ android:tint="?attr/colorControlHighlight" />
</item>
<item android:state_enabled="true">
<nine-patch android:src="@drawable/btn_cab_done_qntm_alpha"
diff --git a/core/res/res/drawable/btn_default_quantum.xml b/core/res/res/drawable/btn_default_quantum.xml
index d8ab667..63473a4 100644
--- a/core/res/res/drawable/btn_default_quantum.xml
+++ b/core/res/res/drawable/btn_default_quantum.xml
@@ -15,20 +15,22 @@
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="?attr/colorButtonPressed">
+ android:tint="?attr/colorControlHighlight">
<item>
- <selector>
- <item android:state_enabled="false">
- <nine-patch
- android:src="@drawable/btn_qntm_alpha"
- android:tint="?attr/colorButtonNormal"
- android:alpha="?attr/disabledAlpha" />
- </item>
- <item>
- <nine-patch
- android:src="@drawable/btn_qntm_alpha"
- android:tint="?attr/colorButtonNormal" />
- </item>
- </selector>
+ <inset
+ android:insetLeft="4dp"
+ android:insetTop="4dp"
+ android:insetBottom="4dp"
+ android:insetRight="4dp">
+ <shape android:shape="rectangle">
+ <solid android:color="?attr/colorButtonNormal" />
+ <corners android:radius="2dp" />
+ <padding
+ android:left="4dp"
+ android:top="4dp"
+ android:bottom="4dp"
+ android:right="4dp" />
+ </shape>
+ </inset>
</item>
</ripple>
diff --git a/core/res/res/drawable/item_background_quantum.xml b/core/res/res/drawable/item_background_quantum.xml
index 631d3e4..c2a1c127 100644
--- a/core/res/res/drawable/item_background_quantum.xml
+++ b/core/res/res/drawable/item_background_quantum.xml
@@ -15,5 +15,5 @@
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="?attr/colorButtonPressed"
+ android:tint="?attr/colorControlHighlight"
android:pinned="true" />
diff --git a/core/res/res/drawable/list_selector_quantum.xml b/core/res/res/drawable/list_selector_quantum.xml
index 0e185aa..6cd59e5 100644
--- a/core/res/res/drawable/list_selector_quantum.xml
+++ b/core/res/res/drawable/list_selector_quantum.xml
@@ -15,7 +15,7 @@
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="?attr/colorButtonPressed">
+ android:tint="?attr/colorControlHighlight">
<item android:id="@id/mask">
<color android:color="@color/white" />
</item>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index fd81362..c05dfca 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -975,11 +975,11 @@
<!-- The color applied to framework controls in their activated (ex. checked) state. -->
<attr name="colorControlActivated" format="color" />
+ <!-- The color applied to framework control highlights (ex. ripples, selection). -->
+ <attr name="colorControlHighlight" format="color" />
+
<!-- The color applied to framework buttons in their normal state. -->
<attr name="colorButtonNormal" format="color" />
-
- <!-- The color applied to framework buttons in their pressed state. -->
- <attr name="colorButtonPressed" format="color" />
</declare-styleable>
<!-- **************************************************************** -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 32ce568..ce0d2d5 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2134,7 +2134,7 @@
<public type="attr" name="colorControlNormal" />
<public type="attr" name="colorControlActivated" />
<public type="attr" name="colorButtonNormal" />
- <public type="attr" name="colorButtonPressed" />
+ <public type="attr" name="colorControlHighlight" />
<public type="attr" name="persistable" />
<public type="attr" name="titleTextAppearance" />
<public type="attr" name="subtitleTextAppearance" />
diff --git a/core/res/res/values/styles_quantum.xml b/core/res/res/values/styles_quantum.xml
index d04bddf..e714e12 100644
--- a/core/res/res/values/styles_quantum.xml
+++ b/core/res/res/values/styles_quantum.xml
@@ -364,6 +364,7 @@ please see styles_device_defaults.xml.
<item name="textColor">?attr/textColorPrimary</item>
<item name="minHeight">48dip</item>
<item name="minWidth">96dip</item>
+ <item name="elevation">2dip</item>
<item name="stateListAnimator">@anim/button_state_list_anim_quantum</item>
</style>
@@ -437,7 +438,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.AutoCompleteTextView" parent="Widget.AutoCompleteTextView">
<item name="dropDownSelector">@drawable/list_selector_quantum</item>
- <item name="popupBackground">?attr/colorBackground</item>
+ <item name="popupBackground">@drawable/popup_background_quantum</item>
</style>
<style name="Widget.Quantum.CompoundButton" parent="Widget.CompoundButton"/>
@@ -528,7 +529,10 @@ please see styles_device_defaults.xml.
<item name="calendarViewShown">true</item>
</style>
- <style name="Widget.Quantum.ActivityChooserView" parent="Widget.ActivityChooserView"/>
+ <style name="Widget.Quantum.ActivityChooserView" parent="Widget.ActivityChooserView">
+ <item name="background">@drawable/ab_share_pack_quantum</item>
+ </style>
+
<style name="Widget.Quantum.ImageWell" parent="Widget.ImageWell"/>
<style name="Widget.Quantum.ListView" parent="Widget.ListView">
@@ -610,7 +614,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Spinner" parent="Widget.Spinner.DropDown">
<item name="background">@drawable/spinner_background_quantum</item>
<item name="dropDownSelector">@drawable/list_selector_quantum</item>
- <item name="popupBackground">?attr/colorBackground</item>
+ <item name="popupBackground">@drawable/popup_background_quantum</item>
<item name="dropDownVerticalOffset">0dip</item>
<item name="dropDownHorizontalOffset">0dip</item>
<item name="dropDownWidth">wrap_content</item>
@@ -805,21 +809,12 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Light.TextSelectHandle" parent="Widget.Quantum.TextSelectHandle"/>
<style name="Widget.Quantum.Light.TextSuggestionsPopupWindow" parent="Widget.Quantum.TextSuggestionsPopupWindow"/>
<style name="Widget.Quantum.Light.AbsListView" parent="Widget.Quantum.AbsListView"/>
-
- <style name="Widget.Quantum.Light.AutoCompleteTextView" parent="Widget.AutoCompleteTextView">
- <item name="dropDownSelector">@drawable/list_selector_quantum</item>
- <item name="popupBackground">?attr/colorBackground</item>
- </style>
-
+ <style name="Widget.Quantum.Light.AutoCompleteTextView" parent="Widget.Quantum.AutoCompleteTextView" />
<style name="Widget.Quantum.Light.CompoundButton" parent="Widget.Quantum.CompoundButton"/>
<style name="Widget.Quantum.Light.CompoundButton.CheckBox" parent="Widget.Quantum.CompoundButton.CheckBox"/>
<style name="Widget.Quantum.Light.CompoundButton.RadioButton" parent="Widget.Quantum.CompoundButton.RadioButton"/>
<style name="Widget.Quantum.Light.CompoundButton.Star" parent="Widget.Quantum.CompoundButton.Star"/>
-
- <style name="Widget.Quantum.Light.CompoundButton.Switch" parent="Widget.Quantum.CompoundButton.Switch">
- <item name="switchTextAppearance">@style/TextAppearance.Quantum.Widget.Switch</item>
- </style>
-
+ <style name="Widget.Quantum.Light.CompoundButton.Switch" parent="Widget.Quantum.CompoundButton.Switch" />
<style name="Widget.Quantum.Light.ListView.DropDown" parent="Widget.Quantum.ListView.DropDown"/>
<style name="Widget.Quantum.Light.EditText" parent="Widget.Quantum.EditText"/>
<style name="Widget.Quantum.Light.ExpandableListView" parent="Widget.Quantum.ExpandableListView"/>
@@ -847,11 +842,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.Light.DatePicker" parent="Widget.Quantum.DatePicker"/>
-
- <style name="Widget.Quantum.Light.ActivityChooserView" parent="Widget.Quantum.ActivityChooserView">
- <item name="background">@drawable/ab_share_pack_quantum</item>
- </style>
-
+ <style name="Widget.Quantum.Light.ActivityChooserView" parent="Widget.Quantum.ActivityChooserView" />
<style name="Widget.Quantum.Light.ImageWell" parent="Widget.Quantum.ImageWell"/>
<style name="Widget.Quantum.Light.ListView" parent="Widget.Quantum.ListView"/>
<style name="Widget.Quantum.Light.ListView.White" parent="Widget.Quantum.ListView.White"/>
@@ -890,17 +881,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Light.ScrollView" parent="Widget.Quantum.ScrollView"/>
<style name="Widget.Quantum.Light.HorizontalScrollView" parent="Widget.Quantum.HorizontalScrollView"/>
-
- <style name="Widget.Quantum.Light.Spinner" parent="Widget.Quantum.Spinner">
- <item name="background">@drawable/spinner_background_quantum</item>
- <item name="dropDownSelector">@drawable/list_selector_quantum</item>
- <item name="popupBackground">?attr/colorBackground</item>
- <item name="dropDownVerticalOffset">0dip</item>
- <item name="dropDownHorizontalOffset">0dip</item>
- <item name="dropDownWidth">wrap_content</item>
- <item name="popupPromptView">@layout/simple_dropdown_hint</item>
- </style>
-
+ <style name="Widget.Quantum.Light.Spinner" parent="Widget.Quantum.Spinner" />
<style name="Widget.Quantum.Light.Spinner.DropDown" parent="Widget.Quantum.Spinner.DropDown"/>
<style name="Widget.Quantum.Light.Spinner.DropDown.ActionBar" parent="Widget.Quantum.Spinner.DropDown.ActionBar"/>
<style name="Widget.Quantum.Light.TabWidget" parent="Widget.Quantum.TabWidget"/>
@@ -924,15 +905,8 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Light.ActionBar.TabView" parent="Widget.Quantum.ActionBar.TabView"/>
<style name="Widget.Quantum.Light.ActionBar.TabBar" parent="Widget.Quantum.ActionBar.TabBar"/>
<style name="Widget.Quantum.Light.ActionBar.TabText" parent="Widget.Quantum.ActionBar.TabText"/>
-
- <style name="Widget.Quantum.Light.ActionMode" parent="Widget.Quantum.ActionMode">
- <item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Title</item>
- <item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Subtitle</item>
- </style>
-
- <style name="Widget.Quantum.Light.ActionButton.CloseMode">
- <item name="background">@drawable/btn_cab_done_quantum</item>
- </style>
+ <style name="Widget.Quantum.Light.ActionMode" parent="Widget.Quantum.ActionMode" />
+ <style name="Widget.Quantum.Light.ActionButton.CloseMode" parent="Widget.Quantum.ActionButton.CloseMode" />
<style name="Widget.Quantum.Light.ActionBar" parent="Widget.Quantum.ActionBar">
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
@@ -952,10 +926,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.Light.FastScroll" parent="Widget.Quantum.FastScroll"/>
-
- <style name="Widget.Quantum.Light.MediaRouteButton" parent="Widget.Quantum.MediaRouteButton">
- <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_quantum</item>
- </style>
+ <style name="Widget.Quantum.Light.MediaRouteButton" parent="Widget.Quantum.MediaRouteButton" />
<!-- Animation Styles -->
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 743ad61..aaab949 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -58,7 +58,7 @@ please see themes_device_defaults.xml.
<item name="colorPrimaryLight">@color/legacy_primary_light</item>
<item name="colorControlActivated">@color/legacy_control_activated</item>
<item name="colorControlNormal">@color/legacy_control_normal</item>
- <item name="colorButtonPressed">@color/legacy_button_pressed</item>
+ <item name="colorControlHighlight">@color/legacy_button_pressed</item>
<item name="colorButtonNormal">@color/legacy_button_normal</item>
<item name="disabledAlpha">0.5</item>
@@ -455,7 +455,7 @@ please see themes_device_defaults.xml.
<item name="colorPrimaryLight">@color/legacy_light_primary_light</item>
<item name="colorControlActivated">@color/legacy_light_control_activated</item>
<item name="colorControlNormal">@color/legacy_light_control_normal</item>
- <item name="colorButtonPressed">@color/legacy_light_button_pressed</item>
+ <item name="colorControlHighlight">@color/legacy_light_button_pressed</item>
<item name="colorButtonNormal">@color/legacy_light_button_normal</item>
<item name="textColorPrimary">@android:color/primary_text_light</item>
@@ -970,7 +970,7 @@ please see themes_device_defaults.xml.
<item name="colorPrimaryLight">@color/holo_primary_light</item>
<item name="colorControlActivated">@color/holo_control_activated</item>
<item name="colorControlNormal">@color/holo_control_normal</item>
- <item name="colorButtonPressed">@color/holo_button_pressed</item>
+ <item name="colorControlHighlight">@color/holo_button_pressed</item>
<item name="colorButtonNormal">@color/holo_button_normal</item>
<!-- Text styles -->
@@ -1310,7 +1310,7 @@ please see themes_device_defaults.xml.
<item name="colorPrimaryLight">@color/holo_light_primary_light</item>
<item name="colorControlActivated">@color/holo_light_control_activated</item>
<item name="colorControlNormal">@color/holo_light_control_normal</item>
- <item name="colorButtonPressed">@color/holo_light_button_pressed</item>
+ <item name="colorControlHighlight">@color/holo_light_button_pressed</item>
<item name="colorButtonNormal">@color/holo_light_button_normal</item>
<!-- Text styles -->
diff --git a/core/res/res/values/themes_quantum.xml b/core/res/res/values/themes_quantum.xml
index e7cf9da..bb787bb 100644
--- a/core/res/res/values/themes_quantum.xml
+++ b/core/res/res/values/themes_quantum.xml
@@ -320,7 +320,7 @@ please see themes_device_defaults.xml.
<item name="dividerVertical">?attr/listDivider</item>
<item name="dividerHorizontal">?attr/listDivider</item>
<item name="buttonBarStyle">@style/Widget.Quantum.ButtonBar</item>
- <item name="buttonBarButtonStyle">@style/Widget.Quantum.Button.Borderless.Small</item>
+ <item name="buttonBarButtonStyle">@style/Widget.Quantum.Button.Borderless</item>
<item name="segmentedButtonStyle">@style/Widget.Quantum.SegmentedButton</item>
<!-- SearchView attributes -->
@@ -377,8 +377,9 @@ please see themes_device_defaults.xml.
<item name="colorControlNormal">?attr/textColorSecondary</item>
<item name="colorControlActivated">?attr/colorPrimary</item>
- <item name="colorButtonNormal">@color/quantum_grey_700</item>
- <item name="colorButtonPressed">@color/quantum_grey_500</item>
+ <item name="colorControlHighlight">#30ffffff</item>
+
+ <item name="colorButtonNormal">@color/btn_default_quantum_dark</item>
</style>
<!-- Quantum Paper theme (light version). -->
@@ -718,8 +719,9 @@ please see themes_device_defaults.xml.
<item name="colorControlNormal">?attr/textColorSecondary</item>
<item name="colorControlActivated">?attr/colorPrimary</item>
- <item name="colorButtonNormal">@color/quantum_grey_100</item>
- <item name="colorButtonPressed">@color/quantum_grey_500</item>
+ <item name="colorControlHighlight">#30000000</item>
+
+ <item name="colorButtonNormal">@color/btn_default_quantum_light</item>
</style>
<!-- Variant of the quantum (light) theme that has a solid (opaque) action bar