How to set pull up to update SwipeRefreshLayout

I see so many libraries for moving a ListView to update. But they work when pulled from top to bottom, but how can I freshen up when we pull from bottom to top? Can I do this using SwipeRefreshLayout ? If not, which library should I use? And how to do it?

+5
source share
1 answer

use the chrisbanes library: https://github.com/chrisbanes/Android-PullToRefresh , which supports listview, gridview, scrollview, webview ...

To refresh the list view below, just set the mode for it. Here is an example:

PullToRefreshListView ptr= (PullToRefreshListView) findViewById(R.id.listview); mPullRefreshListView.setMode(Mode.BOTH); // mode refresh for top and bottom mPullRefreshListView.setShowIndicator(false); //disable indicator mPullRefreshListView.setPullLabel("Loading"); ptr.setOnRefreshListener(new OnRefreshListener<ListView>() { public void onRefresh(PullToRefreshBase<ListView> refreshView) { //do something when refresh }); 
+2
source

Source: https://habr.com/ru/post/1203287/


All Articles