RecyclerView SCROLL_STATE_IDLE is being called late

耗尽温柔 提交于 2019-12-05 20:47:57

Having the same issue, the only workaround I've found is to send a stopScroll() whenever the RecyclerView gets a SCROLL_STATE_SETTLING, though not the ideal solution. Probably would be better to detect if it has reached the top or bottom edge, taking into account the scrolling direction, and then call stopScroll():

@Override
public void onScrollStateChanged(final int state)
{
    super.onScrollStateChanged(state);

    if (state == RecyclerView.SCROLL_STATE_SETTLING)
    {
        this.stopScroll();
    }
}

Update

This issue seems to be a bug in the support library, though it was reported as fixed its clear that the problem still exists, so hopefully we should see an adequate solution in the future:

https://issuetracker.google.com/issues/66996774

Invoke stopScroll() when your recyclerview has been reached to to bottom. I think Since it's support library version up, velocity is calulated and it makes delay a little.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!