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

MotionLayout bug with Recyclerview ( setTransition programmatically and back, Recyclerview Scroll did not attach to MotionLayout OnSwipe ) #849

Open
aadilmirrani opened this issue Dec 18, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@aadilmirrani
Copy link

ConstraintLayout version: 2.1.4
Recyclerview: 1.3.1

In my Android app. I have a layout consisting of an ImageView and a NestedScrollView within a ConstraintLayout. The layout is designed with three ConstraintSet states: constraints_start, constraints_end, and constraints_search.

I have set up a transition between constraints_start and constraints_end, which is triggered by a swipe gesture on the header or NestedScrollView. The XML for this transition is as follows:



The issue I'm facing is that when I programmatically set the transition state using setTransition or transitionToState, the NestedScrollView seems to scroll on its own, and the MotionLayout transition doesn't trigger immediately. However, it works as intended if I manually scroll on the header after setting the transition programmatically.

Steps to Reproduce:

Programmatically set the transition state using setTransition or transitionToState.
Observe that the NestedScrollView starts scrolling on its own.
Manually scroll on the header
After the manual scroll, the MotionLayout transition triggers as expected.
Expected Behavior:

The MotionLayout transition should be triggered programmatically without the need for a manual scroll on the header or NestedScrollView.

@aadilmirrani aadilmirrani added the bug Something isn't working label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant