Skip to content

Instantly share code, notes, and snippets.

@mortenjust
Created August 26, 2015 18:15
Show Gist options
  • Save mortenjust/465b62b63799bddd0c88 to your computer and use it in GitHub Desktop.
Save mortenjust/465b62b63799bddd0c88 to your computer and use it in GitHub Desktop.
Android animation
Animation wobble = AnimationUtils.loadAnimation(this, R.anim.wobble);
//Now we can play the animation like this on our chosen UI object, in this case our button1 object:
button1.startAnimation(wobble);
//https://www.safaribooksonline.com/library/view/learning-java-by/9781784398859/ch05s05.html
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="100"
android:fromDegrees="-5"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="8"
android:repeatMode="reverse"
android:toDegrees="5" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment