title: Problem implementing vertical swipe in Gallery
body: <p>I asked a similar question in the android developers group but haven't received a response yet, so I figured I'd try my luck here.</p>
  
  <p>I want to implement a vertical swipe on a Gallery and I have it working... sort of.  I subclassed Gallery so that I could override the onFling and onDown methods.</p>
  
  <p>Here is the code I used to override these methods:</p>
  
  <pre><code>@Override
  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
  {
      if (m_curTouchPos == NO_CURRENT_TOUCH_POS || m_callback == null)
          return super.onFling(e1, e2, velocityX, velocityY);
  
      float e1x = e1.getX();
      float e1y = e1.getY();
      float e2x = e2.getX();
      float e2y = e2.getY();
  
      float offPath = Math.abs(e1x - e2x);
      float distance = Math.abs(e1y - e2y);
  
      if (offPath &lt; s_swipeMaxOffPath &amp;&amp; 
          //Math.abs(velocityY) &gt;= s_swipeMinVelocity &amp;&amp; 
          distance &gt;= s_swipeMinDistance)
      {
          if (e1y &gt; e2y)
          {
              m_callback.onSwipeUp(m_curTouchPos);
              //return true;
          }
          else if (e2y &gt; e1y)
          {
              //TODO: IMPLEMENT THIS
              //m_callback.onSwipeDown(m_curTouchPos);
              //return true;
          }
      }
  
      m_curTouchPos = NO_CURRENT_TOUCH_POS;
      return super.onFling(e1, e2, velocityX, velocityY);
  }
  
  @Override
  public boolean onDown(MotionEvent eve)
  {
      m_curTouchPos = pointToPosition((int)eve.getX(), (int)eve.getY());
      return super.onDown(eve);
  }
  </code></pre>
  
  <p>The problem is that onFling doesn't get called when I do a vertical swipe...  In order to get into the onFling method I have to press on an item in the gallery, slide it slowly a little to the left or right, and then swipe vertically.</p>
  
  <p>Horizontal swipes always get into the onFling method.</p>
  
  <p>Any ideas on how to get this to work?</p>