mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
Pause story playback while saving media.
Story playback was previously paused when the context menu is opened, but resumed while saving the media. With this change, playback will remain paused while saving media, so the user doesn't potentially miss any stories while clicking through the dialogs to save media to their device storage.
This commit is contained in:
committed by
Cody Henthorne
parent
c876c7847e
commit
bf8f603dcf
@@ -1198,10 +1198,12 @@ class StoryViewerPageFragment :
|
||||
},
|
||||
onSave = {
|
||||
lifecycleScope.launch {
|
||||
viewModel.setIsSavingMedia(true)
|
||||
StoryContextMenu.save(
|
||||
host = AttachmentSaver.FragmentHost(this@StoryViewerPageFragment),
|
||||
messageRecord = it.conversationMessage.messageRecord
|
||||
)
|
||||
viewModel.setIsSavingMedia(false)
|
||||
}
|
||||
},
|
||||
onDelete = {
|
||||
|
||||
@@ -299,6 +299,10 @@ class StoryViewerPageViewModel(
|
||||
storyViewerPlaybackStore.update { it.copy(isDisplayingPartialSendDialog = isDisplayingPartialSendDialog) }
|
||||
}
|
||||
|
||||
fun setIsSavingMedia(isSavingMedia: Boolean) {
|
||||
storyViewerPlaybackStore.update { it.copy(isSavingMedia = isSavingMedia) }
|
||||
}
|
||||
|
||||
private fun resolveSwipeToReplyState(state: StoryViewerPageState, index: Int): StoryViewerPageState.ReplyState {
|
||||
if (index !in state.posts.indices) {
|
||||
return StoryViewerPageState.ReplyState.NONE
|
||||
|
||||
@@ -23,7 +23,8 @@ data class StoryViewerPlaybackState(
|
||||
val isUserScrollingChild: Boolean = false,
|
||||
val isUserScaling: Boolean = false,
|
||||
val isDisplayingPartialSendDialog: Boolean = false,
|
||||
val isDisplayingRecipientBottomSheet: Boolean = false
|
||||
val isDisplayingRecipientBottomSheet: Boolean = false,
|
||||
val isSavingMedia: Boolean = false
|
||||
) {
|
||||
val hideChromeImmediate: Boolean = isRunningSharedElementAnimation || isDisplayingFirstTimeNavigation
|
||||
|
||||
@@ -53,5 +54,6 @@ data class StoryViewerPlaybackState(
|
||||
isUserScaling ||
|
||||
isDisplayingHideDialog ||
|
||||
isDisplayingPartialSendDialog ||
|
||||
isDisplayingRecipientBottomSheet
|
||||
isDisplayingRecipientBottomSheet ||
|
||||
isSavingMedia
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user