title: RecyclerView inside NestedScrollView does not give correct visible item position
body: <p>I have a <code>RecyclerView</code> inside a <code>NestedScrollView</code> and I'm trying to get the position of the last visible list item during scroll events using. The following code allows me to reliably detect scroll events:</p>
  
  <pre><code>val recyclerView = nestedScrollView.getChildAt(0) as RecyclerView
  
  nestedScrollView.setOnScrollChangeListener { v: NestedScrollView?, scrollX: Int, scrollY: Int, oldScrollX: Int, oldScrollY: Int -&gt;
      val layoutManager = recyclerView?.layoutManager as? LinearLayoutManager
      val lastVisiblePosition = layoutManager?.findLastVisibleItemPosition()
  }
  </code></pre>
  
  <p>The problem however is that here <code>lastVisiblePosition</code> always ends up being the last item in the list whether this is actually on scree or not. Where could I be going wrong?</p>