Use new toast style for actionable toasts.
Change-Id: Id2b2179ae177e4ff03b1fd2907f30d25734dd53a
diff --git a/res/drawable-hdpi-v19/panel_undo_holo.9.png b/res/drawable-hdpi-v19/panel_undo_holo.9.png
new file mode 100644
index 0000000..a804a8a
--- /dev/null
+++ b/res/drawable-hdpi-v19/panel_undo_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi-v19/panel_undo_holo.9.png b/res/drawable-mdpi-v19/panel_undo_holo.9.png
new file mode 100644
index 0000000..778e4e6
--- /dev/null
+++ b/res/drawable-mdpi-v19/panel_undo_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi-v19/panel_undo_holo.9.png b/res/drawable-xhdpi-v19/panel_undo_holo.9.png
new file mode 100644
index 0000000..77e69c7
--- /dev/null
+++ b/res/drawable-xhdpi-v19/panel_undo_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi-v19/panel_undo_holo.9.png b/res/drawable-xxhdpi-v19/panel_undo_holo.9.png
new file mode 100644
index 0000000..edecb63
--- /dev/null
+++ b/res/drawable-xxhdpi-v19/panel_undo_holo.9.png
Binary files differ
diff --git a/res/layout/actionable_toast_row.xml b/res/layout/actionable_toast_row.xml
index 2f2a3df..60ae51a 100644
--- a/res/layout/actionable_toast_row.xml
+++ b/res/layout/actionable_toast_row.xml
@@ -21,8 +21,8 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
- android:paddingLeft="16dip"
- android:src="@drawable/ic_menu_revert_holo_dark" />
+ android:src="@drawable/ic_menu_revert_holo_dark"
+ style="@style/ToastBarDescriptionIconStyle" />
<TextView
android:id="@+id/description_text"
@@ -31,7 +31,6 @@
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
- android:paddingLeft="16dip"
android:singleLine="true"
android:text="@string/no_conversations"
android:textColor="@android:color/white"
@@ -48,27 +47,24 @@
android:id="@+id/separator"
android:layout_width="1dip"
android:layout_height="match_parent"
- android:layout_marginBottom="10dip"
- android:layout_marginRight="12dip"
- android:layout_marginTop="10dip"
- android:background="#aaaaaa" />
+ android:background="#aaaaaa"
+ style="@style/ToastBarSeparatorStyle" />
<ImageView
android:id="@+id/action_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
- android:layout_marginRight="4dip"
- android:src="@drawable/ic_menu_revert_holo_dark" />
+ android:src="@drawable/ic_menu_revert_holo_dark"
+ style="@style/ToastBarActionIconStyle" />
<TextView
android:id="@+id/action_text"
- style="@style/UndoTextStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:layout_marginLeft="4dip"
android:gravity="center_vertical"
- android:textAllCaps="true" />
+ android:textAllCaps="true"
+ style="@style/ToastBarActionTextStyle" />
</LinearLayout>
</merge>
\ No newline at end of file
diff --git a/res/values-ldrtl/styles-ldrtl.xml b/res/values-ldrtl/styles-ldrtl.xml
index ae29d7d..0118c25 100644
--- a/res/values-ldrtl/styles-ldrtl.xml
+++ b/res/values-ldrtl/styles-ldrtl.xml
@@ -139,4 +139,22 @@
<style name="AttachmentTextContainer">
<item name="android:paddingStart">@dimen/compose_attachment_text_padding</item>
</style>
+
+ <style name="ToastBarDescriptionIconStyle">
+ <item name="android:paddingStart">@dimen/toast_bar_description_icon_padding_start</item>
+ <item name="android:paddingEnd">@dimen/toast_bar_description_icon_padding_end</item>
+ </style>
+
+ <style name="ToastBarSeparatorStyle" parent="AbstractToastBarSeparatorStyle">
+ <item name="android:layout_marginEnd">@dimen/toast_bar_separator_margin</item>
+ </style>
+
+ <style name="ToastBarActionIconStyle">
+ <item name="android:layout_marginEnd">@dimen/toast_bar_action_margin</item>
+ </style>
+
+ <style name="ToastBarActionTextStyle" parent="AbstractUndoTextStyle">
+ <item name="android:layout_marginStart">@dimen/toast_bar_action_margin</item>
+ <item name="android:paddingEnd">@dimen/toast_bar_undo_text_padding</item>
+ </style>
</resources>
\ No newline at end of file
diff --git a/res/values-v19/dimen.xml b/res/values-v19/dimen.xml
new file mode 100644
index 0000000..a9f5dac
--- /dev/null
+++ b/res/values-v19/dimen.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 Google Inc.
+ Licensed to 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.
+-->
+<resources>
+ <dimen name="toast_bar_description_icon_padding_start">0dip</dimen>
+ <dimen name="toast_bar_separator_margin_vertical">0dip</dimen>
+ <dimen name="toast_bar_undo_text_padding">0dip</dimen>
+ <dimen name="toast_bar_margin">24dip</dimen>
+</resources>
\ No newline at end of file
diff --git a/res/values/dimen.xml b/res/values/dimen.xml
index 466884b..8742815 100644
--- a/res/values/dimen.xml
+++ b/res/values/dimen.xml
@@ -132,4 +132,12 @@
<dimen name="folder_teaser_count_textview_minwidth">68dp</dimen>
<dimen name="compose_attachment_text_padding">8dip</dimen>
+
+ <dimen name="toast_bar_description_icon_padding_start">16dip</dimen>
+ <dimen name="toast_bar_description_icon_padding_end">16dip</dimen>
+ <dimen name="toast_bar_separator_margin">12dip</dimen>
+ <dimen name="toast_bar_separator_margin_vertical">10dip</dimen>
+ <dimen name="toast_bar_action_margin">4dip</dimen>
+ <dimen name="toast_bar_undo_text_padding">16dip</dimen>
+ <dimen name="toast_bar_margin">4dip</dimen>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index b6609a1..249d241 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -413,9 +413,9 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">48dip</item>
<item name="android:layout_gravity">bottom</item>
- <item name="android:layout_marginLeft">4dip</item>
- <item name="android:layout_marginRight">4dip</item>
- <item name="android:layout_marginBottom">4dip</item>
+ <item name="android:layout_marginLeft">@dimen/toast_bar_margin</item>
+ <item name="android:layout_marginRight">@dimen/toast_bar_margin</item>
+ <item name="android:layout_marginBottom">@dimen/toast_bar_margin</item>
<item name="android:orientation">horizontal</item>
<item name="android:gravity">center_vertical</item>
<item name="android:background">@drawable/panel_undo_holo</item>
@@ -602,4 +602,26 @@
<style name="RecipientSummaryStyle" parent="MessageHeaderSmallStyle">
<item name="android:layout_marginRight">@dimen/recipient_summary_margin</item>
</style>
+
+ <style name="ToastBarDescriptionIconStyle">
+ <item name="android:paddingLeft">@dimen/toast_bar_description_icon_padding_start</item>
+ <item name="android:paddingRight">@dimen/toast_bar_description_icon_padding_end</item>
+ </style>
+
+ <style name="AbstractToastBarSeparatorStyle">
+ <item name="android:layout_marginTop">@dimen/toast_bar_separator_margin_vertical</item>
+ <item name="android:layout_marginBottom">@dimen/toast_bar_separator_margin_vertical</item>
+ </style>
+ <style name="ToastBarSeparatorStyle" parent="AbstractToastBarSeparatorStyle">
+ <item name="android:layout_marginRight">@dimen/toast_bar_separator_margin</item>
+ </style>
+
+ <style name="ToastBarActionIconStyle">
+ <item name="android:layout_marginRight">@dimen/toast_bar_action_margin</item>
+ </style>
+
+ <style name="ToastBarActionTextStyle" parent="AbstractUndoTextStyle">
+ <item name="android:layout_marginLeft">@dimen/toast_bar_action_margin</item>
+ <item name="android:paddingRight">@dimen/toast_bar_undo_text_padding</item>
+ </style>
</resources>