allan.conda
04/08/2021, 12:02 PMTopAppBar
for each of your screen? Or share a single one and somehow manage to customize it (set title, navigation icon)?
I’m trying to do the latter with compose-navigation
in a multi-modular context, and now contemplating whether this is really a good idea…Kari Kähkönen
04/08/2021, 12:22 PMLucien Guimaraes
04/08/2021, 12:36 PMfun MyTopAppBar(
modifier: Modifier,
backgroundColor: Color,
elevation: Dp,
onBackPressed: () -> Unit,
actions: @Composable RowScope.() -> Unit = {},
) {
TopAppBar(
modifier = modifier,
backgroundColor = backgroundColor,
elevation = elevation,
contentColor = MaterialTheme.colors.onSurface,
navigationIcon = {
IconButton(
modifier = Modifier.background(
color = MaterialTheme.colors.surface,
shape = CircleShape
),
onClick = { onBackPressed() },
) {
Icon(
imageVector = Icons.Filled.ArrowBack,
contentDescription = null,
tint = MaterialTheme.colors.onSurface,
)
}
},
actions = actions,
)
}
allan.conda
04/08/2021, 12:52 PMBryan Herbst
04/08/2021, 1:12 PMComposable
function without sharing the same instance of the app baralorma
04/08/2021, 1:23 PM