Skip to content

Commit

Permalink
rebase + address pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimblebee committed Sep 7, 2023
1 parent 76d80a2 commit 5549b0f
Showing 1 changed file with 20 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.Button
import androidx.compose.material3.ChipColors
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.SuggestionChip
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -147,23 +137,23 @@ fun PreviewScreen(
onNavigateToSettings = onNavigateToSettings
)

SuggestionChip(
onClick = { viewModel.toggleCaptureMode() },
modifier = Modifier
.align(Alignment.TopEnd)
.padding(12.dp),
label = {
Text(
stringResource(
if (previewUiState.singleStreamCapture) {
R.string.capture_mode_single_stream
} else {
R.string.capture_mode_multi_stream
}
)
SuggestionChip(
onClick = { viewModel.toggleCaptureMode() },
modifier = Modifier
.align(Alignment.TopEnd)
.padding(12.dp),
label = {
Text(
stringResource(
if (previewUiState.singleStreamCapture) {
R.string.capture_mode_single_stream
} else {
R.string.capture_mode_multi_stream
}
)
}
)
)
}
)

Column(
horizontalAlignment = Alignment.CenterHorizontally,
Expand Down Expand Up @@ -191,9 +181,9 @@ fun PreviewScreen(
)
/*todo: close quick settings on start record/image capture*/
CaptureButton(
onClick = { onImageCapture(viewModel) },
onLongPress = { onStartRecording(viewModel) },
onRelease = { onStopRecording(viewModel) },
onClick = { viewModel.captureImage() },
onLongPress = { viewModel.startVideoRecording() },
onRelease = { viewModel.stopVideoRecording() },
state = previewUiState.videoRecordingState
)
/* spacer is a placeholder to maintain the proportionate location of this row of
Expand All @@ -209,16 +199,4 @@ fun PreviewScreen(
}
}
}
}

fun onStartRecording(viewModel: PreviewViewModel) {
viewModel.startVideoRecording()
}

fun onStopRecording(viewModel: PreviewViewModel) {
viewModel.stopVideoRecording()
}

fun onImageCapture(viewModel: PreviewViewModel) {
viewModel.captureImage()
}
}

0 comments on commit 5549b0f

Please sign in to comment.