Skip to content

Instantly share code, notes, and snippets.

@RaheemJnr
Last active October 10, 2021 08:47
Show Gist options
  • Save RaheemJnr/bd142912f30dc7aea36de7e74f78cadb to your computer and use it in GitHub Desktop.
Save RaheemJnr/bd142912f30dc7aea36de7e74f78cadb to your computer and use it in GitHub Desktop.
@Composable
fun BottomBarWithFabDem() {
val navController = rememberNavController()
Scaffold(
bottomBar = {
BottomAppBar(
modifier = Modifier
.height(65.dp)
.clip(RoundedCornerShape(15.dp, 15.dp, 0.dp, 0.dp)),
cutoutShape = CircleShape,
//backgroundColor = Color.White,
elevation = 22.dp
) {
BottomNav(navController = navController)
}
},
floatingActionButtonPosition = FabPosition.Center,
isFloatingActionButtonDocked = true,
floatingActionButton = {
FloatingActionButton(
shape = CircleShape,
onClick = {
Screen.Camera.route?.let {
navController.navigate(it) {
popUpTo(navController.graph.findStartDestination().id) {
saveState = true
}
launchSingleTop = true
restoreState = true
}
}
Screen.Camera.route?.let { navController.navigate(it) }
},
contentColor = Color.White
) {
Icon(imageVector = Icons.Filled.CameraAlt, contentDescription = "Add icon")
}
}
) {
MainScreenNavigation(navController)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment