Code example for ValueAnimator

Methods: getAnimatedFraction

0
      } 
    }); 
    mSnapAnimator.addUpdateListener(new AnimatorUpdateListener() {
      @Override 
      public void onAnimationUpdate(ValueAnimator animation) {
        int currX = fromX + (int) (animation.getAnimatedFraction() * (toX - fromX));
        updateWindowPosition(currX, mWindowParams.y);
      } 
    }); 
    mSnapAnimator.start();
  } 
 
  private class GestureListener extends SimpleOnGestureListener {
 
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    @Override 
    public boolean onDoubleTap(MotionEvent event) {
      // TODO: use the code below to launch the camera activity or take a 
      // picture? 
 
      // Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);