I am working on Jetpack Compose
in an Android application. So I want to use BottomAppBar
with a transparent cutoutShape
. Never found any example, can someone help?
I want to make the white background around the FAB transparent.
The actual result (not the expected one) : A BottomAppBar without a transparent cutoutShape
The code I use :
val fabShape = RoundedCornerShape(50)
Scaffold(
floatingActionButton = {
FloatingActionButton(
onClick = {
navController.navigate(Routes.signUp)
},
shape = fabShape,
backgroundColor = Color(0xFFFF8C00)
) {
Icon(Icons.Filled.Add, "")
}
},
isFloatingActionButtonDocked = true,
floatingActionButtonPosition = FabPosition.Center,
bottomBar = {
BottomAppBar(
cutoutShape = fabShape,
content = {
BottomNavigation {
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentDestination = navBackStackEntry?.destination
items.forEachIndexed { index, screen ->
BottomNavigationItem(
...
)
}
}
}
)
}
) { innerPadding ->
internalView(innerPadding)
}