Skip to content

Instantly share code, notes, and snippets.

@KatieBarnett
Last active December 11, 2022 10:19
Show Gist options
  • Save KatieBarnett/35af5b28f688c8a23e8ce95595f46915 to your computer and use it in GitHub Desktop.
Save KatieBarnett/35af5b28f688c8a23e8ce95595f46915 to your computer and use it in GitHub Desktop.
Non-collapsable LargeTopAppBar
val viewModel: MainViewModel = hiltViewModel()
val items: List<Int> by viewModel.items.collectAsState(initial = emptyList())
Scaffold(
topBar = {
LargeTopAppBar(
title = { Text(text = stringResource(id = R.string.title)) },
navigationIcon = { NavigationIcon(navController = navController)},
actions = { AboutActionIcon(navController) }
)
}
) { innerPadding ->
LazyColumn(modifier = Modifier
.fillMaxSize()
.padding(innerPadding)) {
items(items) { item ->
Text(
text = stringResource(id = R.string.item_text, item),
style = MaterialTheme.typography.headlineMedium,
modifier = Modifier.padding(Dimen.spacing)
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment