Warm tip: This article is reproduced from serverfault.com, please click

How do I check if NestedScrollView is currently scrolling?

发布于 2018-11-17 17:23:01

I have a NestedScrollView and I want to see weather it is scrolling at the moment.

nestedScrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
        @Override
        public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {}

    });

I've looked online and couldn't find a solution.

Questioner
Kristofer
Viewed
11
Mightian 2018-11-18 03:44:21

To do this you will have to write your custom view which extend a NestedScrollView and in that view override the onScrollChange() methods and add logs inside that method to get the value of the scroll, you are writing a custom view as you cant add logs to the systems widgets.