Cancel sending event dialog.

This commit is contained in:
Onuray Sahin 2021-02-25 15:44:47 +03:00 committed by Benoit Marty
parent c178535cc8
commit c741916d9f
2 changed files with 20 additions and 3 deletions

View File

@ -157,6 +157,7 @@ import im.vector.app.features.permalink.NavigationInterceptor
import im.vector.app.features.permalink.PermalinkHandler
import im.vector.app.features.reactions.EmojiReactionPickerActivity
import im.vector.app.features.roomprofile.RoomProfileActivity
import im.vector.app.features.roomprofile.alias.RoomAliasAction
import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.settings.VectorSettingsActivity
import im.vector.app.features.share.SharedData
@ -1544,9 +1545,20 @@ class RoomDetailFragment @Inject constructor(
this.view?.hideKeyboard()
MessageActionsBottomSheet
.newInstance(roomId, informationData)
.show(requireActivity().supportFragmentManager, "MESSAGE_CONTEXTUAL_ACTIONS")
if (informationData.sendState.isSending()) {
AlertDialog.Builder(requireContext())
.setTitle(R.string.dialog_title_confirmation)
.setMessage(getString(R.string.event_status_cancel_sending_dialog_message))
.setNegativeButton(R.string.no, null)
.setPositiveButton(R.string.yes) { _, _ ->
sharedActionViewModel.post(EventSharedAction.Cancel(informationData.eventId))
}
.show()
} else {
MessageActionsBottomSheet
.newInstance(roomId, informationData)
.show(requireActivity().supportFragmentManager, "MESSAGE_CONTEXTUAL_ACTIONS")
}
return true
}

View File

@ -3239,4 +3239,9 @@
<string name="dev_tools_success_event">Event sent!</string>
<string name="dev_tools_success_state_event">State event sent!</string>
<string name="dev_tools_event_content_hint">Event content</string>
<string name="event_status_a11y_sending">Sending</string>
<string name="event_status_a11y_sent">Sent</string>
<string name="event_status_a11y_failed">Failed</string>
<string name="event_status_cancel_sending_dialog_message">Do you want to cancel sending message?</string>
</resources>