Android animation: bouncing button like on mac
If I open an app on Mac OS X, the app button bounces like a ball, first high, then 2x, not that high, but the same.
Can this be done using bouncing animations or other types of animations?
Button should like jumping in front of the user from the phone (slightly larger), then zooming out by a factor of 2, and then starting with the big button. It’s like throwing a ball straight down from the viewer’s eye onto the display.
I want the user to notice that this button is waiting to be clicked 🙂
Here’s what I got :
<pre class=”lang-xml prettyprint-override”><?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="400"
android:fromXScale="1"
android:fromYScale="1"
android:interpolator="@android:anim/bounce_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.1"
android:toYScale="1.1"
android:repeatCount="4" />
</set>
Then it begins
Animation bounce = AnimationUtils.loadAnimation(5his, R.anim.bounce);
somebutton.startAnimation(bounce);
But it just increases to 400% in 110 seconds and starts over from 100%. No ball bouncing effect.
Any ideas?
Solution
Ah, bounce_interpolator are already doing what I want to do, I just need to give the animation more time… android:duration=”1000″ succeeded, 400 ms is too fast, can’t see the bouncing animation.