Motion layout(alpha4) issue with recyclerview onswipe item
See original GitHub issueI am using alpha4 implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4'
of constraint layout. First I created a single layout and do onswipe animation it is working perfectly with motion layout then I patched the layout with a recyclerview. Now problem comes into picture
Issue:
- If I am doing onswipe in a particular item of rv then it’s getting lagged.
- Suppose I am doing swipe on the 1st item of the rv now after full swipe you will find that same swiped has already happen with 13th no item, 25th no item and so on. So after every 12 item same swipe you can check while you are scrolling.
I have posted the whole project in Github and also created a sample video.
For quick gist of motion layout here is the link. And here is the layout desc link.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Motion layout(alpha4) issue with recyclerview onswipe item
I am using alpha4 implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4' of constraint layout. First I created a single layout ...
Read more >[MotionLayout] Recyclerview inside ... - Issue Tracker
When a RecyclerView is inside a MotionLayout, it does not update its items on `notifyDataSetChanged()` and the `onBindViewHolder` method is not called. However, ......
Read more >ItemTouchHelper.Callback - Android Developers
If user drags an item, ItemTouchHelper will call onMove(recyclerView, dragged, target) . Upon receiving this callback, you should move the item from the...
Read more >RecyclerView scrolling issue in android MotionLayout-kotlin
You should determine two transition one startToEnd one endToStart after that add keyAttribute for things that is alpha zero like this
Read more >MotionLayout with RecycleView tutorial Android (2021)
Android # MotionLayout #RecycleViewIn this video I'll show you how to use RecycleView as MotionLayout onSwipe trigger.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Finally the issue is fixed by one of colleague. @Srini Thanks for the solution.
Just need to override this method in adapter of recyclerview.
[Note:]Still the lag is there while swiping.
About how to reset - yes, right on point, constraint set would solve it easy.
I don’t know if it’d solve the frame drops, I didn’t really experiment with MotionLayout in RecyclerView. What you can do is get a systrace to see what’s causing frame drops. If it’s MotionLayout related then you can create a new issue with the information you have 👍.