springAnimationY.setSpring(springY); springAnimationY.setMinimumVisibleChange(DynamicAnimation.MIN_VISIBLE_CHANGE_PIXELS); springAnimationY.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() { @Override public void onAnimationUpdate(DynamicAnimation animation, float value, float velocity) {
springAnimationX.setSpring(springX); springAnimationX.setMinimumVisibleChange(DynamicAnimation.MIN_VISIBLE_CHANGE_PIXELS); springAnimationX.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() { @Override public void onAnimationUpdate(DynamicAnimation animation, float value, float velocity) {
public RotationSpringAnimation(ImageView animateView, TextView infoView) { // create a rotation SpringAnimation rotationAnimation = createSpringAnimation(animateView, SpringAnimation.ROTATION, INITIAL_ROTATION, SpringForce.STIFFNESS_MEDIUM, SpringForce.DAMPING_RATIO_HIGH_BOUNCY); this.infoView = infoView; this.animateView = animateView; this.animateView.setOnTouchListener(touchListener); rotationAnimation.addUpdateListener(updateListener); updateInfoView(); }
final SpringAnimation anim = new SpringAnimation(img, DynamicAnimation.TRANSLATION_Y, 0 /* final position */); anim.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() { @Override public void onAnimationUpdate(DynamicAnimation dynamicAnimation, float v, float v1) {
public ScaleSpringAnimation(ImageView animateView, TextView infoView) { this.infoView = infoView; this.animateView = animateView; // create scaleX and scaleY animations scaleXAnimation = createSpringAnimation( animateView, SpringAnimation.SCALE_X, INITIAL_SCALE, SpringForce.STIFFNESS_MEDIUM, SpringForce.DAMPING_RATIO_HIGH_BOUNCY); scaleYAnimation = createSpringAnimation( animateView, SpringAnimation.SCALE_Y, INITIAL_SCALE, SpringForce.STIFFNESS_MEDIUM, SpringForce.DAMPING_RATIO_HIGH_BOUNCY); updateInfoView(); setupPinchToZoom(); this.animateView.setOnTouchListener(touchListener); scaleXAnimation.addUpdateListener(updateListener); }
animate2Y = new SpringAnimation(follow2, DynamicAnimation.TRANSLATION_Y, follow2.getTranslationY()); animate1X.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() { @Override public void onAnimationUpdate(DynamicAnimation dynamicAnimation, float value, float velocity) { animate1Y.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() { @Override public void onAnimationUpdate(DynamicAnimation dynamicAnimation, float value, float velocity) {
animFirstFollowerX.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() { @Override public void onAnimationUpdate(DynamicAnimation animation, float value, float velocity) { animFirstFollowerY.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() { @Override public void onAnimationUpdate(DynamicAnimation animation, float value, float velocity) {