Currently I am using the follow code to check whether SwipeRefreshLayout should be enabled.
private void laySwipeToggle() {
if (mRecyclerView.getChildCount() == 0 || mRecyclerView.getChildAt(0).getTop() == 0) {
mLaySwipe.setEnabled(true);
} else {
mLaySwipe.setEnabled(false);
}
}
But here is the problem. When it's scrolled to another item's view's boundary mRecyclerView.getChildAt(0).getTop()
also returns 0.
Is there something like RecyclerView.isScrolledToBottom()
or RecyclerView.isScrolledToTop()
?
EDIT: (mRecyclerView.getChildAt(0).getTop() == 0 && linearLayoutManager.findFirstVisibleItemPosition() == 0)
kind of does the RecyclerView.isScrolledToTop()
, but what about RecyclerView.isScrolledToBottom()
?