I am creating a custom view(extends WebView). I want to listen the viewable state of the view.
Viewable state means whether or not the view is showing on the screen. I didn’t mean the Visibility. Such as, the view is under a ScrollView, when user scroll and the view will be scrolled out of the screen. Its visibility is not change, it’s still visible but is not viewable because it is scrolled out of the screen.
Is there anyway to listen the viewable change?
Since
WebViewinherits fromViewit seems to me you can override theViewmethods to monitor what you like. Check developer.android.com’s View documentation and check the methods under ‘Implementing a Custom View’. For your scrolling example it seems like you can override theonScrollChangedmethod.