Created
July 8, 2014 23:27
-
-
Save kevinthecity/e3798b0cc1ac7895cd46 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
/** | |
* Shake a view with a preset cycle interpolater | |
* | |
* @param view | |
* the view to shake | |
*/ | |
public static void shakeIt(final View view) { | |
if (view != null) { | |
Animation shakeAnimation = new TranslateAnimation(0, 10, 0, 0); | |
shakeAnimation.setDuration(300); | |
shakeAnimation.setInterpolator(new CycleInterpolator(2)); | |
view.startAnimation(shakeAnimation); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment