diff --git a/feature/media-send/src/main/java/org/signal/mediasend/screens/edit/MediaEditorToolbar.kt b/feature/media-send/src/main/java/org/signal/mediasend/screens/edit/MediaEditorToolbar.kt index a047a73db4..04d4396d6e 100644 --- a/feature/media-send/src/main/java/org/signal/mediasend/screens/edit/MediaEditorToolbar.kt +++ b/feature/media-send/src/main/java/org/signal/mediasend/screens/edit/MediaEditorToolbar.kt @@ -161,8 +161,15 @@ internal fun MediaEditorToolbarSharedButtons( } } +/** + * Gifs are exempt along with documents: an image/gif is never re-encoded on send, and the mp4s we treat as gifs are + * already sized by whoever handed them to us, so a quality choice there is a control that does nothing. + */ private fun isQualityVisible(state: MediaEditState, editorState: EditorState): Boolean { - return !state.isStory && editorState !is EditorState.Document + return !state.isStory && + editorState !is EditorState.Document && + editorState !is EditorState.Gif && + editorState !is EditorState.VideoGif } private fun isSaveVisible(editorState: EditorState): Boolean { diff --git a/feature/media-send/src/test/java/org/signal/mediasend/screens/edit/MediaEditorToolbarSharedButtonsTest.kt b/feature/media-send/src/test/java/org/signal/mediasend/screens/edit/MediaEditorToolbarSharedButtonsTest.kt index d9de08525e..848de65842 100644 --- a/feature/media-send/src/test/java/org/signal/mediasend/screens/edit/MediaEditorToolbarSharedButtonsTest.kt +++ b/feature/media-send/src/test/java/org/signal/mediasend/screens/edit/MediaEditorToolbarSharedButtonsTest.kt @@ -28,9 +28,8 @@ import org.signal.mediasend.MediaSendDependenciesRule import org.signal.mediasend.test.TestTags /** - * Covers which of the shared toolbar actions each kind of media gets, which is the parity contract with the v2 review - * screen: send quality is meaningless for stories and documents, saving is for stills only, and adding media is off the - * table for documents and view-once sends. + * Covers which of the shared toolbar actions each kind of media gets: send quality is meaningless for stories, + * documents and gifs, saving is for stills only, and adding media is off the table for documents and view-once sends. */ @RunWith(RobolectricTestRunner::class) @Config(application = Application::class) @@ -55,10 +54,10 @@ class MediaEditorToolbarSharedButtonsTest { } @Test - fun `Given a gif, when rendering the toolbar, then quality, save and add media are offered`() { + fun `Given a gif, when rendering the toolbar, then quality is not offered`() { setContent(state(media = GIF), EditorState.Gif) - assertQuality(visible = true) + assertQuality(visible = false) assertSave(visible = true) assertAddMedia(visible = true) } @@ -73,10 +72,10 @@ class MediaEditorToolbarSharedButtonsTest { } @Test - fun `Given a video gif, when rendering the toolbar, then saving is not offered`() { + fun `Given a video gif, when rendering the toolbar, then quality and saving are not offered`() { setContent(state(media = VIDEO_GIF), EditorState.VideoGif) - assertQuality(visible = true) + assertQuality(visible = false) assertSave(visible = false) assertAddMedia(visible = true) }