Merge "Make the positive dialog button use accent color"
diff --git a/api/current.txt b/api/current.txt
index 7478a5a..07524ee 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -347,6 +347,9 @@
     field public static final int bufferType = 16843086; // 0x101014e
     field public static final int button = 16843015; // 0x1010107
     field public static final int buttonBarButtonStyle = 16843567; // 0x101032f
+    field public static final int buttonBarNegativeButtonStyle = 16843917; // 0x101048d
+    field public static final int buttonBarNeutralButtonStyle = 16843916; // 0x101048c
+    field public static final int buttonBarPositiveButtonStyle = 16843915; // 0x101048b
     field public static final int buttonBarStyle = 16843566; // 0x101032e
     field public static final int buttonStyle = 16842824; // 0x1010048
     field public static final int buttonStyleInset = 16842826; // 0x101004a
@@ -2384,6 +2387,7 @@
     field public static final int Widget_Material_ButtonBar = 16974439; // 0x1030267
     field public static final int Widget_Material_ButtonBar_AlertDialog = 16974440; // 0x1030268
     field public static final int Widget_Material_Button_Borderless = 16974434; // 0x1030262
+    field public static final int Widget_Material_Button_Borderless_Colored = 16974556; // 0x10302dc
     field public static final int Widget_Material_Button_Borderless_Small = 16974435; // 0x1030263
     field public static final int Widget_Material_Button_Inset = 16974436; // 0x1030264
     field public static final int Widget_Material_Button_Small = 16974437; // 0x1030265
@@ -2417,6 +2421,7 @@
     field public static final int Widget_Material_Light_ButtonBar = 16974500; // 0x10302a4
     field public static final int Widget_Material_Light_ButtonBar_AlertDialog = 16974501; // 0x10302a5
     field public static final int Widget_Material_Light_Button_Borderless = 16974495; // 0x103029f
+    field public static final int Widget_Material_Light_Button_Borderless_Colored = 16974557; // 0x10302dd
     field public static final int Widget_Material_Light_Button_Borderless_Small = 16974496; // 0x10302a0
     field public static final int Widget_Material_Light_Button_Inset = 16974497; // 0x10302a1
     field public static final int Widget_Material_Light_Button_Small = 16974498; // 0x10302a2
diff --git a/core/res/res/anim/disabled_anim_material.xml b/core/res/res/anim/disabled_anim_material.xml
new file mode 100644
index 0000000..6a7731e
--- /dev/null
+++ b/core/res/res/anim/disabled_anim_material.xml
@@ -0,0 +1,33 @@
+<?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">
+        <set>
+            <objectAnimator android:propertyName="alpha"
+                android:duration="@integer/disabled_alpha_animation_duration"
+                android:valueTo="?attr/disabledAlpha"
+                android:valueType="floatType"/>
+        </set>
+    </item>
+    <item>
+        <set>
+            <objectAnimator android:propertyName="alpha"
+                android:duration="@integer/disabled_alpha_animation_duration"
+                android:valueTo="1"
+                android:valueType="floatType"/>
+        </set>
+    </item>
+</selector>
\ No newline at end of file
diff --git a/core/res/res/layout/alert_dialog_material.xml b/core/res/res/layout/alert_dialog_material.xml
index 927b7b2..93acc3f 100644
--- a/core/res/res/layout/alert_dialog_material.xml
+++ b/core/res/res/layout/alert_dialog_material.xml
@@ -83,7 +83,7 @@
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:minHeight="64dp">
-        <FrameLayout android:id="@+android:id/custom"
+        <FrameLayout android:id="@+id/custom"
             android:layout_width="match_parent"
             android:layout_height="wrap_content" />
     </FrameLayout>
@@ -101,7 +101,7 @@
             android:layout_height="wrap_content"
             android:layoutDirection="locale">
             <Button android:id="@+id/button3"
-                style="?attr/buttonBarButtonStyle"
+                style="?attr/buttonBarNeutralButtonStyle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:maxLines="2"
@@ -112,13 +112,13 @@
                 android:layout_weight="1"
                 android:visibility="invisible" />
             <Button android:id="@+id/button2"
-                style="?attr/buttonBarButtonStyle"
+                style="?attr/buttonBarNegativeButtonStyle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:maxLines="2"
                 android:minHeight="@dimen/alert_dialog_button_bar_height" />
             <Button android:id="@+id/button1"
-                style="?attr/buttonBarButtonStyle"
+                style="?attr/buttonBarPositiveButtonStyle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:maxLines="2"
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 93bc616..4b708a7 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -894,6 +894,15 @@
         <!-- Style for buttons within button bars -->
         <attr name="buttonBarButtonStyle" format="reference" />
 
+        <!-- Style for the "positive" buttons within button bars -->
+        <attr name="buttonBarPositiveButtonStyle" format="reference" />
+
+        <!-- Style for the "negative" buttons within button bars -->
+        <attr name="buttonBarNegativeButtonStyle" format="reference" />
+
+        <!-- Style for the "neutral" buttons within button bars -->
+        <attr name="buttonBarNeutralButtonStyle" format="reference" />
+
         <!-- Style for the search query widget. -->
         <attr name="searchViewStyle" format="reference" />
 
diff --git a/core/res/res/values/integers.xml b/core/res/res/values/integers.xml
index fd61f73..0343cfa 100644
--- a/core/res/res/values/integers.xml
+++ b/core/res/res/values/integers.xml
@@ -21,4 +21,5 @@
     <integer name="kg_glowpad_rotation_offset">0</integer>
     <integer name="button_pressed_animation_duration">100</integer>
     <integer name="button_pressed_animation_delay">100</integer>
+    <integer name="disabled_alpha_animation_duration">100</integer>
 </resources>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 8e93353..99c3450 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2228,6 +2228,9 @@
   <public type="attr" name="suggestionRowLayout" />
   <public type="attr" name="queryBackground" />
   <public type="attr" name="submitBackground" />
+  <public type="attr" name="buttonBarPositiveButtonStyle" />
+  <public type="attr" name="buttonBarNeutralButtonStyle" />
+  <public type="attr" name="buttonBarNegativeButtonStyle" />
 
   <public-padding type="dimen" name="l_resource_pad" end="0x01050010" />
 
@@ -2470,6 +2473,9 @@
   <public type="style" name="TextAppearance.Material.Menu" />
   <public type="style" name="TextAppearance.Material.Button" />
 
+  <public type="style" name="Widget.Material.Button.Borderless.Colored" />
+  <public type="style" name="Widget.Material.Light.Button.Borderless.Colored" />
+
   <public-padding type="interpolator" name="l_resource_pad" end="0x010c0010" />
 
   <!-- An interpolator which accelerates fast but decelerates slowly. -->
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index ea67f46..c1eb999 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -415,6 +415,12 @@
         <item name="stateListAnimator">@null</item>
     </style>
 
+    <!-- Colored borderless ink button -->
+    <style name="Widget.Material.Button.Borderless.Colored">
+        <item name="textColor">?attr/colorAccent</item>
+        <item name="stateListAnimator">@anim/disabled_anim_material</item>
+    </style>
+
     <!-- Small borderless ink button -->
     <style name="Widget.Material.Button.Borderless.Small">
         <item name="minHeight">48dip</item>
@@ -837,6 +843,7 @@
     <style name="Widget.Material.Light.Button" parent="Widget.Material.Button"/>
     <style name="Widget.Material.Light.Button.Small" parent="Widget.Material.Button.Small"/>
     <style name="Widget.Material.Light.Button.Borderless" parent="Widget.Material.Button.Borderless"/>
+    <style name="Widget.Material.Light.Button.Borderless.Colored" parent="Widget.Material.Button.Borderless.Colored"/>
     <style name="Widget.Material.Light.Button.Borderless.Small" parent="Widget.Material.Button.Borderless.Small"/>
     <style name="Widget.Material.Light.Button.Inset" parent="Widget.Material.Button.Inset"/>
     <style name="Widget.Material.Light.Button.Toggle" parent="Widget.Material.Button.Toggle" />
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 8edfc8f..b1bf123 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -371,6 +371,9 @@
         <item name="dividerHorizontal">@drawable/divider_vertical_dark</item>
         <item name="buttonBarStyle">@style/ButtonBar</item>
         <item name="buttonBarButtonStyle">?attr/buttonStyle</item>
+        <item name="buttonBarPositiveButtonStyle">?attr/buttonBarButtonStyle</item>
+        <item name="buttonBarNegativeButtonStyle">?attr/buttonBarButtonStyle</item>
+        <item name="buttonBarNeutralButtonStyle">?attr/buttonBarButtonStyle</item>
         <item name="segmentedButtonStyle">@style/SegmentedButton</item>
 
         <!-- SearchView attributes -->
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index 8646524..472177f 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -332,6 +332,7 @@
         <item name="dividerHorizontal">?attr/listDivider</item>
         <item name="buttonBarStyle">@style/Widget.Material.ButtonBar</item>
         <item name="buttonBarButtonStyle">@style/Widget.Material.Button.Borderless</item>
+        <item name="buttonBarPositiveButtonStyle">@style/Widget.Material.Button.Borderless.Colored</item>
         <item name="segmentedButtonStyle">@style/Widget.Material.SegmentedButton</item>
 
         <!-- SearchView attributes -->
@@ -681,6 +682,7 @@
         <item name="dividerHorizontal">?attr/listDivider</item>
         <item name="buttonBarStyle">@style/Widget.Material.Light.ButtonBar</item>
         <item name="buttonBarButtonStyle">@style/Widget.Material.Light.Button.Borderless</item>
+        <item name="buttonBarPositiveButtonStyle">@style/Widget.Material.Light.Button.Borderless.Colored</item>
         <item name="segmentedButtonStyle">@style/Widget.Material.Light.SegmentedButton</item>
 
         <!-- SearchView attributes -->