; ActivityAnimation이라는 class 에서 NextActivity라는 클래스로 I


[Fade in]

startActivity(new Intent(ActivityAnimation.this, NextActivity.class));
      overridePendingTransition(R.anim.fade, R.anim.hold);


[Zoom in]

startActivity(new Intent(ActivityAnimation.this, NextActivity.class));
      overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);


<fade.xml>

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/accelerate_interpolator"
       android:fromAlpha="0.0" android:toAlpha="1.0"
       android:duration="@android:integer/config_longAnimTime" />


<hold.xml>

<translate xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/accelerate_interpolator"
       android:fromXDelta="0" android:toXDelta="0"
       android:duration="@android:integer/config_longAnimTime" />


<zoom_enter.xml>

<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:pivotX="50%p" android:pivotY="50%p"
           android:duration="@android:integer/config_mediumAnimTime" />
</set>


<zoom_exit.xml>

<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:pivotX="50%p" android:pivotY="50%p"
           android:duration="@android:integer/config_mediumAnimTime" />
    <alpha android:fromAlpha="1.0" android:toAlpha="0"
            android:duration="@android:integer/config_mediumAnimTime"/>
</set>

-----------------------------------------------------------
public void
overridePendingTransition (int enterAnim, int exitAnim)

Since: API Level 5

Call immediately after one of the flavors of startActivity(Intent) or finish() to specify an explicit transition animation to perform next.

Parameters
enterAnim A resource ID of the animation resource to use for the incoming activity. Use 0 for no animation.
exitAnim A resource ID of the animation resource to use for the outgoing activity. Use 0 for no animation.

'old > API_Demo' 카테고리의 다른 글

APP_Activity_Hello World  (0) 2010.03.15
APP_Activity_Forwarding  (0) 2010.03.15
APP_Activity_Dialog  (0) 2010.03.15
APP_Activity_Custom Title  (0) 2010.03.15
APP_Activiy_Custom Dialog  (0) 2010.03.15
Posted by jazzlife
,