List of android animations transition to transition?

Is there a list of all the animations that I can use to jump between two views? That is, zooming, slide, face, etc.

I can’t find an exhaustive list, either in the SDK or in a Google search.

Also, is there any demo app that will show all of them so I can evaluate which one is best for a particular use case?

+5
source share
3 answers

Unable to create full list of animations. Your imagination is the limit of the number of possible animations.

(, , ) . .

+2

, , , , , , , .

git https://github.com/lgvalle/Material-Animations

,

here is the operation code you should write

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splashscreen);

     new Handler().postDelayed(new Runnable() {
         public void run() {

                 /* Create an intent that will start the main activity. */
                 Intent mainIntent = new Intent(SplashScreen.this,
                         ConnectedActivity.class);
                 mainIntent.putExtra("id", "1");

                 //SplashScreen.this.startActivity(mainIntent);
                 startActivity(mainIntent);
                 /* Finish splash activity so user cant go back to it. */
                 SplashScreen.this.finish();

                 /* Apply our splash exit (fade out) and main
                    entry (fade in) animation transitions. */
                 overridePendingTransition(R.anim.mainfadein,R.anim.splashfadeout);
         }
 }, SPLASH_DISPLAY_TIME);   
}

Add two files to the res / anim folder.

slide_in.xml

 <?xml version="1.0" encoding="utf-8"?>
        <translate 
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:duration="@android:integer/config_longAnimTime" 
              android:fromXDelta="100%p" 
              android:toXDelta="0%p">
        </translate>

slide_out.xml

 <?xml version="1.0" encoding="utf-8"?>
       <translate
             xmlns:android="http://schemas.android.com/apk/res/android" 
             android:duration="@android:integer/config_longAnimTime" 
             android:fromXDelta="0%p" 
             android:toXDelta="-100%p">
      </translate>

I hope this solves your requests.

0
source

All Articles