MotionLayout: After transition horizontal recyclerview doesn't display the first element

546 Views Asked by At

I'm trying to implement a Transition but I have an issue with the first element of the recyclerview. Currently, the transition looks like this:

When the transition ends the first element is not displayed

When the transition ends the first element in the recyclerview is not displayed, but after I've scrolled.

Currently, I use:

  • ConstraintLayout 2.0.0
  • RecyclerView 1.1.0

My MotionScene file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:app="http://schemas.android.com/apk/res-auto">

    <Transition
        app:constraintSetEnd="@layout/activity_main_motion_layout_end"
        app:constraintSetStart="@layout/activity_main_motion_layout_start"
        app:layoutDuringTransition="honorRequest"
        app:motionInterpolator="linear">
        <OnSwipe
            app:dragDirection="dragUp"
            app:touchAnchorSide="top" />
    </Transition>
</MotionScene>

The layouts could be find in my repo:

1

There are 1 best solutions below

0
On BEST ANSWER

In the end, I've solved this issue by adding the data loading for the recycleview using MotionLayout.TransitionListener interface