For example:
Animation animation1 = animationutils. loadanimation (homeactivity. This, R. anim. my_rotate_action );
Searchimageview. startanimation (animation1 );
Overridependingtransition () after 2.0 ()
Which contains two parameters. One is the entry of the previous activity that exits the activity,
@ Override
Public void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
Setcontentview (R. layout. splashscreen );
New handler (). postdelayed (New runnable (){
@ Override
Public void run (){
Intent mainintent = new intent (splashscreen. This, androidnews. Class );
Splashscreen. This. startactivity (mainintent );
Splashscreen. This. Finish ();
Overridependingtransition (R. anim. mainfadein,
R. anim. splashfadeout );
}
},3000 );
}
The above code is only part of the pop-up Screen
Getwindow
().
Setwindowanimations
(
Int
);
This is no better, but it can also
Fade in and out
Overridependingtransition (Android. R. anim. fade_in, Android. R. anim. fade_out );
Effect of sliding from left to right
Overridependingtransition (Android. R. anim. slide_in_left, Android. R. anim. slide_out_right );
Zoomin and zoomout are implemented, which is similar to the entry and exit effects of the iPhone.
Overridependingtransition (R. anim. zoomin, R. anim. zoomout );
Create a zoomin. xml file
<? XML version = "1.0" encoding = "UTF-8"?>
<Set xmlns: Android = "http://schemas.android.com/apk/res/android"
Android: interpolator = "@ Android: anim/decelerate_interpolator">
<Scale Android: fromxscale = "2.0" Android: toxscale = "1.0"
Android: fromyscale = "2.0" Android: toyscale = "1.0"
Android: Ready Tx = "50% P" Android: Ready ty = "50% P"
Android: Duration = "@ Android: integer/config_mediumanimtime"/>
</Set>
Create a zoomout. xml file
<? XML version = "1.0" encoding = "UTF-8"?>
<Set xmlns: Android = "http://schemas.android.com/apk/res/android"
Android: interpolator = "@ Android: anim/decelerate_interpolator"
Android: zadjustment = "TOP">
<Scale Android: fromxscale = "1.0" Android: toxscale = ". 5"
Android: fromyscale = "1.0" Android: toyscale = ". 5"
Android: Ready Tx = "50% P" Android: Ready ty = "50% P"
Android: Duration = "@ Android: integer/config_mediumanimtime"/>
<Alpha Android: fromalpha = "1.0" Android: toalpha = "0"
Android: Duration = "@ Android: integer/config_mediumanimtime"/>
</Set>