问题描述:

When I combine both libraries in an activities, there is a problem.

When scroll to bottom is fine but when scroll to top there is a problem.

For example, the listview section in in middle and scroll up, the happen should be listview scroll up but it happened the actionbar refresh.

I suspected the both libraries's gesture overlap and causing this problem.

If I use them separately, both of them work brilliant.

网友答案:

Use the following snippet.This might Help you

 listview.setOnScrollListener(new AbsListView.OnScrollListener() {
        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {

        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
            if (listview.getChildCount() > 0 && listview.getChildAt(0).getTop() == 0
                    && listview.getFirstVisiblePosition() == 0) {
                mPullToRefreshLayout.setEnabled(true);
            }else{
                mPullToRefreshLayout.setEnabled(false);
            }

        }
    });
相关阅读:
Top