-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
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
ToolbarState expand(), collapse() and scroll not working when toolbar's content is set with delay #55
Comments
I do not know how your code is structured, if the coroutine scope is somehow canceled before the floating button is clicked then it might not be called. |
Thanks for the answer. The problem was I was setting the content of the toolbar after setting the content of the body. I've fixed it by doing 2 things: First I had to add a dummy 1.dp spacer to the toolbar. Second I set the toolbar content before body content. It changed my structure a little bit and made it uglier, I would make it the old way in the future :D |
I will leave it open for now. Actually I didn't think of the case where the layout is resolved with delay, maybe I should deal with it anyway :D |
Hi onebone, I faced the same problem. I have prepared an example code that shows the problem, it's based on sample code from your repository. Please tell me what is my mistake and how to make the toolbar expand when the expand() method is called? |
I have looked at your code, the toolbar seems to have a fixed height (hence it is not expandable). What layout do you expect when it is expanded? |
I expect that after hiding the toolbar when scrolling through the contents of the list, the expand method will reveal this toolbar. How can this be achieved? |
Hello, I can't expand or collapse the toolbar programmatically. It works nicely when I scroll a
lazyColumn
inside it butcollapsingToolbarScaffoldState.toolbarState.expand()
orcollapsingToolbarScaffoldState.toolbarState.collapse()
never works. I know these are in experimental state, so decided to scroll it manually but it is not working either. I will share my code below and any help would be much appreciated.I call the expand and collapse functions in an onClick callback of a FAB
The text was updated successfully, but these errors were encountered: