How to know whether a RecyclerView / LinearLayoutManager is scrolled to top or bottom?

后端 未结 11 2087
一向
一向 2020-12-02 06:24

Currently I am using the follow code to check whether SwipeRefreshLayout should be enabled.

private void laySwipeToggle() {
    if (mRecyclerView.getChildCou         


        
11条回答
  •  情歌与酒
    2020-12-02 06:56

    You can try recyclerView.canScrollVertically(int direction), if you just need to know whether it possible to scroll or not.

    Direction integers:

    • -1 for up
    • 1 for down
    • 0 will always return false.

提交回复
热议问题