Skip to content
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

Support placing child at fixed position regardless of scroll state #31

Merged
merged 2 commits into from
Mar 12, 2022

Conversation

onebone
Copy link
Owner

@onebone onebone commented Jan 23, 2022

It is a common use case of collapsing toolbar to place its child at a fixed position, floating buttons, for example.

Previously, the library did not directly let users do it and should have needed to offset components manually with the scrollY state. With this change, it is now possible to place it with the new modifier Modifier.align in the CollapsingToolbarScaffold body. This is somewhat similar to layout_gravity property in the Jetpack's CollapsingToolbarLayout.

Usage example can be found at ParallaxActivity.kt in the app module.

Backwards compatibility

body parameter at CollapsingToolbarScaffold changes its signature from () -> Unit to CollapsingToolbarScaffoldScope.() -> Unit. Although it is a non-breaking change in general, there might be some use cases where body lambda is initialized somewhere before then passing the lambda to the function which causes type incompatible error.

@onebone onebone added feature New feature or request api Improvement of existing library contracts that may break backwards compatibility labels Jan 23, 2022
@onebone
Copy link
Owner Author

onebone commented Feb 13, 2022

@twist062021 What is this??

@Nek-12
Copy link

Nek-12 commented Mar 12, 2022

@onebone What currently stops this PR from being merged?

@onebone
Copy link
Owner Author

onebone commented Mar 12, 2022

@onebone What currently stops this PR from being merged?

I was trying to find some edge cases, looks like it has taken too long.....

@onebone onebone merged commit b77ac97 into master Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Improvement of existing library contracts that may break backwards compatibility feature New feature or request
Projects
None yet
3 participants