Animation

hlight:: java

Sample

Download source code from DevBytes: Window Animations

Slide the next activity in as we slide this activity out:

Intent subActivity = new Intent(WindowAnimations.this,
        AnimatedSubActivity.class);
// The enter/exit animations for the two activities are specified by xml resources
Bundle translateBundle =
        ActivityOptions.makeCustomAnimation(WindowAnimations.this,
        R.anim.slide_in_left, R.anim.slide_out_left).toBundle();
startActivity(subActivity, translateBundle);

Scale up the new activity from a given bitmap, cross-fading between the starting and ending representations

BitmapDrawable drawable = (BitmapDrawable) thumbnail.getDrawable();
Bitmap bm = drawable.getBitmap();
Intent subActivity = new Intent(WindowAnimations.this, AnimatedSubActivity.class);
Bundle scaleBundle = ActivityOptions.makeThumbnailScaleUpAnimation(
        thumbnail, bm, 0, 0).toBundle();
startActivity(subActivity, scaleBundle);