John O'Reilly
08/07/2020, 4:38 PMScaffold
and the LazyColumnFor
looks to be overlapping with BottomAppBar
...is there some modifier etc I should be using in this case (will add more code in thread)....Scaffold(
topBar = {
TopAppBar(title = { Text("Bike Share") })
},
bodyContent = {
LazyColumnFor(items = stationsState.value) { station ->
StationView(station)
}
},
bottomBar = {
BottomAppBar(content = {
BottomNavigationItem(icon = { Icon(Icons.Default.LocationOn) }, label = { Text("Galway") },
selected = bottomBarSelectedIndex == 0,
onSelect = {
bottomBarSelectedIndex = 0
bikeShareViewModel.setCity("galway")
})
BottomNavigationItem(icon = { Icon(Icons.Default.LocationOn) }, label = { Text("Oslo") },
selected = bottomBarSelectedIndex == 1,
onSelect = {
bottomBarSelectedIndex = 1
bikeShareViewModel.setCity("oslo-bysykkel")
})
})
}
)
matvei
08/07/2020, 4:40 PMbodyContent
lambda has a parameter innerPadding
, please, apply it as a contentPadding
parameter in the LazyColumnFor
and it should workbodyContent = { innerPadding ->
LazyColumnFor(
contentPadding = innerPadding,
items = stationsState.value) { station ->
StationView(station)
}
},
John O'Reilly
08/07/2020, 4:43 PMmatvei
08/07/2020, 4:45 PMbottomBar
in case it's semi-transparent or has a cutout, so with this contentPadding
you will be able to see all content when scrolled down, but content will scroll under the bottomBar
anywayJosh Feinberg
08/07/2020, 10:10 PMModifier.padding(innerPadding)
, Is there benefit of contentPadding
over this?manueldidonna
08/08/2020, 10:38 AMmatvei
08/10/2020, 10:42 AMScrollableRow(contentPadding = innerPadding) {
text.forEach { Text(it) }
}
is equals to
ScrollableRow() {
Row(modifier=Modifier.padding(innerPadding)) {
text.forEach { Text(it) }
}
}
but without additional Row.
We provide this shortcut so it's easier to use with Scaffold
and you don't need additional layout strategy inside the ScrollableRow