summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2015-04-16 20:03:27 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-16 20:03:27 +0000
commitd19512bbfa3a0af9db1ef2877f1101b9ba819841 (patch)
tree3c6c53ca637f4a3c60e2ddde53dcaff1c423af48
parent8148f8b6f73f69bd87fc2b424b003709ada8db01 (diff)
parent88111f7beff50cd54bd511d71456a45c5d6ff132 (diff)
downloadframeworks_base-d19512bbfa3a0af9db1ef2877f1101b9ba819841.zip
frameworks_base-d19512bbfa3a0af9db1ef2877f1101b9ba819841.tar.gz
frameworks_base-d19512bbfa3a0af9db1ef2877f1101b9ba819841.tar.bz2
Merge "Colored button should be using inverse primary text color"
-rw-r--r--api/current.txt1
-rw-r--r--api/system-current.txt1
-rw-r--r--core/res/res/drawable/btn_colored_material.xml35
-rw-r--r--core/res/res/values/public.xml1
-rw-r--r--core/res/res/values/styles_material.xml7
5 files changed, 44 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt
index 3947aae..b373a9c 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -1978,6 +1978,7 @@ package android {
field public static final int TextAppearance_Material_Widget_ActionMode_Title = 16974355; // 0x1030213
field public static final int TextAppearance_Material_Widget_ActionMode_Title_Inverse = 16974356; // 0x1030214
field public static final int TextAppearance_Material_Widget_Button = 16974357; // 0x1030215
+ field public static final int TextAppearance_Material_Widget_Button_Inverse = 16974565; // 0x10302e5
field public static final int TextAppearance_Material_Widget_DropDownHint = 16974358; // 0x1030216
field public static final int TextAppearance_Material_Widget_DropDownItem = 16974359; // 0x1030217
field public static final int TextAppearance_Material_Widget_EditText = 16974360; // 0x1030218
diff --git a/api/system-current.txt b/api/system-current.txt
index 57a7503..4f9409d 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -2057,6 +2057,7 @@ package android {
field public static final int TextAppearance_Material_Widget_ActionMode_Title = 16974355; // 0x1030213
field public static final int TextAppearance_Material_Widget_ActionMode_Title_Inverse = 16974356; // 0x1030214
field public static final int TextAppearance_Material_Widget_Button = 16974357; // 0x1030215
+ field public static final int TextAppearance_Material_Widget_Button_Inverse = 16974565; // 0x10302e5
field public static final int TextAppearance_Material_Widget_DropDownHint = 16974358; // 0x1030216
field public static final int TextAppearance_Material_Widget_DropDownItem = 16974359; // 0x1030217
field public static final int TextAppearance_Material_Widget_EditText = 16974360; // 0x1030218
diff --git a/core/res/res/drawable/btn_colored_material.xml b/core/res/res/drawable/btn_colored_material.xml
new file mode 100644
index 0000000..81cbe39
--- /dev/null
+++ b/core/res/res/drawable/btn_colored_material.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="@dimen/button_inset_horizontal_material"
+ android:insetTop="@dimen/button_inset_vertical_material"
+ android:insetRight="@dimen/button_inset_horizontal_material"
+ android:insetBottom="@dimen/button_inset_vertical_material">
+ <ripple android:color="?attr/colorControlHighlight">
+ <item>
+ <shape android:shape="rectangle"
+ android:tint="@color/btn_colored_material">
+ <corners android:radius="@dimen/control_corner_material" />
+ <solid android:color="@color/white" />
+ <padding android:left="@dimen/button_padding_horizontal_material"
+ android:top="@dimen/button_padding_vertical_material"
+ android:right="@dimen/button_padding_horizontal_material"
+ android:bottom="@dimen/button_padding_vertical_material" />
+ </shape>
+ </item>
+ </ripple>
+</inset>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 282c80b..77b56ea 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2641,6 +2641,7 @@
<public type="style" name="Theme.Material.DayNight.Panel" />
<public type="style" name="Theme.Material.Light.LightStatusBar" />
<public type="style" name="ThemeOverlay.Material.Dialog" />
+ <public type="style" name="TextAppearance.Material.Widget.Button.Inverse" />
<public type="id" name="pasteAsPlainText" />
<public type="id" name="undo" />
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index 88cac72..b874f63 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -289,6 +289,10 @@ please see styles_device_defaults.xml.
<style name="TextAppearance.Material.Widget"/>
<style name="TextAppearance.Material.Widget.Button" parent="TextAppearance.Material.Button" />
+ <style name="TextAppearance.Material.Widget.Button.Inverse">
+ <item name="textColor">?attr/textColorPrimaryInverse</item>
+ </style>
+
<style name="TextAppearance.Material.Widget.EditText">
<item name="textColor">?attr/textColorPrimaryInverse</item>
<item name="textColorHint">?attr/textColorHintInverse</item>
@@ -461,7 +465,8 @@ please see styles_device_defaults.xml.
<!-- Colored bordered ink button -->
<style name="Widget.Material.Button.Colored">
- <item name="backgroundTint">@color/btn_colored_material</item>
+ <item name="background">@drawable/btn_colored_material</item>
+ <item name="textAppearance">@style/TextAppearance.Material.Widget.Button.Inverse</item>
</style>
<!-- Small bordered ink button -->