Android获取RecyclerView滑动距离

比较靠谱的方法

rv.setOnScrollListener(new RecyclerView.OnScrollListener() {
    int titleHeight;
    @Override
    public void onScrolled(RecyclerView rv, int dx, int dy) {
        super.onScrolled(rv, dx, dy);
        Log.i(TAG, rv.computeVerticalScrollOffset() + "");
    }
});

你可能感兴趣的:(Android,Android,获取RecyclerView,滑动距离)