This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun FirstScreen( | |
navigate: () -> Unit, | |
firstContainer: FirstContainer = rememberFirstContainer(), | |
firstViewModel: FirstViewModel = viewModel(factory = firstContainer.viewModelFactory) | |
) { | |
// content... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
private fun MainContent( | |
changeSystemBarStyle: (SystemBarStyle) -> Unit | |
) { | |
Scaffold( | |
modifier = Modifier.fillMaxSize(), | |
containerColor = Color.Black | |
) { paddingValues -> | |
LaunchedEffect(Unit) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun BoxWithConstraintsScope.draggableBox() { | |
Box( | |
modifier = Modifier | |
.fillMaxWidth() | |
.height(boxHeight) | |
.background(Color.White) | |
.align(Alignment.BottomCenter) | |
.pointerInput(Unit) { | |
detectVerticalDragGestures { change, dragAmount -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MainContent() { | |
Scaffold { paddingValues -> | |
// .... | |
val layoutDirection = LocalLayoutDirection.current | |
Box( | |
modifier = Modifier | |
.fillMaxSize() | |
.padding( | |
start = paddingValues.calculateStartPadding(layoutDirection), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
private fun MainContent( | |
changeSystemBarStyle: (SystemBarStyle) -> Unit // pass function from top level to change the SystemBarStyle | |
) { | |
Scaffold( | |
modifier = Modifier.fillMaxSize(), | |
containerColor = Color.Black | |
) { paddingValues -> | |
LaunchedEffect(Unit) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val minimumBoxHeight = 200.dp | |
val maximumBoxHeight = maxHeight - statusBarHeight // stop before covering the status bar | |
var boxHeight by remember { | |
mutableStateOf(minimumBoxHeight) | |
} | |
Box( | |
modifier = Modifier | |
.fillMaxWidth() | |
.height(boxHeight) | |
.background(Color.White) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val layoutDirection = LocalLayoutDirection.current | |
Box( | |
modifier = Modifier | |
.fillMaxSize() | |
.padding( | |
start = paddingValues.calculateStartPadding(layoutDirection), | |
end = paddingValues.calculateEndPadding(layoutDirection), | |
bottom = paddingValues.calculateBottomPadding(), | |
) | |
) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scaffold( | |
modifier = Modifier.fillMaxSize(), | |
containerColor = Color.Black | |
) { paddingValues -> | |
val layoutDirection = LocalLayoutDirection.current | |
Box( | |
modifier = Modifier | |
.fillMaxSize() | |
.padding( | |
start = paddingValues.calculateStartPadding(layoutDirection), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scaffold( | |
modifier = Modifier.fillMaxSize(), | |
containerColor = Color.Black | |
) { paddingValues -> | |
Box(modifier = Modifier.fillMaxSize().padding(paddingValues).background(Color.White)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Surface( | |
modifier = Modifier.fillMaxSize(), | |
color = Color.Blue | |
) { } |