summaryrefslogtreecommitdiffstats
path: root/res/layout
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-08-21 11:40:23 -0700
committerTony Wickham <twickham@google.com>2018-08-30 16:22:25 -0700
commit6a71a5bd7787a2dc4a585e9e6ea0a440d0458a54 (patch)
treeb3bdc0c63c2540f57042c0d09d82786ec8d1869c /res/layout
parent1654c9e1c00cb41de392880adf7c3a5a558270b3 (diff)
downloadandroid_packages_apps_Trebuchet-6a71a5bd7787a2dc4a585e9e6ea0a440d0458a54.tar.gz
android_packages_apps_Trebuchet-6a71a5bd7787a2dc4a585e9e6ea0a440d0458a54.tar.bz2
android_packages_apps_Trebuchet-6a71a5bd7787a2dc4a585e9e6ea0a440d0458a54.zip
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
Diffstat (limited to 'res/layout')
-rw-r--r--res/layout/snackbar.xml41
1 files changed, 41 insertions, 0 deletions
diff --git a/res/layout/snackbar.xml b/res/layout/snackbar.xml
new file mode 100644
index 000000000..419fb8220
--- /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