skip to Main Content

i want to make some blur in the edges of the recycler view, as you can see in the picture, the top and bottom part are "cut", i would like to give the sensation of disappearing (like the second image (that image is on figma, so i havent made it on android)), its possible to do that? I dont like the cutted version at all

enter image description here

enter image description here

2

Answers


  1. Have you tried something like this in your xml (RecyclerView):

    android:fadingEdge="vertical|horizontal"
    android:fadingEdgeLength="50dp"
    android:requiresFadingEdge="vertical|horizontal"
    

    And, you need to remove your bottom margin, otherwise your fading edges wouldn’t look as you wish.

    Login or Signup to reply.
  2. You can use in RecyclerView

    <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/recycler"
                    android:layout_width="match_parent"
                    android:fadingEdge="horizontal|vertical"
                    android:fadingEdgeLength="24dp"
                    android:requiresFadingEdge="horizontal|vertical"
                    android:layout_height="match_parent"
                    android:layout_below="@+id/ll_serch" />
    

    output here:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search