title: How to get a callback when a View becomes visible on the screen on Android
body: <p>Is there a way to get a callback when a View appears/disappears on the screen?</p>
  
  <p>I need this for analytics purposes - eg. I need to check how many times people saw a view versus how many times they clicked on it.</p>
  
  <p>I can tell whether a view is on screen at a certain point in time but I'm wondering whether there is a callback for that.</p>
  
  <p>Also note that I'm not interested when a View's state becomes VISIBLE and not even when a view gets rendered (because eg. in a ViewPager the Views of the second page are rendered before they actually appear on screen).</p>
  
  <p>We did several workarounds for certain scenarios but I'd like to have something which is more generic. We need it in ListViews, GridViews, ScrollViews and ViewPagers and each one of them presents different challenges.</p>