开发者

android animation starting new activities or dismissing an Activity

开发者 https://www.devze.com 2023-04-07 00:41 出处:网络
Is there a tutorial or a code example o开发者_StackOverflowf various kinds of View Animations available in Android. Basically what I am trying to do is say if start a new Activity, I am trying to get

Is there a tutorial or a code example o开发者_StackOverflowf various kinds of View Animations available in Android. Basically what I am trying to do is say if start a new Activity, I am trying to get that activity start out like zoom in till it fills the screen or Fade out when I am going to finish the activity. Is there a way i can do this ?

Any help will be greatly appreciated.

Thanks -Chandu


So you need to use OverridePendingTransition from the activity: http://developer.android.com/reference/android/app/Activity.html

Some examples with Fade in/out can be found here: http://www.anddev.org/novice-tutorials-f8/splash-fade-activity-animations-overridependingtransition-t9464.html

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@android:anim/decelerate_interpolator"
        android:zAdjustment="top"
        android:fromAlpha="1.0"
        android:toAlpha="0.0"
        android:duration="1000" />

Zoom:

<scale
    android:pivotX="50%"
    android:pivotY="50%"
android:fromXScale=".1"
android:fromYScale=".1"
android:toXScale="1.0"
android:toYScale="1.0"
android:duration="2000" />
0

精彩评论

暂无评论...
验证码 换一张
取 消