Add OnFling and OnClick methods to ImageView
<p>I have an ImageView that needs to change image on fling/slide and do something else when onclicks but i cant manage the get onclick to fire, the fling work fine thought</p>

<p>this is class for the Listener</p>

<pre><code>    public abstract class OnFlingGestureListener implements OnTouchListener {


      private Context context;
    private final GestureDetector gdt = new GestureDetector(this.context, new GestureListener());

      @Override
      public boolean onTouch(final View v, final MotionEvent event) {
         gdt.onTouchEvent(event);
         return true;
      }

      private final class GestureListener extends SimpleOnGestureListener {

         private static final int SWIPE_MIN_DISTANCE = 120;
         private static final int SWIPE_THRESHOLD_VELOCITY = 200;

         @Override
         public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
            if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {
               onRightToLeft();
               return true;
            } else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {
               onLeftToRight();
               return true;
            }
            if(e1.getY() - e2.getY() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityY) &gt; SWIPE_THRESHOLD_VELOCITY) {
               onBottomToTop();
               return true;
            } else if (e2.getY() - e1.getY() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityY) &gt; SWIPE_THRESHOLD_VELOCITY) {
               onTopToBottom();
               return true;
            }
            return false;
         }
      }

        public boolean onDown(MotionEvent e){    
          return false;
      }

      public boolean onSingleTapConfirmed(MotionEvent e) {
          // ---Call it directly---
          click();
          return true;
      }

      public abstract void onRightToLeft();

      public abstract void onLeftToRight();

      public abstract void onBottomToTop();

      public abstract void onTopToBottom();

      public abstract void click();

    }
</code></pre>

<p>Then in my activy onCreate i do this</p>

<pre><code>ImageView btn = (ImageView) findViewById(R.id.imageButton1);        
        btn.setOnTouchListener(new OnFlingGestureListener() {

            @Override
            public void onTopToBottom() {
               //Your code here
            }

            @Override
            public void onRightToLeft() {
                NextCall();
            }

            @Override
            public void onLeftToRight() {               
                PrevCall();
            }

            @Override
            public void onBottomToTop() {
               //Your code here
            }

            @Override
            public void click() {
                ClickCode();

            }
         });
</code></pre>

<p>Any ideas what im doing wrong ?</p>
