title: notifyItemRangeChanged() causing crash RecyclerView Android
body: <p>layout design:</p>
  
  <pre><code>HorizontalScrollView-parent, holding RV[
      RecyclerView=&gt;(GridLayoutManager) (orientation verticle)]
  </code></pre>
  
  <p>Which will basically do a two way scroll. This UI is built for TV. The focused row in this grid will show extra detail and other rows wont. So whenever there is a focus change from one row to another in <code>onFocusChange</code> i modify the <code>dataset</code> of the <code>Adapter</code> and call <code>notifyItemRangeChanged()</code>. </p>
  
  <p>This works fine when the rows length exceeds that of the vertical length of the screen, i.e. vertically scrollable. The crash happens say like if there is less number of rows (like 4).</p>
  
  <p>Error:</p>
  
  <pre><code>    java.lang.IllegalArgumentException: parameter must be a descendant of this view
  at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:5937)
  at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:5866)
  at android.widget.HorizontalScrollView.isWithinDeltaOfScreen(HorizontalScrollView.java:1168)
  at android.widget.HorizontalScrollView.onSizeChanged(HorizontalScrollView.java:1569)
  at android.view.View.sizeChange(View.java:19719)
  at android.view.View.setFrame(View.java:19680)
  at android.view.View.layout(View.java:19583)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1780)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1546)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at com.android.internal.policy.DecorView.onLayout(DecorView.java:758)
  at android.view.View.layout(View.java:19586)
  at android.view.ViewGroup.layout(ViewGroup.java:6053)
  at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2484)
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2200)
  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
  at android.view.Choreographer.doCallbacks(Choreographer.java:723)
  at android.view.Choreographer.doFrame(Choreographer.java:658)
  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
  at android.os.Handler.handleCallback(Handler.java:789)
  at android.os.Handler.dispatchMessage(Handler.java:98)
  at android.os.Looper.loop(Looper.java:164)
  at android.app.ActivityThread.main(ActivityThread.java:6541)
  </code></pre>
  
  <p>I tried calling notifydatasetchange, but that will return getAdapterPosition = -1 which will not result in focus change from 1 row to another</p>
  
  <p>Since the Adapter code length exceeds character length set by stackoverflow i am providing drive link for the same.
  <a href="https://drive.google.com/drive/folders/1oXDc_rb3DeD3O26UcgGBh5Sl4Ac9-EuA?usp=sharing" rel="noreferrer">Adapter and viewholder layout code</a></p>
  
  <p>No crash when scrolled vertically 
  <a href="https://i.stack.imgur.com/QjR2d.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/QjR2d.jpg" alt="Items without crash"></a></p>
  
  <p>Crash on vertical scroll
  <a href="https://i.stack.imgur.com/KDMO1.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/KDMO1.jpg" alt="Items with crash"></a></p>