Skip to content

Instantly share code, notes, and snippets.

@robertlevonyan
Created February 19, 2018 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertlevonyan/8e89236dc0c28be2b9af3306850bb598 to your computer and use it in GitHub Desktop.
Save robertlevonyan/8e89236dc0c28be2b9af3306850bb598 to your computer and use it in GitHub Desktop.
ValueAnimator sizeAnimator = ValueAnimator.ofFloat(1f, 1.2f);
sizeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
float animatedValue = (float) valueAnimator.getAnimatedValue();
//something really cool happens here
}
});
ObjectAnimator placeAnimator = ObjectAnimator.ofFloat(myView, View.TRANSLATION_X, 0f, 350f);
AnimatorSet set = new AnimatorSet();
set.playTogether(sizeAnimator, placeAnimator);
set.setInterpolator(new DecelerateInterpolator());
set.setDuration(500);
set.start()
val sizeAnimator = ValueAnimator.ofFloat(1f, 1.2f)
sizeAnimator.addUpdateListener {
val animatedValue = it.animatedValue as Float
//something really cool happens here
}
val placeAnimator = ObjectAnimator.ofFloat(myView, View.TRANSLATION_X, 0f, 350f)
val set = new AnimatorSet()
set.playTogether(sizeAnimator, placeAnimator)
set.interpolator = DecelerateInterpolator()
set.duration = 500
set.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment