0

This Post is Duplicate of : PullToRefresh list with pinned section header & is it possible to merge stickylistviewheader with crisbanes pulltorefresh?

I need to implement headerListView with pull-to-refresh functionality. I am Googling for possible way to implement it, But still not got any solution.

NOTE: There is a option, Use mergeAdapter to achieve separator, This solution will not work for me, because i need stickyHeader, Not separators.

Thanks,

Community
  • 1
  • 1
Ahmad Raza
  • 2,850
  • 1
  • 21
  • 37

1 Answers1

1

StickyListHeader works like a charm with ActionBar-PullToRefresh as long as you use the custom Delegate as provided here by Andrew Emery in the answers; that is :

public class StickyListViewDelegate extends AbsListViewDelegate {
    @Override
    public boolean isReadyForPull(View view, final float x, final float y) {
        StickyListHeadersListView sticky = (StickyListHeadersListView) view;
        return super.isReadyForPull(sticky.getWrappedList(), x, y);
    }
}

Integrated like so:

StickyListViewDelegate delegate = new StickyListViewDelegate();
ActionBarPullToRefresh.from(this).theseChildrenArePullable(mListView)
        .useViewDelegate(StickyListHeadersListView.class, delegate)
        .listener(this).setup(mPullToRefreshLayout);
Community
  • 1
  • 1
LaSprezz
  • 71
  • 4
  • Link-only answers are generally discouraged as they can't stand on their own long-term. Please quote any relevant information in the answer so as to avoid future problems from link-rot. – zzzzBov Feb 28 '14 at 02:15