-
Notifications
You must be signed in to change notification settings - Fork 597
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] Add swipe up to refresh feature #541
Conversation
- make topSwipeRefreshState optional so the user will have the choice to use topSwipeRefreshState, bottomSwipeRefreshState or both.
- The bottom indicator wasn't following the user's gesture when he swipes down. The indicators are supposed to follow the user gesture until he stops swiping or the indicator reaches the max offset - Fix it by consumming the scroll in the `SwipeRefreshNestedScrollConnection`
- update the doc to take into account the parameters related to the bottom SwipeRefreshIndicator
- change topSwipeRefreshState and bottomSwipeRefreshState to topRefreshIndicatorState and bottomRefreshIndicatorState
- Change the Bottom position sample's activity title
- Create docsamples package and create docsamples/BidirectionalSwipeRefreshSample.kt file - rename DocsSamples.kt to docsamples/SimpleSample.kt
- Add doc and code sample for bottom and bidirectional swipe refresh - add demo video for bottom refresh indicator
Review needed |
- update the APIs of SwipeRefresh and SwipeRefreshIndicator to accept one state - use the positin parameter to specify the SwipeRefresh position - update the SwipeRefreshIndicator api to accept a senseOfRotation parameter
- Update the indicator alignment parameter to accept only horizontal alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly there! Just some comments about the API.
As this is changing the API, we need to update the API files. Please run: ./gradlew metalavaGenerateSignature
swiperefresh/src/main/java/com/google/accompanist/swiperefresh/SwipeRefresh.kt
Outdated
Show resolved
Hide resolved
swiperefresh/src/main/java/com/google/accompanist/swiperefresh/SwipeRefresh.kt
Outdated
Show resolved
Hide resolved
swiperefresh/src/main/java/com/google/accompanist/swiperefresh/SwipeRefresh.kt
Outdated
Show resolved
Hide resolved
swiperefresh/src/main/java/com/google/accompanist/swiperefresh/SwipeRefresh.kt
Outdated
Show resolved
Hide resolved
swiperefresh/src/main/java/com/google/accompanist/swiperefresh/CircularProgressPainter.kt
Outdated
Show resolved
Hide resolved
- reset the `SwipeRefresh` signature - update test and docs
Some unresolved comments and conflicts. |
# Conflicts: # gradle/libs.versions.toml # swiperefresh/src/sharedTest/kotlin/com/google/accompanist/swiperefresh/SwipeRefreshTest.kt
- Add explicit android:exported="true" in AndroidManifest.xml for Android 12 support (for activities SwipeRefreshBottomPositionSample and BidirectionalSwipeRefreshSample
- Replace rememberGlidePainter by rememberImagePainter in BidirectionalSwipeRefreshSample and SwipeRefreshBottomPositionSample
- Some tests had been removed while merging from the main brance (fixed that). - Replace 'SemanticsNodeInteraction.performGesture' (which is deprecaded) by 'SemanticsNodeInteraction.performTouchInput'.
@JoseAlcerreca, I resolved them. |
|
Hi, is this going to be implemented? I would like to swipe up from the bottom. |
@phamsarah lt actually have been implemented since a year now, just not merged yet. If the maintainers will review and merge it, I will fix the conflict. |
Make the swipe to refresh bidirectional, as proposed in #516