Left to Right and Right to Left Animation from Android 2.1 and above -


transitive animation on android 2.1 4.2 weird in android. code below found in anim folder works on android 4.0 , above version. have not tested version 3. minimum sdk version 2.1, these animation not work on it. there issue on implementing animation on android compatible version 2.1 2.3 or should implement animation programatically. aim switch activity left right , right left.

anim/anim_left.xml

<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" >      <translate         android:duration="2000"         android:fromxdelta="50%p"         android:interpolator="@android:anim/linear_interpolator"         android:toxdelta="0" />      <alpha         android:duration="1000"         android:fromalpha="0.0"         android:interpolator="@android:anim/linear_interpolator"         android:toalpha="1.0" /> </set> 

anim/anim_right.xml

you can achieve programatically: example:

translateanimation slide = new translateanimation(0, 0, 0, -1*screenheight(this));                 slide.setduration(1000);                  // slide.setfillafter(true);                    chargement_rel.startanimation(slide);                  slide = new translateanimation(0, 0, screenheight(this), 0);                    slide.setduration(1000);                   // slide.setfillafter(true);                    chargement_rel.startanimation(slide); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -