Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Composable
- private fun TestCollapsing() {
- val state = rememberCollapsingToolbarState()
- val textSize = (18 + (30 - 18) * state.progress).sp
- AppBarContainer(
- scrollStrategy = ScrollStrategy.ExitUntilCollapsed,
- collapsingToolbarState = state,
- ) {
- CollapsingToolbar(collapsingToolbarState = state) {
- Box(
- modifier = Modifier
- .background(MaterialTheme.colors.primary)
- .fillMaxWidth()
- .height(150.dp)
- .pin()
- )
- Text(
- text = "Title",
- modifier = Modifier
- .road(Alignment.CenterStart, Alignment.BottomEnd)
- .padding(60.dp, 16.dp, 16.dp, 16.dp),
- color = Color.White,
- fontSize = textSize
- )
- }
- LazyColumn(modifier = Modifier.appBarBody()) {
- items(50) { index ->
- Text(
- "I'm item $index", modifier = Modifier
- .fillMaxWidth()
- .padding(16.dp)
- )
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement