Use activated control color for ripple checked state

Change-Id: I5c3828c04ac159a50c36eb10d81174c881eefdf9
This commit is contained in:
Alan Viverette
2015-01-20 14:24:35 -08:00
parent df8e59abe5
commit 3117a52845
5 changed files with 56 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
<?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_checked="true"
android:state_enabled="true"
android:alpha="?attr/disabledAlpha"
android:color="?attr/colorControlActivated" />
<item android:color="?attr/colorControlHighlight" />
</selector>

View File

@@ -0,0 +1,18 @@
<?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.
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/control_highlight_material" />

View File

@@ -1029,6 +1029,9 @@
<!-- The color applied to framework switch thumbs in their normal state. -->
<attr name="colorSwitchThumbNormal" format="color" />
<!-- @hide The background used by framework controls. -->
<attr name="controlBackground" format="color" />
<!-- The color applied to the edge effect on scrolling containers. -->
<attr name="colorEdgeEffect" format="color" />

View File

@@ -572,16 +572,16 @@ please see styles_device_defaults.xml.
<style name="Widget.Material.CompoundButton" parent="Widget.CompoundButton"/>
<style name="Widget.Material.CompoundButton.CheckBox" parent="Widget.CompoundButton.CheckBox">
<item name="background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/controlBackground</item>
</style>
<style name="Widget.Material.CompoundButton.RadioButton" parent="Widget.CompoundButton.RadioButton">
<item name="background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/controlBackground</item>
</style>
<style name="Widget.Material.CompoundButton.Star" parent="Widget.CompoundButton.Star">
<item name="button">@drawable/btn_star_material</item>
<item name="background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/controlBackground</item>
</style>
<style name="Widget.Material.CompoundButton.Switch">
@@ -590,7 +590,7 @@ please see styles_device_defaults.xml.
<item name="switchTextAppearance">@style/TextAppearance.Material.Widget.Switch</item>
<item name="textOn">@string/capital_on</item>
<item name="textOff">@string/capital_off</item>
<item name="background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/controlBackground</item>
<item name="showText">false</item>
</style>
@@ -740,7 +740,7 @@ please see styles_device_defaults.xml.
<item name="paddingStart">16dip</item>
<item name="paddingEnd">16dip</item>
<item name="mirrorForRtl">true</item>
<item name="background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/controlBackground</item>
</style>
<style name="Widget.Material.RatingBar" parent="Widget.RatingBar">
@@ -819,7 +819,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Material.Toolbar.Button.Navigation" parent="Widget.Toolbar.Button.Navigation">
<item name="background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/controlBackground</item>
<item name="paddingStart">@dimen/action_bar_navigation_padding_start_material</item>
</style>
@@ -871,7 +871,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Material.ActionButton.CloseMode">
<item name="background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/controlBackground</item>
</style>
<style name="Widget.Material.ActionButton.Overflow">
@@ -955,7 +955,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Material.MediaRouteButton">
<item name="background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/controlBackground</item>
<item name="externalRouteEnabledDrawable">@drawable/ic_media_route_material</item>
<item name="minWidth">56dp</item>
<item name="minHeight">48dp</item>

View File

@@ -389,6 +389,8 @@ please see themes_device_defaults.xml.
<item name="colorControlHighlight">@color/ripple_material_dark</item>
<item name="colorButtonNormal">@color/btn_default_material_dark</item>
<item name="colorSwitchThumbNormal">@color/switch_thumb_material_dark</item>
<item name="controlBackground">@drawable/control_background_material</item>
</style>
<!-- Material theme (light version). -->
@@ -736,6 +738,8 @@ please see themes_device_defaults.xml.
<item name="colorControlHighlight">@color/ripple_material_light</item>
<item name="colorButtonNormal">@color/btn_default_material_light</item>
<item name="colorSwitchThumbNormal">@color/switch_thumb_material_light</item>
<item name="controlBackground">@drawable/control_background_material</item>
</style>
<!-- Variant of the material (light) theme that has a solid (opaque) action bar