title: Implementing GestureDetector to Drag, DoubleTap and singleTap a ImageView
body: <p>I am trying to implement a ImageView which will have different reaction with each action(Drag, DoubleTap and Single Tap). What I am doing is based in this tutorial: 
  <a href="https://stackoverflow.com/questions/4804798/doubletap-in-android">DoubleTap in android</a></p>
  
  <p>Which I used to create my class:
  </p>
  
  <pre><code>public class MyIcon extends ImageView {
  
      GestureDetector gestureDetector;
  
      public MyView(Context context, AttributeSet attrs) {
          super(context, attrs);
          // creating new gesture detector
          gestureDetector = new GestureDetector(context, new GestureListener());
      }
  
      // skipping measure calculation and drawing
  
      // delegate the event to the gesture detector
      @Override
      public boolean onTouchEvent(MotionEvent e) {
          return gestureDetector.onTouchEvent(e);
      }
  
  
      private class GestureListener extends GestureDetector.SimpleOnGestureListener {
  
          @Override
          public boolean onDown(MotionEvent e) {
              return true;
          }
          // event when double tap occurs
          @Override
          public boolean onDoubleTap(MotionEvent e) {
              //A Toast just to see if it is working
              return true;
          }
          @Override
          public boolean onShowPress(MotionEvent e) {
              //A Toast just to see if it is working
              return true;
          }
      }
  }
  </code></pre>
  
  <p>To instantiate:</p>
  
  <pre><code>private WindowManager windowManager;
  private MyIcon myIcon;
  private WindowManager.LayoutParams params;
  
  windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
  
      chatHead = new MyIcon(this);
      chatHead.setImageResource(R.mipmap.ic_launcher);
  
      params = new WindowManager.LayoutParams(
              WindowManager.LayoutParams.WRAP_CONTENT,
              WindowManager.LayoutParams.WRAP_CONTENT,
              WindowManager.LayoutParams.TYPE_PHONE,
              WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
              PixelFormat.TRANSPARENT
      );
  
      params.gravity = Gravity.TOP | Gravity.LEFT;
      params.x = 0;
      params.y = 100;
  </code></pre>
  
  <p>I used a setOnTouchListener() which worked fine to make do Drag, but it is not work to DoubleTap.</p>
  
  <p>Which would be the correct way to implement and instantiate this class to both work?</p>