Add draw anywhere to blur pill to media-send.

This commit is contained in:
Alex Hart
2026-08-10 16:32:54 -04:00
committed by Greyson Parrelli
parent 196c33c62b
commit 752fb39719
3 changed files with 58 additions and 5 deletions
@@ -62,6 +62,7 @@ import org.signal.mediasend.screens.edit.document.DocumentPage
import org.signal.mediasend.screens.edit.image.BlurFacesBar
import org.signal.mediasend.screens.edit.image.BrushWidthBar
import org.signal.mediasend.screens.edit.image.BrushWidthPreview
import org.signal.mediasend.screens.edit.image.DrawAnywhereToBlurPill
import org.signal.mediasend.screens.edit.image.DrawModeColorBar
import org.signal.mediasend.screens.edit.image.ImageEditor
import org.signal.mediasend.screens.edit.image.ImageEditorClearAllButton
@@ -386,11 +387,15 @@ internal fun MediaEditScreen(
.padding(top = 10.dp)
.systemBarsPadding()
) {
MediaEditSummaryPill(
displayName = displayName,
selectedMedia = state.selectedMedia,
selectedPage = pagerState.currentPage
)
if (imageController?.isUserBlurring == true) {
DrawAnywhereToBlurPill()
} else {
MediaEditSummaryPill(
displayName = displayName,
selectedMedia = state.selectedMedia,
selectedPage = pagerState.currentPage
)
}
}
ImageEditorUndoRedoButtons(
@@ -0,0 +1,45 @@
/*
* Copyright 2026 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.signal.mediasend.screens.edit.image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import org.signal.core.ui.compose.DayNightPreviews
import org.signal.core.ui.compose.Previews
import org.signal.core.ui.compose.theme.SignalTheme
import org.signal.mediasend.R
@Composable
internal fun DrawAnywhereToBlurPill() {
Text(
text = stringResource(R.string.DrawAnywhereToBlurPill__draw_anywhere_to_blur),
style = MaterialTheme.typography.bodyMedium,
modifier = Modifier
.background(
color = SignalTheme.colors.colorSurface5,
shape = CircleShape
)
.padding(
horizontal = 12.dp,
vertical = 8.dp
)
)
}
@DayNightPreviews
@Composable
private fun DrawAnywhereToBlurPillPreview() {
Previews.Preview {
DrawAnywhereToBlurPill()
}
}
@@ -100,6 +100,9 @@
<!-- Label for the toggle that blurs every face in the image being edited -->
<string name="BlurFacesBar__blur_faces">Blur faces</string>
<!-- Hint displayed in a pill at the top of the image editor telling the user they can drag anywhere on the image to blur that area -->
<string name="DrawAnywhereToBlurPill__draw_anywhere_to_blur">Draw anywhere to blur</string>
<!-- Content description for the button that cycles the text being edited between styles -->
<string name="TextModeColorBar__toggle_between_text_styles">Toggle between text styles</string>