Skip to content

Instantly share code, notes, and snippets.

@thrashedbrain
Last active January 11, 2021 00:11
Show Gist options
  • Save thrashedbrain/bba20d592d73fa676a78a3394411694d to your computer and use it in GitHub Desktop.
Save thrashedbrain/bba20d592d73fa676a78a3394411694d to your computer and use it in GitHub Desktop.
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(
container,
PropertyValuesHolder.ofFloat("scaleX", 0.5f),
PropertyValuesHolder.ofFloat("scaleY", 0.5f)
);
animator.setDuration(300);
animator.setRepeatCount(ObjectAnimator.RESTART);
animator.setRepeatMode(ObjectAnimator.REVERSE);
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.start();
// loadImg is instance of ImageView
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(
loadImg,
PropertyValuesHolder.ofFloat("scaleX", 0.8f),
PropertyValuesHolder.ofFloat("scaleY", 0.8f)
);
animator.setDuration(300);
animator.setRepeatCount(ObjectAnimator.INFINITE);
animator.setRepeatMode(ObjectAnimator.REVERSE);
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment