From 992cc0addd405cc692150f20ca06c7bc31ae740b Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 11 Mar 2021 19:34:34 +0100 Subject: [PATCH] Message state: add sent status in BottomSheet --- .../action/MessageActionsEpoxyController.kt | 17 +++++++++++++---- vector/src/main/res/values/strings.xml | 2 ++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt index 1e93c29673..4e1492aaba 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsEpoxyController.kt @@ -73,12 +73,19 @@ class MessageActionsEpoxyController @Inject constructor( text(stringProvider.getString(R.string.unable_to_send_message)) drawableStart(R.drawable.ic_warning_badge) } - } else if (sendState != SendState.SYNCED) { + } else if (sendState?.isSending().orFalse()) { bottomSheetSendStateItem { id("send_state") showProgress(true) text(stringProvider.getString(R.string.event_status_sending_message)) } + } else if (sendState == SendState.SENT) { + bottomSheetSendStateItem { + id("send_state") + showProgress(false) + drawableStart(R.drawable.ic_message_sent) + text(stringProvider.getString(R.string.event_status_sent_message)) + } } when (state.informationData.e2eDecoration) { @@ -124,9 +131,11 @@ class MessageActionsEpoxyController @Inject constructor( } } - // Separator - dividerItem { - id("actions_separator") + if (state.actions.isNotEmpty()) { + // Separator + dividerItem { + id("actions_separator") + } } // Action diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 36ee7898e5..634b91bf90 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -208,6 +208,8 @@ Initial Sync:\nImporting Communities Initial Sync:\nImporting Account Data + + Message sent Sending messageā€¦ Clear sending queue