Skip to content

Commit

Permalink
Fixing #71 - size of overlay containing capture and convert icons to …
Browse files Browse the repository at this point in the history
…match parent, so that modifier passed for the button is applied correctly (mainly for alignment of buttons)
  • Loading branch information
shtolik committed Mar 12, 2024
1 parent 43d3149 commit 5994ec3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.camera.core.Preview
import androidx.camera.lifecycle.ProcessCameraProvider
import androidx.camera.view.PreviewView
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -69,6 +70,7 @@ actual fun PeekabooCamera(
modifier = modifier,
)
CompatOverlay(
modifier = Modifier.fillMaxSize(),
state = state,
captureIcon = captureIcon,
convertIcon = convertIcon,
Expand All @@ -79,12 +81,13 @@ actual fun PeekabooCamera(

@Composable
private fun CompatOverlay(
modifier: Modifier,
state: PeekabooCameraState,
captureIcon: @Composable (onClick: () -> Unit) -> Unit,
convertIcon: @Composable (onClick: () -> Unit) -> Unit,
progressIndicator: @Composable () -> Unit,
) {
Box {
Box(modifier = modifier) {
captureIcon(state::capture)
convertIcon(state::toggleCamera)
if (state.isCapturing) {
Expand Down

0 comments on commit 5994ec3

Please sign in to comment.