Skip to content

Instantly share code, notes, and snippets.

@KatieBarnett
Last active December 12, 2022 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KatieBarnett/6283040d053578130d256819a6165fe5 to your computer and use it in GitHub Desktop.
Save KatieBarnett/6283040d053578130d256819a6165fe5 to your computer and use it in GitHub Desktop.
Collapsing LargeTopAppBar with static styling
...
val topAppBarTextSize = 28.sp
val topAppBarElementColor = MaterialTheme.colorScheme.onPrimary
Scaffold(
topBar = {
LargeTopAppBar(
title = { Text(text = stringResource(id = R.string.title), fontSize = topAppBarTextSize) },
navigationIcon = { NavigationIcon(navController = navController)},
actions = { AboutActionIcon(navController) },
colors = TopAppBarDefaults.largeTopAppBarColors(
containerColor = MaterialTheme.colorScheme.primary,
scrolledContainerColor = MaterialTheme.colorScheme.surface,
navigationIconContentColor = topAppBarElementColor,
titleContentColor = topAppBarElementColor,
actionIconContentColor= topAppBarElementColor,
),
scrollBehavior = scrollBehavior
)
},
modifier = modifier.nestedScroll(scrollBehavior.nestedScrollConnection)
) { innerPadding ->
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment