Alex
Alex

Reputation: 502

How to disable swiperefreshlayout when swiping nested recyclerview's cardview

Img

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

Upvotes: 8

Views: 3738

Answers (1)

Patrick
Patrick

Reputation: 1075

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 :)

Upvotes: 9

Related Questions