Created
October 6, 2016 05:52
-
-
Save beta/5afd4a5e2156f2686280d2823a880c71 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
PropertyValuesHolder pvhIncreaseScaleX = | |
PropertyValuesHolder.ofFloat("scaleX", 1.0f, 0.8f); | |
PropertyValuesHolder pvhIncreaseScaleY = | |
PropertyValuesHolder.ofFloat("scaleY", 1.0f, 0.8f); | |
PropertyValuesHolder pvhDecreaseScaleX = | |
PropertyValuesHolder.ofFloat("scaleX", 0.8f, 1.0f); | |
PropertyValuesHolder pvhDecreaseScaleY = | |
PropertyValuesHolder.ofFloat("scaleY", 0.8f, 1.0f); | |
ObjectAnimator heartBeatIncreaseAnimator = ObjectAnimator.ofPropertyValuesHolder( | |
mImageView, pvhIncreaseScaleX, pvhIncreaseScaleY | |
); | |
heartBeatIncreaseAnimator.setStartDelay(1200); | |
heartBeatIncreaseAnimator.setDuration(100); | |
heartBeatIncreaseAnimator.setInterpolator(new AccelerateDecelerateInterpolator()); | |
ObjectAnimator heartBeatDecreaseAnimator = ObjectAnimator.ofPropertyValuesHolder( | |
mImageView, pvhDecreaseScaleX, pvhDecreaseScaleY | |
); | |
heartBeatDecreaseAnimator.setDuration(100); | |
heartBeatDecreaseAnimator.setInterpolator(new AccelerateDecelerateInterpolator()); | |
AnimatorSet heartBeatAnimatorSet = new AnimatorSet(); | |
heartBeatAnimatorSet.playSequentially(heartBeatIncreaseAnimator, heartBeatDecreaseAnimator); | |
heartBeatAnimatorSet.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment