BenFarhat Souhaib
BenFarhat Souhaib

Reputation: 360

Recycler view item fadeout animation while scrolling

currently i'm working on an android project using java, Actually i want to make The Map filter fade out on scroll so it doesn't stop randomly.

this is the default animation.enter image description here

this is what i want to achieve, fadeout/fadein animation depending on scrolling orientation.enter image description here

Upvotes: 3

Views: 3346

Answers (1)

DRIDI Syrine
DRIDI Syrine

Reputation: 186

you have just to add the attribute requiresFadingEdge and if you want to specify the length of the transparency you can add another attribute fadingEdgeLength. Good luck for your project.

<android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:requiresFadingEdge="horizontal"
        android:fadingEdgeLength="20dp">
    </android.support.v7.widget.RecyclerView>

Upvotes: 17

Related Questions