title: On Swipe up Volume Is increasing but do not increase continious if i move finger up
body: <p>Actually i want to increase/decrease volume continuously, when i swipe finger up/down .I want when i move finger up slowly then volume increase with finger movement and decrease in finger down case.
  But my code increase volume when i swipe finger up only once. I need to again swipe up to increase more volume. Its not continuing increase as finger moves.</p>
  
  <p>Please help me how i can do that. please check my code what is mistake. Please help thanks.</p>
  
  <p><strong>OnSwipeTouchListener.java</strong> (Class) </p>
  
  <pre><code>public class OnSwipeTouchListener implements OnTouchListener {
  
  private final GestureDetector gestureDetector;
  
  public OnSwipeTouchListener (Context ctx){
      gestureDetector = new GestureDetector(ctx, new GestureListener());
  }
  
  @Override
  public boolean onTouch(View v, MotionEvent event) {
      return gestureDetector.onTouchEvent(event);
  }
  
  private final class GestureListener extends SimpleOnGestureListener {
  
      private static final int SWIPE_THRESHOLD = 100;
      private static final int SWIPE_VELOCITY_THRESHOLD = 100;
  
      @Override
      public boolean onDown(MotionEvent e) {
          return true;
      }
  
      @Override
      public boolean onScroll(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
          boolean result = false;
          try {
              float diffY = e2.getY() - e1.getY();
              float diffX = e2.getX() - e1.getX();
              if (Math.abs(diffX) &gt; Math.abs(diffY)) {
                  if (Math.abs(diffX) &gt; SWIPE_THRESHOLD &amp;&amp; Math.abs(velocityX) &gt; SWIPE_VELOCITY_THRESHOLD) {
                      if (diffX &gt; 0) {
                          onSwipeRight();
                      } else {
                          onSwipeLeft();
                      }
                      result = true;
                  }
              }
              else if (Math.abs(diffY) &gt; SWIPE_THRESHOLD &amp;&amp; Math.abs(velocityY) &gt; SWIPE_VELOCITY_THRESHOLD) {
                  if (diffY &gt; 0) {
                      onSwipeBottom();
                  } else {
                      onSwipeTop();
                  }
                  result = true;
              }
          } catch (Exception exception) {
              exception.printStackTrace();
          }
          return result;
      }
  
  }
  
  public void onSwipeRight() {
  }
  
  public void onSwipeLeft() {
  }
  
  public void onSwipeTop() {
  }
  
  public void onSwipeBottom() {
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>VideoView.java</strong> (Activity)</p>
  
  <pre><code> fullview = (View)findViewById(R.id.fullView);
          fullview.setOnTouchListener(new OnSwipeTouchListener(ViewVideo.this) {
              public void onSwipeTop() {
                  Toast.makeText(ViewVideo.this, "top", Toast.LENGTH_SHORT).show();
                  currentVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
                  audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, currentVolume + 1, 0);
              }
              public void onSwipeRight() {
                  Toast.makeText(ViewVideo.this, "right", Toast.LENGTH_SHORT).show();
              }
              public void onSwipeLeft() {
                  Toast.makeText(ViewVideo.this, "left", Toast.LENGTH_SHORT).show();
              }
              public void onSwipeBottom() {
                  Toast.makeText(ViewVideo.this, "bottom", Toast.LENGTH_SHORT).show();
                  currentVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
                  audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, currentVolume - 1, 0);
              }
  
          });
  </code></pre>