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

[SwipeRefresh] Make indicator more flexible #350

Merged
merged 6 commits into from
Apr 20, 2021
Merged

Conversation

chrisbanes
Copy link
Contributor

There are a few improvements here:

  • Added more parameters to SwipeRefresh() to tweak the positioning and padding of the indicator. This allows apps which use contentPadding on LazyRow etc, to get the indicator to match.
  • Move all positioning of the indicator to SwipeRefreshIndicator() itself. This allows devs to provide any type of indicator they want. The update custom indiciator sample shows a fade-in gradient instead demo.
  • Remove the 'refresh trigger' value from SwipeRefreshState. It's never really been part of the state, and was only there for convenience.

Useful when needing to inset the indicator in from the
start edge.
This allows us to support alternative style indicators,
such as the bundled 'glow' indicator sample.
It now lives in SwipeRefreshIndicator
It doesn't really belong there.
@google-cla google-cla bot added the cla: yes label Apr 20, 2021
@chrisbanes chrisbanes requested a review from nickbutcher April 20, 2021 08:06
Copy link
Contributor

@ricknout ricknout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor nits, existing demos look good and like the custom demo!

@chrisbanes chrisbanes merged commit 117a9fe into main Apr 20, 2021
@chrisbanes chrisbanes deleted the cb/swipe-refresh-offset branch April 20, 2021 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants