mzgreen / HideOnScrollExample

This is an example on how to show/hide views when scrolling a list.
620 stars 173 forks source link

At the bottom of RecycleView,FAB can not been seen #15

Open Wensibob opened 7 years ago

Wensibob commented 7 years ago

I have found that at the last item of recycleview we can not see the FAB the same as at the first item of recycleview , luckily you have solved the latter. But I have try the same way like below and it works well.

private int mItemSize=0;

public HidingScrollListener(int itemSize) {
        this.mItemSize = itemSize - 1;
}

int lastVisibleItem = ((LinearLayoutManager) recyclerView.getLayoutManager()).findLastVisibleItemPosition();

        if (firstVisibleItem == 0||lastVisibleItem==mItemSize) {
            if (!controlsVisible) {
                onShow();
                controlsVisible = true;
            }
        }