Android RecyclerView 最大滚动偏移量

Android RecyclerView max scroll offset

哪个 RecyclerView 函数 returns 最大滚动偏移量?

我需要确定,是否可以通过 RecyclerView 滚动隐藏 Activity 的页脚。

请求的函数是recyclerView.computeVerticalScrollRange();

此函数 returns 如果滚动结束则为真。

static private boolean isMaxScrollReached(RecyclerView recyclerView) {
    int maxScroll = recyclerView.computeVerticalScrollRange();
    int currentScroll = recyclerView.computeVerticalScrollOffset() + recyclerView.computeVerticalScrollExtent();
    return currentScroll >= maxScroll;
}