title: Android swipe left/right to pagging and up/down to scroll in webView
body: <p>I create OnSwipeTouchListener class:</p>
  
  <pre><code>public class OnSwipeTouchListener implements OnTouchListener {
  private GestureDetector gestureDetector;
  public OnSwipeTouchListener(Context c) {
      gestureDetector = new GestureDetector(c, new GestureListener());
  }
  public boolean onTouch(final View view, final MotionEvent motionEvent) {
      return gestureDetector.onTouchEvent(motionEvent);
  }
  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;
      }
      // Determines the fling velocity and then fires the appropriate swipe event accordingly
      @Override
      public boolean onFling(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();
                      }
                  }
              } else {
                  if (Math.abs(diffY) &gt; SWIPE_THRESHOLD &amp;&amp; Math.abs(velocityY) &gt; SWIPE_VELOCITY_THRESHOLD) {
                      if (diffY &gt; 0) {
                          onSwipeDown();
                      } else {
                          onSwipeUp();
                      }
                  }
              }
          } catch (Exception exception) {
              exception.printStackTrace();
          }
          return result;
      }
  }
  public void onSwipeRight() {
  }
  public void onSwipeLeft() {
  }
  public void onSwipeUp() {
  }
  public void onSwipeDown() {
  }
  }
  </code></pre>
  
  <p>And in ItemActivity I have a webView (mWebView) and put into html file from assets. After that I put on it Touch Listener:</p>
  
  <pre><code>mWebView.setOnTouchListener(new OnSwipeTouchListener(this) {
          @Override
          public void onSwipeDown() {
          }
          @Override
          public void onSwipeUp() {
  
          }
  </code></pre>
  
  <p>I implement onSwipeLeft and onSwipeUp correctly, to load other html-s but do not work Swipe up and Swipe down, to scroll up and down in selected html, so I have problem to show complete html.</p>
  
  <p>How to implement SwipeDown and SwipeUp to vertical scroll work? </p>