2

画面の中央からアクティビティをアニメーション化してから、フルスクリーンで開きたいです。(花開きのように)。

これを試してみましたが、スライドインします。
開始

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

終わり

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXDelta="0%"
    android:interpolator="@android:anim/accelerate_interpolator"
    android:toXDelta="-100%" />
Intent detail = new Intent(this, DetailActivity.class);
startActivity(detail);
overridePendingTransition(R.anim.start,R.anim.end);
4

1 に答える 1

0

From ICS, default opening animation is scaling up, which you want. I got these code from ICS resource directory. you can find another examples from your platform files( android-sdk-macosx\platforms\android-15\data\res\anim\activity_*.xml)

I got below code from activity_open_enter.xml.

<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false"
    android:zAdjustment="top" >
    <alpha
        android:duration="@android:integer/config_shortAnimTime"
        android:fillAfter="false"
        android:fillBefore="false"
        android:fillEnabled="true"
        android:fromAlpha="0.0"
        android:interpolator="@interpolator/decelerate_cubic"
        android:toAlpha="1.0" />
    <scale
        android:duration="@android:integer/config_shortAnimTime"
        android:fillAfter="false"
        android:fillBefore="false"
        android:fillEnabled="true"
        android:fromXScale="1.1"
        android:fromYScale="1.1"
        android:interpolator="@interpolator/decelerate_quint"
        android:pivotX="50%p"
        android:pivotY="50%p"
        android:toXScale="1.0"
        android:toYScale="1.0" />
</set>
于 2012-04-17T13:20:16.883 に答える