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

Check whether we can scroll vertically in the drag direction #173

Merged
merged 1 commit into from Mar 15, 2021

Conversation

dtvc87
Copy link
Contributor

@dtvc87 dtvc87 commented Mar 10, 2021

I'm not familiar with the internals and I'm not sure if this has side-effects, I found this problem while testing MotionLayout. In all the examples, scrolling up triggers a layout transition, but I noticed it is not possible to trigger a layout transition scrolling down. Looks likeMotionLayout is always checking if we can scroll upwards, so if we scroll to the bottom of a RecyclerView the transition will never be triggered because target.canScrollVertically(-1) will always be true.

Here you can see a video with the fix:
https://github.com/dtvc87/constraintlayout/blob/drag_video/constraintlayout/device-2021-03-10-151947.webm
The red RecylerView pulls down the blue one and the blue RecylerView pushes up the red one, once all its scroll is consumed.

@google-cla
Copy link

google-cla bot commented Mar 10, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@dtvc87 dtvc87 force-pushed the allow_transition_scrolling_down branch from 1e3649a to a82fec6 Compare March 10, 2021 06:55
@google-cla
Copy link

google-cla bot commented Mar 10, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@dtvc87 dtvc87 force-pushed the allow_transition_scrolling_down branch from a82fec6 to 56ffb7d Compare March 10, 2021 07:00
@dtvc87 dtvc87 changed the title Check wether we can scroll vertically in the drag direction Check whether we can scroll vertically in the drag direction Mar 10, 2021
@camaelon camaelon requested a review from jafu888 March 10, 2021 21:58
@jafu888 jafu888 merged commit 8c1464d into androidx:main Mar 15, 2021
@dtvc87
Copy link
Contributor Author

dtvc87 commented Mar 16, 2021

@jafu888 @camaelon thank you for merging this! :) . I hope I can see you again at droidkaigi in Tokyo when the pandemic is over!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants