faogustavo
04/03/2024, 3:52 PMfaogustavo
04/03/2024, 3:52 PMfaogustavo
04/03/2024, 3:53 PMfaogustavo
04/03/2024, 3:53 PM.ignoresSafeArea(.all)
does the trick. However, the project still uses UIKit, and we are using the UINavigationController
to present the VC returned from compose.faogustavo
04/03/2024, 3:53 PMfaogustavo
04/03/2024, 3:54 PM// VC Declaration
fun ComposeTestViewController(
onBackPress: () -> Unit,
) = ComposeUIViewController(
configure = {
accessibilitySyncOptions = AccessibilitySyncOptions.Always(debugLogger = null)
},
) {
ComposeTestScreen(onBackPress)
}
// Composable Declaration
@Composable
fun ComposeTestScreen(onBackPress: () -> Unit) {
MaterialTheme {
Scaffold(
topBar = {
TopAppBar(
title = { Text("Compose Test") },
navigationIcon = {
IconButton(
modifier = Modifier.testTag("TopAppBar/BackButton"),
onClick = onBackPress,
) {
Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = null)
}
},
modifier = Modifier.fillMaxWidth(),
)
},
) { paddings ->
Column(
modifier = Modifier.fillMaxWidth()
.padding(paddings)
.padding(horizontal = 16.dp)
.verticalScroll(rememberScrollState()),
) {
InputFieldTest()
}
}
}
}
faogustavo
04/03/2024, 3:54 PM// Create instance
let flowNavigationController = UINavigationController()
// Initiate and present
let displayedViewController = // Logic to get initial VC, usually a VC using UIKit
flowNavigationController.viewControllers = [displayedViewController]
rootViewController = presentingViewController
presentingViewController.present(
flowNavigationController,
animated: true
)
// Show Compose VC on a click or something like that
let viewController = ComposeTestViewController(
onBackPress: { [weak self] in self?.popBack() }
)
flowNavigationController.isNavigationBarHidden = true
flowNavigationController.pushViewController(
viewController,
animated: true
)
Elijah Semyonov
04/04/2024, 6:47 AMfaogustavo
04/04/2024, 11:31 AMElijah Semyonov
04/04/2024, 11:32 AMfaogustavo
04/04/2024, 11:32 AMfaogustavo
04/04/2024, 1:39 PMDavidB
04/07/2024, 3:32 AMElijah Semyonov
04/07/2024, 6:08 AMDavidB
04/07/2024, 7:17 PMElijah Semyonov
04/07/2024, 7:17 PMLucca Beurmann
05/29/2024, 1:18 PMLucca Beurmann
05/29/2024, 3:04 PMLucca Beurmann
05/29/2024, 3:05 PMElijah Semyonov
05/29/2024, 3:27 PMElijah Semyonov
05/29/2024, 3:29 PMLucca Beurmann
05/29/2024, 3:29 PMElijah Semyonov
05/29/2024, 3:30 PMLucca Beurmann
05/29/2024, 3:32 PM