title: Auto-scroll Scrollbar While Drag item In Recyclerview
body: <p>I have an issue with Auto-scroll in scroll view.</p>
  
  <p>In my case, there are two Recyclerview. First Recyclerview, horizontally scrollable and second vertically. First RecyclerView only for drag and Second RecyclerView only for a drop. Both recyclerviews are inside ScrollView so, I disabled vertical scroll in second Recyclerview.
  I added DragListener on Second Recyclerview's item. Every item have drag listener so based on that I add/replace item while drop item.</p>
  
  <p>So My main issue with scroll, so scroll not working properly while i drag item.
  currently i used below code for scroll while drag.</p>
  
  <pre><code>case DragEvent.ACTION_DRAG_LOCATION:
  RecyclerView recyclerView = (RecyclerView) viewSource.getParent();
  MyAdapter adapter = (MyAdapter) recyclerView.getAdapter();
  int y = Math.round(dragEvent.getY());
  Timber.d("onDrag(): " + y);
  int translatedY = y - adapter.getScrollDistance();
  Timber.d("onDrag(): translated : " + translatedY + "   getScrollDistance : " + adapter.getScrollDistance());
  int threshold = 50;
  // make a scrolling up due the y has passed the threshold
  if (translatedY &lt; threshold) {
      // make a scroll up by 30 px
       mScrollView.smoothScrollBy(0, -30);
  
  } else
      // make a autoscrolling down due y has passed the 500 px border
      if (translatedY + threshold &gt; 500) {
          // make a scroll down by 30 px
       mScrollView.smoothScrollBy(0, 30);
      }
  break;
  </code></pre>
  
  <p>But above code not working properly for multiple items if recyclerview have only  one item than its working fine. but when recyclerview having multiple items that time scrollview scroll above and below slitly while itemX in between two items.</p>
  
  <p><strong>Edited Question:</strong>
  Now, I put above code on Second Recycler view's OnDragListener. Now the problem with drag listener, so I want if user drag First Recyclerview's item below/above than <strong>second Recyclerview's drag listener</strong> needs to work else <strong>Second Recyclerview's item's drag listener</strong> needs to work.</p>