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?
Asked
Active
Viewed 791 times
0
-
Too broad to answer . for sake of help just search for `overscroll-decor-android recyclerview`. – ADM Mar 08 '21 at 06:42
-
[Please refer this link and find your answer here. ThankYou.](https://stackoverflow.com/questions/40758635/ios-like-over-scroll-effect-on-android) – Abhishek Kumar Mar 08 '21 at 07:12
-
``androidx.recyclerview:recyclerview:1.3.0-alpha01`` has added support for the same if you're still looking. – OMi Shah Dec 31 '21 at 06:14
-
Thanks I'll check that out – costomato Dec 31 '21 at 19:24
1 Answers
-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

HASSNAIN NADEEM
- 147
- 10