I\'ve implemented SwipeRefreshLayout
into my app but it can only hold one direct child which should be the listview. I\'m trying to figure out how to add an emp
Here's what I did : I disabled the swipe to refresh, unless my listView is up.
mBookedProductsListView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView absListView, int i) {
}
@Override
public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (firstVisibleItem == 0)
mSwipeRefreshLayout.setEnabled(true);
else
mSwipeRefreshLayout.setEnabled(false);
}
});
My Xml :
Works like a charm.