Add video mute toast.

This commit is contained in:
Alex Hart
2026-08-11 16:22:38 -03:00
parent 4c796b77b3
commit 24fffdf25e
2 changed files with 13 additions and 1 deletions
@@ -928,10 +928,20 @@ class MediaSendFlowViewModel(
val snapshot = state.value
val uri = snapshot.focusedMedia?.uri ?: return
val existing = snapshot.editorStateMap[uri] as? EditorState.VideoTrim ?: return
val updated = existing.copy(videoTrimData = existing.videoTrimData.copy(isMuted = !existing.videoTrimData.isMuted))
val isNowMuted = !existing.videoTrimData.isMuted
val updated = existing.copy(videoTrimData = existing.videoTrimData.copy(isMuted = isNowMuted))
updateState { copy(editorStateMap = editorStateMap + (uri to updated)) }
if (isNowMuted) {
internalToastEvents.trySend(
ToastEvent(
icon = SignalIcons.SpeakerSlash,
message = ToastMessage.Text(R.string.MediaSendViewModel__video_will_be_sent_without_audio)
)
)
}
snapshot.selectedMedia.firstOrNull { it.uri == uri }?.let { preUploadController.cancelUpload(it) }
}
@@ -231,6 +231,8 @@
</plurals>
<!-- Message shown when saving the media being edited requires the storage permission, but that permission has been permanently denied by the user. -->
<string name="MediaSendViewModel__signal_needs_the_storage_permission">Signal needs the Storage permission in order to save to external storage, but it has been permanently denied. Please continue to app settings, select \"Permissions\", and enable \"Storage\".</string>
<!-- Message shown when the user disables audio on a video -->
<string name="MediaSendViewModel__video_will_be_sent_without_audio">Video will be sent without audio</string>
<!-- The title of a dialog notifying that a user was found matching a scanned QR code. The placeholder is a username. Usernames are always latin characters. -->
<string name="UsernameScannedDialog__username_dialog_title">Found %1$s</string>