I would like to make a layer bounce animation.
I made this layer, starting from the right to the center, now I would like to move it back a bit and then return to the center. This will create a bounce effect.
I thought I could do this with a translation like this:
<translate
android:duration="900"
android:fromXDelta="100%p"
android:toXDelta="0%p" />
<translate
android:duration="900"
android:fromXDelta="0%p"
android:toXDelta="100%p" />
<translate
android:duration="900"
android:fromXDelta="70%p"
android:toXDelta="0%p" />
Well, this code doesn't work, the only thing I can achieve is that Layer happens to the left of the center and then the animation stops.
I can not use this code: because it does not achieve what I want
setInterpolator(AnimationUtils.loadInterpolator(this,
android.R.anim.bounce_interpolator));
Any help would be appreciated.
source
share