summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoey Rizzoli <joey@cyanogenmoditalia.it>2016-10-17 16:32:25 +0200
committerMichael Bestas <mkbestas@lineageos.org>2018-01-21 21:57:19 +0200
commit04491e6c0bb03618bac985257a40d5581345f869 (patch)
tree71f5912a6939bb828aff1adf29475a2f57bc0e37 /src
parent6624beedb0f43b46bd84bc377e0df3b77e2af986 (diff)
downloadpackages_apps_Messaging-04491e6c0bb03618bac985257a40d5581345f869.tar.gz
packages_apps_Messaging-04491e6c0bb03618bac985257a40d5581345f869.tar.bz2
packages_apps_Messaging-04491e6c0bb03618bac985257a40d5581345f869.zip
Messaging: show snackbar instead of toast when deleting conversation
more consistency with archive action Change-Id: I06129850860a2a51c10ade65fb87c9f37a0c2bfa Signed-off-by: Joey Rizzoli <joey@cyanogenmoditalia.it>
Diffstat (limited to 'src')
-rw-r--r--src/com/android/messaging/datamodel/action/BugleActionToasts.java1
-rw-r--r--src/com/android/messaging/ui/conversationlist/ConversationListItemView.java3
-rw-r--r--src/com/android/messaging/util/UiUtils.java10
3 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/messaging/datamodel/action/BugleActionToasts.java b/src/com/android/messaging/datamodel/action/BugleActionToasts.java
index f60facd..17d15f2 100644
--- a/src/com/android/messaging/datamodel/action/BugleActionToasts.java
+++ b/src/com/android/messaging/datamodel/action/BugleActionToasts.java
@@ -114,7 +114,6 @@ public class BugleActionToasts {
}
public static void onConversationDeleted() {
- showToast(R.string.conversation_deleted);
}
private static void showToast(final int messageResId) {
diff --git a/src/com/android/messaging/ui/conversationlist/ConversationListItemView.java b/src/com/android/messaging/ui/conversationlist/ConversationListItemView.java
index 0e95c65..d88b8e4 100644
--- a/src/com/android/messaging/ui/conversationlist/ConversationListItemView.java
+++ b/src/com/android/messaging/ui/conversationlist/ConversationListItemView.java
@@ -555,7 +555,8 @@ public class ConversationListItemView extends FrameLayout implements OnClickList
if (PrefsUtils.isSwipeRightToDeleteEnabled()
&& swipeDirection == ConversationListSwipeHelper.SWIPE_DIRECTION_RIGHT) {
mData.deleteConversation();
- UiUtils.showToastAtBottom(R.string.conversation_deleted);
+ UiUtils.showSnackBar(getContext(), getRootView(),
+ getResources().getString(R.string.conversation_deleted));
return;
}
UpdateConversationArchiveStatusAction.archiveConversation(conversationId);
diff --git a/src/com/android/messaging/util/UiUtils.java b/src/com/android/messaging/util/UiUtils.java
index e446c73..c44bca4 100644
--- a/src/com/android/messaging/util/UiUtils.java
+++ b/src/com/android/messaging/util/UiUtils.java
@@ -132,6 +132,16 @@ public class UiUtils {
null /* placement */);
}
+ public static void showSnackBar(final Context context, @NonNull final View parentView,
+ final String message) {
+ Assert.notNull(context);
+ Assert.isTrue(!TextUtils.isEmpty(message));
+ SnackBarManager.get()
+ .newBuilder(parentView)
+ .setText(message)
+ .show();
+ }
+
public static void showSnackBarWithCustomAction(final Context context,
@NonNull final View parentView,
@NonNull final String message,