We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to scroll my list and collapse my toolbar to show scroll items but when i call collapse() it not working. following is the my compose method.
collapse()
@Composable fun Collapsing() { val scope = rememberCoroutineScope() val rememberLazyListState = rememberLazyListState() val scaffoldState = rememberCollapsingToolbarScaffoldState() CollapsingToolbarScaffold( state = scaffoldState, scrollStrategy = ScrollStrategy.EnterAlwaysCollapsed,// provide the state of the scaffold toolbar = { Text(text = "My Activity", modifier = Modifier .fillMaxWidth() .height(200.dp) .background(color = Color.Red) .clickable { scope.launch { scaffoldState.toolbarState.scroll { scrollBy(-scaffoldState.toolbarState.height.toFloat()) } rememberLazyListState.scrollToItem(50) } }) }, body = { LazyColumn(modifier = Modifier.fillMaxSize(), state = rememberLazyListState) { items(100) { Row( modifier = Modifier .fillMaxWidth() .clickable { scope.launch { rememberLazyListState.scrollToItem(50) } }, ) { Text(modifier = Modifier.padding(16.dp), text = it.toString()) } } } }, modifier = Modifier, ) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to scroll my list and collapse my toolbar to show scroll items but when i call
collapse()
it not working. following is the my compose method.The text was updated successfully, but these errors were encountered: