Camera screen: modify layout
This commit is contained in:
@@ -25,7 +25,6 @@ import androidx.compose.animation.core.updateTransition
|
|||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.LocalIndication
|
import androidx.compose.foundation.LocalIndication
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@@ -198,7 +197,7 @@ private fun CameraScreenScaffold(
|
|||||||
.padding(bottom = innerPadding.calculateBottomPadding())
|
.padding(bottom = innerPadding.calculateBottomPadding())
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
) {
|
) {
|
||||||
CameraPreviewWithOverlay(cameraPreview, cameraUiState)
|
CameraPreviewWithOverlay(cameraPreview, cameraUiState, Modifier.align(Alignment.BottomCenter))
|
||||||
if (cameraUiState.isDebugMode) {
|
if (cameraUiState.isDebugMode) {
|
||||||
MessageBox(cameraUiState.liveAnalysisState.inferenceTime)
|
MessageBox(cameraUiState.liveAnalysisState.inferenceTime)
|
||||||
}
|
}
|
||||||
@@ -283,9 +282,8 @@ fun CaptureButton(onClick: () -> Unit, modifier: Modifier) {
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(72.dp)
|
.size(72.dp)
|
||||||
.border(
|
.background(
|
||||||
width = 4.dp,
|
color = MaterialTheme.colorScheme.surfaceContainer.copy(alpha = 0.5f),
|
||||||
color = color.copy(alpha = 0.5f),
|
|
||||||
shape = CircleShape
|
shape = CircleShape
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -301,6 +299,7 @@ fun CaptureButton(onClick: () -> Unit, modifier: Modifier) {
|
|||||||
private fun CameraPreviewWithOverlay(
|
private fun CameraPreviewWithOverlay(
|
||||||
cameraPreview: @Composable () -> Unit,
|
cameraPreview: @Composable () -> Unit,
|
||||||
cameraUiState: CameraUiState,
|
cameraUiState: CameraUiState,
|
||||||
|
modifier: Modifier,
|
||||||
) {
|
) {
|
||||||
val captureState = cameraUiState.captureState
|
val captureState = cameraUiState.captureState
|
||||||
val width = LocalConfiguration.current.screenWidthDp
|
val width = LocalConfiguration.current.screenWidthDp
|
||||||
@@ -316,7 +315,7 @@ private fun CameraPreviewWithOverlay(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = modifier
|
||||||
.width(width.dp)
|
.width(width.dp)
|
||||||
.height(height.dp)
|
.height(height.dp)
|
||||||
) {
|
) {
|
||||||
@@ -389,10 +388,10 @@ fun CameraScreenFooter(
|
|||||||
lastTapTime = currentTime
|
lastTapTime = currentTime
|
||||||
}
|
}
|
||||||
|
|
||||||
Column (modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer)) {
|
Column (modifier = Modifier.background(MaterialTheme.colorScheme.surfaceContainer)) {
|
||||||
pageList()
|
pageList()
|
||||||
BottomAppBar(
|
BottomAppBar(
|
||||||
tonalElevation = 4.dp,
|
containerColor = Color.Transparent
|
||||||
) {
|
) {
|
||||||
Row (
|
Row (
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
@@ -60,9 +60,7 @@ fun CommonPageList(
|
|||||||
LazyRow (
|
LazyRow (
|
||||||
state = listState,
|
state = listState,
|
||||||
contentPadding = PaddingValues(4.dp),
|
contentPadding = PaddingValues(4.dp),
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxWidth(),
|
||||||
.fillMaxWidth()
|
|
||||||
.background(MaterialTheme.colorScheme.surfaceContainerLow),
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user