title: Gallery scroll one image at a time
body: <p>how to make a gallery control to scroll one image at a time? Also what is a good way of making a continuous loop of those images? I tried overriding onFling, does not work at all.</p>
  
  <p>This moves image certain distance but does not really implement "true paging".</p>
  
  <pre><code>@Override
          public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
  
            //  return super.onFling(e1, e2, velocityX, velocityY);
              int kEvent;
                if(isScrollingLeft(e1, e2)){ //Check if scrolling left
                  kEvent = KeyEvent.KEYCODE_DPAD_LEFT;
                }
                else{ //Otherwise scrolling right
                  kEvent = KeyEvent.KEYCODE_DPAD_RIGHT;
                }
                onKeyDown(kEvent, null);
                return true;  
          }
          private boolean isScrollingLeft(MotionEvent e1, MotionEvent e2){
                return e2.getX() &gt; e1.getX();
              }
  </code></pre>