summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-09-06 15:44:17 -0700
committerTony Wickham <twickham@google.com>2018-09-11 15:35:47 -0700
commit08c7cd562533abfddd678ed9a1c3c04e3e6b0d9d (patch)
treec4d5b785a6b360277114f68d756020621e0bcadb /res
parent447036d0d70ec90d05ad5ab25499fabefda6245b (diff)
downloadandroid_packages_apps_Trebuchet-08c7cd562533abfddd678ed9a1c3c04e3e6b0d9d.tar.gz
android_packages_apps_Trebuchet-08c7cd562533abfddd678ed9a1c3c04e3e6b0d9d.tar.bz2
android_packages_apps_Trebuchet-08c7cd562533abfddd678ed9a1c3c04e3e6b0d9d.zip
Update undo snackbar visuals
- Use accent color for action - Update font-family to use TextTitle style - Reduce elevation to 3dp - Inset snackbar left/right margins more, unless we need to increase the width to fit the text - For largest display/font size, fallback to 2 lines and smaller font if necessary to not cut off the label - Remove top/bottom padding on action (b/114084048) - Allow up to 20 char for the action (b/114317987) Change-Id: I833c102aaac3ba3db2283997c142926c3830336d
Diffstat (limited to 'res')
-rw-r--r--res/layout/snackbar.xml16
-rw-r--r--res/values/dimens.xml7
-rw-r--r--res/values/strings.xml2
3 files changed, 18 insertions, 7 deletions
diff --git a/res/layout/snackbar.xml b/res/layout/snackbar.xml
index 419fb8220..bca330842 100644
--- a/res/layout/snackbar.xml
+++ b/res/layout/snackbar.xml
@@ -25,17 +25,23 @@
android:gravity="center_vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp"
- android:textSize="14sp"
- android:textColor="?android:attr/textColorPrimary"/>
+ android:lines="1"
+ android:ellipsize="end"
+ android:textSize="@dimen/snackbar_max_text_size"
+ android:textColor="?android:attr/textColorPrimary"
+ android:theme="@style/TextTitle"/>
<TextView
android:id="@+id/action"
android:layout_height="@dimen/snackbar_content_height"
android:layout_width="wrap_content"
android:layout_weight="0"
android:gravity="center"
- android:padding="8dp"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
android:background="?android:attr/selectableItemBackground"
android:textStyle="bold"
- android:textColor="?android:attr/textColorPrimary"
- android:textAllCaps="true"/>
+ android:textSize="@dimen/snackbar_max_text_size"
+ android:textColor="?android:attr/colorAccent"
+ android:theme="@style/TextTitle"
+ android:capitalize="sentences"/>
</merge> \ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e7bd64caa..8adae3618 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -230,5 +230,10 @@
<dimen name="snackbar_height">48dp</dimen>
<dimen name="snackbar_content_height">32dp</dimen>
<dimen name="snackbar_padding">8dp</dimen>
- <dimen name="snackbar_margin">16dp</dimen>
+ <dimen name="snackbar_min_margin_left_right">6dp</dimen>
+ <dimen name="snackbar_max_margin_left_right">72dp</dimen>
+ <dimen name="snackbar_margin_bottom">30dp</dimen>
+ <dimen name="snackbar_elevation">3dp</dimen>
+ <dimen name="snackbar_min_text_size">12sp</dimen>
+ <dimen name="snackbar_max_text_size">14sp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6d73dcbd1..eb6b28413 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -262,7 +262,7 @@
<!-- Accessibility confirmation for item removed. [CHAR_LIMIT=50]-->
<string name="item_removed">Item removed</string>
- <!-- Action shown in snackbar to undo item removal. [CHAR_LIMIT=15] -->
+ <!-- Action shown in snackbar to undo item removal. [CHAR_LIMIT=20] -->
<string name="undo">Undo</string>
<!-- Accessibility action to move an item on the workspace. [CHAR_LIMIT=30] -->