mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-23 10:12:07 +01:00
Hide the send quality toggle for gifs.
This commit is contained in:
+8
-1
@@ -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 {
|
||||
|
||||
+6
-7
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user