Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Sliding animation when switch to other activity

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 301
    Comment on it

    We can add animation on activity switching.
    First thing that we need to do is to create xml for animation. Here I am using two xml for in and out.


    animation_in.xml

    set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="false"> 
            translate android:fromxdelta="100%" 
             android:toXDelta="0%" 
             android:fromYDelta="0%" 
             android:toYDelta="0%" 
             android:duration="200"/> 
      /translate>/set> 


    animation_out.xml

     
          translate android:fromxdelta="100%" android:toxdelta="0%" android:fromydelta="0%" android:toydelta="0%" android:duration="200"> 
        /translate>/set> 


    After saving these xml files in anim folder just call intent like this:

    Intent animIntent= new Intent(SlidingAnimExample.this,TestingActivity.class); 
        startActivity(animIntent); 
        overridePendingTransition(R.anim.animation_in, R.anim. animation _out); 

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: