Add undo snackbar for deleting items

- Add methods to ModelWriter to prepareForUndoDelete, then
  enqueueDeleteRunnable, followed by commitDelete or abortDelete.
- Add Snackbar floating view
- Show Undo snackbar when dropping or flinging to delete target; if the
  undo action is clicked, we abort the delete, otherwise we commit it.

Bug: 24238108
Change-Id: I9997235e1f8525cbb8b1fa2338099609e7358426
diff --git a/res/layout/snackbar.xml b/res/layout/snackbar.xml
new file mode 100644
index 0000000..419fb82
--- /dev/null
+++ b/res/layout/snackbar.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 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.
+-->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <TextView
+        android:id="@+id/label"
+        android:layout_height="@dimen/snackbar_content_height"
+        android:layout_width="0dp"
+        android:layout_weight="1"
+        android:gravity="center_vertical"
+        android:paddingLeft="8dp"
+        android:paddingRight="8dp"
+        android:textSize="14sp"
+        android:textColor="?android:attr/textColorPrimary"/>
+    <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:background="?android:attr/selectableItemBackground"
+        android:textStyle="bold"
+        android:textColor="?android:attr/textColorPrimary"
+        android:textAllCaps="true"/>
+</merge>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 58fce34..e7bd64c 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -225,4 +225,10 @@
 <!-- Overview -->
     <dimen name="options_menu_icon_size">24dp</dimen>
     <dimen name="options_menu_thumb_size">32dp</dimen>
+
+<!-- Snackbar -->
+    <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>
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7bc11c3..6d73dcb 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -259,9 +259,12 @@
     <!-- Accessibility confirmation for item added to workspace. -->
     <string name="item_added_to_workspace">Item added to home screen</string>
 
-    <!-- Accessibility confirmation for item removed. -->
+    <!-- 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] -->
+    <string name="undo">Undo</string>
+
     <!-- Accessibility action to move an item on the workspace. [CHAR_LIMIT=30] -->
     <string name="action_move">Move item</string>