androidx / constraintlayout

ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way
Apache License 2.0
1.07k stars 176 forks source link

The issue of OnSwipe action with a recylcerview #216

Closed pokk closed 1 year ago

pokk commented 3 years ago

Thank you so much for providing and helping us through this good component.

Don't know this is fine for raising an issue with videos. If the information is not enough please let me know.

Just updated my constraint layout version to 2.1.0-beta02 but my recyclerview doesn't work with other components. The behavior on version 2.1.0-beta01 with a recyclerview was what I excepted.

https://user-images.githubusercontent.com/5198104/117118634-f8426800-adcb-11eb-82fe-631cc58bd837.mov

But 2.1.0-beta02 is

https://user-images.githubusercontent.com/5198104/117118744-1f009e80-adcc-11eb-9f35-4f25b751b535.mov

Just wondering this change is correct or I should change it on my side.

jafu888 commented 3 years ago

Post the transition you are using (including the OnSwipe) (What you posted so far is fine. )

pokk commented 3 years ago

This is my motion scence

<MotionScene
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <Transition
        android:id="@+id/transition_search_scene"
        app:constraintSetEnd="@id/collapsed"
        app:constraintSetStart="@id/expanded"
        app:duration="150">
        <KeyFrameSet>
            <KeyAttribute
                app:framePosition="50"
                app:motionTarget="@id/sov_backdrop">
                <CustomAttribute
                    app:attributeName="topLeftRadiusDp"
                    app:customFloatValue="0"/>
                <CustomAttribute
                    app:attributeName="topRightRadiusDp"
                    app:customFloatValue="0"/>
            </KeyAttribute>
        </KeyFrameSet>
        <OnSwipe
            app:dragDirection="dragUp"
            app:touchAnchorId="@id/rv_musics"/>
    </Transition>

    <ConstraintSet android:id="@+id/expanded">
        ...
    </ConstraintSet>

    <ConstraintSet android:id="@+id/collapsed">
        ...
    </ConstraintSet>
</MotionScene>
jafu888 commented 3 years ago

Does drag up move -> expand or collapse ? Try switching expand or collapse.

jafu888 commented 3 years ago

The next release will revert the offending change an put it behind a flag

pokk commented 3 years ago

@jafu888 So sorry for the late reply.

Does drag up move -> expand or collapse ? Try switching expand or collapse.

I have tried this XD But it does a wrong behavior of my expected.

Thank you so much for the help. 🙇