title: Android move button up & down gesture animation
body: <p>I have a button and 4 choices so I need user to select one of them via scrolling down/up as below. I want to scroll it with animation including fling/velocity effect. With the code below, I am able to scroll one level, how to continue and go back?</p>
  
  <p><img src="https://i.stack.imgur.com/CsBpr.jpg" alt="enter image description here"></p>
  
  <pre><code>    btnLevel.setOnTouchListener(new OnTouchListener()
      {
  
          @Override
          public boolean onTouch(View v, MotionEvent event)
          {
  
              gDetector.onTouchEvent(event);
  
              return false;
          }
      });
  
      gDetector = new GestureDetector(getActivity(), new OnGestureListener()
      {
          private static final int SWIPE_MIN_DISTANCE = 110;
          private static final int SWIPE_MAX_OFF_PATH = 50;
          private static final int SWIPE_THRESHOLD_VELOCITY = 100;
  
  
          @Override
          public boolean onSingleTapUp(MotionEvent e)
          {
              // TODO Auto-generated method stub
              return false;
          }
  
          @Override
          public void onShowPress(MotionEvent e)
          {
              // TODO Auto-generated method stub
  
          }
  
          @Override
          public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
          {
              // TODO Auto-generated method stub
              return false;
          }
  
          @Override
          public void onLongPress(MotionEvent e)
          {
              // TODO Auto-generated method stub
  
          }
  
          @Override
          public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
          {
              float dY = e1.getY() - e2.getY();
  
              if (Math.abs(velocityY) &gt;= SWIPE_THRESHOLD_VELOCITY &amp;&amp; Math.abs(dY) &gt;= SWIPE_MIN_DISTANCE)
              {
                  if (dY &gt; 0)
                  {
                      Toast.makeText(getActivity(), "up", Toast.LENGTH_SHORT).show();
  
                  } else
                  {                                                                                       Toast.makeText(getActivity(), "down", Toast.LENGTH_SHORT).show();
  
                        TranslateAnimation mAnimation = new TranslateAnimation(0, 0, 0, 110);
                mAnimation.setDuration(1000);
            mAnimation.setRepeatMode(Animation.RELATIVE_TO_SELF);
            mAnimation.setInterpolator(new LinearInterpolator());
            mAnimation.setFillAfter(true);
            btnLevel.startAnimation(mAnimation);
  
                  }
                  return true;
  
              }
              return true;
          }
  
          @Override
          public boolean onDown(MotionEvent e)
          {
              // TODO Auto-generated method stub
              return false;
          }
      });
  </code></pre>