azizbekian
azizbekian

Reputation: 62209

Edit PullToRefresh listview to refresh from bottom

Here's Erik Wallentinsen's PullToRefresh ListView on github.

But it refreshes the listview from top only:

Screenshot

I want to change this, and refresh the listview when it gets pulled from bottom.

Apparently, it is needed to change this source.

Maybe somebody already had this issue and solved it?

Upvotes: 1

Views: 8091

Answers (1)

ductran
ductran

Reputation: 10203

I recommend you use chrisbanes 's library: https://github.com/chrisbanes/Android-PullToRefresh which supports listview, gridview, scrollview, webview ... Here is an start guide
To refresh listview from bottom, just set mode for it. Here is an example that I tried:

PullToRefreshListView mPullRefreshListView = 
  (PullToRefreshListView) findViewById(R.id.listview);
mPullRefreshListView.setMode(Mode.BOTH);    // mode refresh for top and bottom
mPullRefreshListView.setShowIndicator(false); //disable indicator
mPullRefreshListView.setPullLabel("Loading");

 mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
            public void onRefresh(PullToRefreshBase<ListView> refreshView) {
          //do something when refresh
});

Upvotes: 10

Related Questions