0

In modern UI, when we pull down a recyclerview's top, it's children get stretched. This happens upto a particular pressure applied by user's finger. I am attaching an example of this effect that I recorded from a redmi phone. Can anyone please explain how to achieve this type (or maybe a better type) of effect in android studio if I have CardViews as children of my RecyclerView?

RecyclerView stretch example

costomato
  • 102
  • 2
  • 8

1 Answers1

-2

use swiperefreshlayout in xml

 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/turnaments_list_recy_refresh_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="56dp"
    android:layout_marginBottom="?attr/actionBarSize"
    android:animateLayoutChanges="true"
    android:indeterminateTint="@color/blue_100_dark"
    app:layout_constraintBottom_toBottomOf="parent"

    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/turnaments_list_recy_view"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/image_help_buttom"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

    </androidx.recyclerview.widget.RecyclerView>

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

and in kotlin code

    turnaments_list_recy_refresh_view.isRefreshing = false