Last active
May 27, 2024 11:57
-
-
Save simon-heinen/9795036 to your computer and use it in GitHub Desktop.
A simple shake / wiggle animation for Android
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
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
<rotate | |
android:duration="70" | |
android:fromDegrees="-5" | |
android:pivotX="50%" | |
android:pivotY="50%" | |
android:repeatCount="5" | |
android:repeatMode="reverse" | |
android:interpolator="@android:anim/linear_interpolator" | |
android:toDegrees="5" /> | |
<translate | |
android:fromXDelta="-10" | |
android:toXDelta="10" | |
android:repeatCount="5" | |
android:repeatMode="reverse" | |
android:interpolator="@android:anim/linear_interpolator" | |
android:duration="70" /> | |
</set> |
coooooooooooool
wow, thanks a lot!!!!
thank you!
How to use it?
This starts from -10. Can I make it start from 0, to -10, to 10, etc... ?
Something like this:
https://user-images.githubusercontent.com/5357526/42556059-04e7cb40-84f3-11e8-872c-d071f264c8ba.gif
How to use it?
Animation shake = AnimationUtils.loadAnimation(context, R.anim.shake);
view.startAnimation(shake);
Amazing. Thanks!
thanks.
cool~! appreciate u.
Thank You. I am just starting to learn android animations and this helps a lot.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!