Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicity specify the sizes of top composables #28

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ fun MainNavigation(
popEnterTransition = { AnimationConstants.enterTransition },
exitTransition = { AnimationConstants.exitTransition },
popExitTransition = { AnimationConstants.exitTransition },
modifier = modifier,
) {
composable(
route = "home",
) {
Home(
modifier = modifier,
modifier = Modifier.fillMaxSize(),
onChatClicked = { chatId -> navController.navigate("chat/$chatId") },
)
}
Expand All @@ -116,7 +117,7 @@ fun MainNavigation(
onPhotoPickerClick = { navController.navigateToPhotoPicker(chatId) },
onVideoClick = { uri -> navController.navigate("videoPlayer?uri=$uri") },
prefilledText = text,
modifier = modifier,
modifier = Modifier.fillMaxSize(),
)
}
composable(
Expand Down Expand Up @@ -144,6 +145,7 @@ fun MainNavigation(
}
},
chatId = chatId,
modifier = Modifier.fillMaxSize(),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import kotlinx.coroutines.asExecutor
fun Camera(
chatId: Long,
onMediaCaptured: (Media?) -> Unit,
modifier: Modifier = Modifier,
viewModel: CameraViewModel = hiltViewModel(),
) {
var surfaceProvider by remember { mutableStateOf<Preview.SurfaceProvider?>(null) }
Expand Down Expand Up @@ -177,7 +178,7 @@ fun Camera(
}

if (cameraAndRecordAudioPermissionState.allPermissionsGranted) {
Box(modifier = Modifier.background(color = Color.Black)) {
Box(modifier = modifier.background(color = Color.Black)) {
Column(verticalArrangement = Arrangement.Bottom) {
Row(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,19 @@ import com.google.android.samples.socialite.R

@OptIn(ExperimentalPermissionsApi::class)
@Composable
fun CameraAndRecordAudioPermission(permissionsState: MultiplePermissionsState, onBackClicked: () -> Unit) {
fun CameraAndRecordAudioPermission(
permissionsState: MultiplePermissionsState,
modifier: Modifier = Modifier,
onBackClicked: () -> Unit,
) {
var alreadyRequestedCameraPermissions by remember { mutableStateOf(false) }
fun onRequestPermissionsClicked() {
permissionsState.launchMultiplePermissionRequest()
alreadyRequestedCameraPermissions = true
}

Box(
modifier = Modifier.fillMaxSize(),
modifier = modifier.fillMaxSize(),
contentAlignment = Alignment.Center,
) {
Column(
Expand Down