I have a View in my Activity. I want to detect when it has moved around the screen due to any actions (user scrolls, relative views resize shifting contents, etc.). This is meant to be in a library, so I can query the hierarchy, but I don’t control it, nor can I modify it other than adding event listeners.
Is there any way to get this as an event, rather than polling?
There is an event for this:
View.getViewTreeObserver().addOnScrollChangedListener()Source: Android Source Code (4.0), android.view.SurfaceView.java:205