-
-
Save KatieBarnett/6283040d053578130d256819a6165fe5 to your computer and use it in GitHub Desktop.
Collapsing LargeTopAppBar with static styling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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