Created
February 19, 2018 19:08
-
-
Save robertlevonyan/8e89236dc0c28be2b9af3306850bb598 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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