android - Make bounce animation -


i bounce animation of layer.

i have done layer comes right center, move little , center. create bounce effect.

i thinking can translate 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 code not working, thing can achieve layer comes left center, , animation stops.

i can not use code: because not achieve want

setinterpolator(animationutils.loadinterpolator(this,                         android.r.anim.bounce_interpolator)); 

any appreciated.

you can use bounceinterpolator have effect. docs contain description how use in xml. have animation xml this:

<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"      android:interpolator="@android:anim/bounce_interpolator">      <!-- use working translate animation here-->     <translate         android:duration="900"         android:fromxdelta="100%p"         android:toxdelta="0%p" /> </set> 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -