MaxUt
05/07/2021, 4:09 PMMaxUt
05/07/2021, 4:14 PMTopBar
.
To do so, I decided to put the Topbar
and the first content in a column with a z-index of 0 and the content that needs to slide over in a LazyColumn
with a z-index of 1. Both columns take the full height. I decided to add an offset to the LazyColumn
so the initial content would be visible. The only issue I have now is that the buttons of the TopBar
composable don't intercept click events as the LazyColumn
covers it. Any ideas how I could solve that ?
Column(
modifier = Modifier.zIndex(0f)
) {
TopBar()
Box(
contentAlignment = Alignment.TopCenter,
modifier = Modifier.fillMaxWidth().border(2.dp, Color.Red)
) {
Image(
painter = rememberGlidePainter(
productImage,
fadeIn = true
),
contentDescription = "",
modifier = Modifier.height(300.dp - 56.dp).border(2.dp, Color.Blue),
)
}
}
LazyColumn(
modifier = Modifier.zIndex(1f)
) {
item {
Column(modifier = Modifier
.offset(y = 300.dp)
.background(Color.White)
.fillMaxWidth()){
Text(text = "coucou", color = Color.Black)
Text(text = "coucou", color = Color.Black)
Text(text = "coucou", color = Color.Black)
Text(text = "coucou", color = Color.Black)
Text(text = "coucou", color = Color.Black)
Text(text = "coucou", color = Color.Black)
Text(text = "coucou", color = Color.Black)
}
}
}