henrikhorbovyi
06/04/2020, 11:54 PMRow
inside BottomAppBar.content
Steve
06/04/2020, 11:57 PMhenrikhorbovyi
06/04/2020, 11:59 PM@Composable
fun BottomAppBarSample() {
Scaffold(
floatingActionButtonPosition = Scaffold.FabPosition.CenterDocked,
floatingActionButton = {
FloatingActionButton(
onClick = {},
icon = { Icon(asset = Icons.Outlined.Check, tint = Color.White) }
)
},
bottomAppBar = { fabConfiguration ->
BottomAppBar(
cutoutShape = CircleShape,
fabConfiguration = fabConfiguration
) {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween
) {
IconButton(icon = { Icon(asset = <http://Icons.Outlined.Menu|Icons.Outlined.Menu>) }, onClick = {})
IconButton(icon = { Icon(asset = Icons.Outlined.Notifications) }, onClick = {})
}
}
}
) {}
}
Louis Pullen-Freilich [G]
06/05/2020, 12:02 AMRowScope
, because its internal layout is a Row. So you can actually remove your row (saving a layout and some code verbosity), and just write:
BottomAppBar(
cutoutShape = CircleShape,
fabConfiguration = fabConfiguration
) {
IconButton(...)
Spacer(Modifier.weight(1f, true))
IconButton(...)
}
Note the Spacer
herehenrikhorbovyi
06/05/2020, 1:15 PM