diff --git a/ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/CaptureLayout.kt b/ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/CaptureLayout.kt index e0d41551f..a0304b5c9 100644 --- a/ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/CaptureLayout.kt +++ b/ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/CaptureLayout.kt @@ -77,6 +77,7 @@ import androidx.compose.ui.unit.dp * @param debugVisibilityWrapper A wrapper that conditionally hides its contents based on debug settings * @param screenFlashOverlay the screen flash overlay composable * @param snackBar the snack bar composable for showing messages + * @param topStartContent optional composable content aligned to the top-start of the viewfinder */ @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -102,7 +103,8 @@ fun PreviewLayout( debugOverlay: @Composable (Modifier) -> Unit, debugVisibilityWrapper: (@Composable (@Composable () -> Unit) -> Unit), screenFlashOverlay: @Composable (Modifier) -> Unit, - snackBar: @Composable (Modifier, snackbarHostState: SnackbarHostState) -> Unit + snackBar: @Composable (Modifier, snackbarHostState: SnackbarHostState) -> Unit, + topStartContent: @Composable (Modifier) -> Unit = {} ) { val overlapTargetBounds = remember { mutableStateOf(Rect.Zero) } @@ -139,7 +141,10 @@ fun PreviewLayout( Box(modifier = Modifier.fillMaxSize().background(Color.Black)) { Column { indicatorRow(Modifier.statusBarsPadding()) - viewfinder(Modifier) + Box { + viewfinder(Modifier) + topStartContent(Modifier.align(Alignment.TopStart)) + } } Box(