From 125bab40ba791c12a745a01ff86b73f3b95f8c13 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Thu, 21 Aug 2014 10:54:14 -0700 Subject: [PATCH] Update material switch styling Also adds switch style to default theme. BUG: 16984766 Change-Id: Ib90bcd80cd599e3c66a08ae7b327a347f4ca2405 --- .../res/color/switch_thumb_material_dark.xml | 20 ++++++++++ .../res/color/switch_thumb_material_light.xml | 20 ++++++++++ .../drawable/switch_thumb_material_anim.xml | 40 +++++++------------ .../res/drawable/switch_track_material.xml | 8 ++-- core/res/res/values/attrs.xml | 3 ++ core/res/res/values/colors_material.xml | 5 +++ core/res/res/values/themes.xml | 4 +- core/res/res/values/themes_material.xml | 4 ++ 8 files changed, 73 insertions(+), 31 deletions(-) create mode 100644 core/res/res/color/switch_thumb_material_dark.xml create mode 100644 core/res/res/color/switch_thumb_material_light.xml diff --git a/core/res/res/color/switch_thumb_material_dark.xml b/core/res/res/color/switch_thumb_material_dark.xml new file mode 100644 index 0000000000000..8fede70f492eb --- /dev/null +++ b/core/res/res/color/switch_thumb_material_dark.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/core/res/res/color/switch_thumb_material_light.xml b/core/res/res/color/switch_thumb_material_light.xml new file mode 100644 index 0000000000000..1a34b741ed628 --- /dev/null +++ b/core/res/res/color/switch_thumb_material_light.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/core/res/res/drawable/switch_thumb_material_anim.xml b/core/res/res/drawable/switch_thumb_material_anim.xml index 30bc88823409d..0d4d78ec654ae 100644 --- a/core/res/res/drawable/switch_thumb_material_anim.xml +++ b/core/res/res/drawable/switch_thumb_material_anim.xml @@ -16,22 +16,12 @@ - - - - + + android:tint="?attr/colorSwitchThumbNormal" /> + android:tint="?attr/colorSwitchThumbNormal" /> - + - + - + - + - + - + @@ -112,22 +102,22 @@ - + - + - + - + - + - + diff --git a/core/res/res/drawable/switch_track_material.xml b/core/res/res/drawable/switch_track_material.xml index 0728055463a9a..1ec2f88ed0c8e 100644 --- a/core/res/res/drawable/switch_track_material.xml +++ b/core/res/res/drawable/switch_track_material.xml @@ -15,10 +15,10 @@ --> - + + android:tint="?attr/colorForeground" + android:alpha="0.1" /> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 08aaa6aee8212..d584c8424cd9a 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1005,6 +1005,9 @@ + + + diff --git a/core/res/res/values/colors_material.xml b/core/res/res/values/colors_material.xml index ccbb8bced3845..2348951137319 100644 --- a/core/res/res/values/colors_material.xml +++ b/core/res/res/values/colors_material.xml @@ -25,6 +25,11 @@ #ff5a595b #ffd6d7d7 + #ffbdbdbd + #fff1f1f1 + #ff616161 + #ffbdbdbd + @color/white @color/black diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index b36cdb9829f26..5445816e9e618 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -116,12 +116,12 @@ please see themes_device_defaults.xml. @style/Widget.Button - @style/Widget.Button.Small @style/Widget.Button.Inset - @style/Widget.Button.Toggle + @style/Widget.CompoundButton.Switch + @drawable/item_background ?attr/selectableItemBackground ?attr/buttonStyle diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml index 18170ac4fcd47..bff5ce24082a0 100644 --- a/core/res/res/values/themes_material.xml +++ b/core/res/res/values/themes_material.xml @@ -379,6 +379,7 @@ please see themes_device_defaults.xml. @color/ripple_material_dark @color/btn_default_material_dark + @color/switch_thumb_material_dark @@ -721,6 +722,7 @@ please see themes_device_defaults.xml. @color/ripple_material_light @color/btn_default_material_light + @color/switch_thumb_material_light