title: how to disable scrolling of HorizontalScrollView inside the ViewPager
body: <p>I've got a Horizontal Scroll View placed in ViewPager. The goal is to use only software triggered scrolling of Horizontal Scroll View. All the scrolling gestures should be handled by the view pager. </p>
  
  <p>I already did it by creating a custom View Pager that intercepts all swipe gestures:</p>
  
  <pre><code>public class GreedyViewPager extends ViewPager {
  
      GestureDetector mGestureDetector;
      View.OnTouchListener mGestureListener;
  
      public GreedyViewPager(Context context) {
          super(context);
          initGestureDetector(context);
      }
  
      public GreedyViewPager(Context context, AttributeSet attributeSet) {
          super(context, attributeSet);
          initGestureDetector(context);
      }
  
      void initGestureDetector(Context context){
          mGestureDetector = new GestureDetector(context, new ScrollDetector());
          ViewConfiguration vc = ViewConfiguration.get(context);
      }
  
      @Override
      public boolean onInterceptTouchEvent(MotionEvent ev) {
          return super.onInterceptTouchEvent(ev) || mGestureDetector.onTouchEvent(ev);
      }
  
      class ScrollDetector extends SimpleOnGestureListener {
          @Override
          public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
              return true;
          }
  
          @Override
          public boolean onDoubleTap(MotionEvent e) {
              return true;
          }
      }
  }
  </code></pre>
  
  <p>Unfortunately it doesn't work well with all devices, sometimes I have to swipe a coupe of times in order to go to the next position in the ViewPager. </p>
  
  <p>Any idea how to make it better?</p>