Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable swiperefreshlayout when swiping nested recyclerview's cardview

Tags:

android

Img

When I swipe slightly down on the card in my swiperefreshlayout, it thinks I'm trying to refresh. How do I avoid this?

like image 334
Alex Avatar asked Mar 07 '16 23:03

Alex


1 Answers

If you have a nested RecyclerView, for example, named recyclerView you can call:

recyclerView.setNestedScrollingEnabled(false);

Should stop your SwipeRefreshLayout from trying to refresh when you swipe down on a nested RecyclerView's child.

Worked for me with the almighty Android Support Library 23.2.
Hope that helps :)

like image 55
Patrick Avatar answered Sep 30 '22 10:09

Patrick