pawello2222 pawello2222 - 3 years ago 175
Android Question

Recyclerview swipe up to refresh in android on API 21

I want swipe up to refresh content in recycler view (similar to

SwipeRefreshLayout
).

Currently I have a button which refreshes the view when tapped and I'd like to do the same using swiping up. The only problem is that
SwipeRefreshLayout
is available since API 22.

Is it possible to be done when using API 21?

Answer Source

Use android.support.v4.widget.SwipeRefreshLayout. Add in your build.gradle compile 'com.android.support:support-v4:x.x.x' where x.x.x is the last version of support library.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download