default android animation on activity

4,288 views
Skip to first unread message

MBethDev

unread,
Jun 23, 2010, 5:33:10 PM6/23/10
to android-porting
Hello,

Does anyone know what animation is getting triggered when I exit an
application (the animation where the exiting activity/app shrinks and
disappears?) I'm able to find in the frameworks/base/core what
attribute is triggering this (wallpaperCloseExitAnimation), but when I
checkout the source of the animation (wallpaper_close_exit.xml), it
looks like it does an expansion with no alpha, by default. I saw some
animations that were commented, so i commented one of them to see if
that was the one (basically the second commented <set>), but after
running that its not the same as the animation on the emulator SDK.

MB

Dianne Hackborn

unread,
Jun 23, 2010, 5:47:21 PM6/23/10
to mbet...@gmail.com, android-porting
The possible animations are in frameworks/base/res/res/values/attrs.xml:

    <!-- Window animation class attributes. -->
    <declare-styleable name="WindowAnimation">
        <!-- The animation used when a window is being added. -->
        <attr name="windowEnterAnimation" format="reference" />
        <!-- The animation used when a window is being removed. -->
        <attr name="windowExitAnimation" format="reference" />
        <!-- The animation used when a window is going from INVISIBLE to VISIBLE. -->
        <attr name="windowShowAnimation" format="reference" />
        <!-- The animation used when a window is going from VISIBLE to INVISIBLE. -->
        <attr name="windowHideAnimation" format="reference" />
        
        <!--  When opening a new activity, this is the animation that is
              run on the next activity (which is entering the screen). -->
        <attr name="activityOpenEnterAnimation" format="reference" />
        <!--  When opening a new activity, this is the animation that is
              run on the previous activity (which is exiting the screen). -->
        <attr name="activityOpenExitAnimation" format="reference" />
        <!--  When closing the current activity, this is the animation that is
              run on the next activity (which is entering the screen). -->
        <attr name="activityCloseEnterAnimation" format="reference" />
        <!--  When closing the current activity, this is the animation that is
              run on the current activity (which is exiting the screen). -->
        <attr name="activityCloseExitAnimation" format="reference" />
        <!--  When opening an activity in a new task, this is the animation that is
              run on the activity of the new task (which is entering the screen). -->
        <attr name="taskOpenEnterAnimation" format="reference" />
        <!--  When opening an activity in a new task, this is the animation that is
              run on the activity of the old task (which is exiting the screen). -->
        <attr name="taskOpenExitAnimation" format="reference" />
        <!--  When closing the last activity of a task, this is the animation that is
              run on the activity of the next task (which is entering the screen). -->
        <attr name="taskCloseEnterAnimation" format="reference" />
        <!--  When opening an activity in a new task, this is the animation that is
              run on the activity of the old task (which is exiting the screen). -->
        <attr name="taskCloseExitAnimation" format="reference" />
        <!--  When bringing an existing task to the foreground, this is the
              animation that is run on the top activity of the task being brought
              to the foreground (which is entering the screen). -->
        <attr name="taskToFrontEnterAnimation" format="reference" />
        <!--  When bringing an existing task to the foreground, this is the
              animation that is run on the current foreground activity
              (which is exiting the screen). -->
        <attr name="taskToFrontExitAnimation" format="reference" />
        <!--  When sending the current task to the background, this is the
              animation that is run on the top activity of the task behind
              it (which is entering the screen). -->
        <attr name="taskToBackEnterAnimation" format="reference" />
        <!--  When sending the current task to the background, this is the
              animation that is run on the top activity of the current task
              (which is exiting the screen). -->
        <attr name="taskToBackExitAnimation" format="reference" />
        
        <!--  When opening a new activity that shows the wallpaper, while
              currently not showing the wallpaper, this is the animation that
              is run on the new wallpaper activity (which is entering the screen). -->
        <attr name="wallpaperOpenEnterAnimation" format="reference" />
        <!--  When opening a new activity that shows the wallpaper, while
              currently not showing the wallpaper, this is the animation that
              is run on the current activity (which is exiting the screen). -->
        <attr name="wallpaperOpenExitAnimation" format="reference" />
        <!--  When opening a new activity that hides the wallpaper, while
              currently showing the wallpaper, this is the animation that
              is run on the new activity (which is entering the screen). -->
        <attr name="wallpaperCloseEnterAnimation" format="reference" />
        <!--  When opening a new activity that hides the wallpaper, while
              currently showing the wallpaper, this is the animation that
              is run on the old wallpaper activity (which is exiting the screen). -->
        <attr name="wallpaperCloseExitAnimation" format="reference" />
        
        <!--  When opening a new activity that is on top of the wallpaper
              when the current activity is also on top of the wallpaper,
              this is the animation that is run on the new activity
              (which is entering the screen).  The wallpaper remains
              static behind the animation. -->
        <attr name="wallpaperIntraOpenEnterAnimation" format="reference" />
        <!--  When opening a new activity that is on top of the wallpaper
              when the current activity is also on top of the wallpaper,
              this is the animation that is run on the current activity
              (which is exiting the screen).  The wallpaper remains
              static behind the animation. -->
        <attr name="wallpaperIntraOpenExitAnimation" format="reference" />
        <!--  When closing a foreround activity that is on top of the wallpaper
              when the previous activity is also on top of the wallpaper,
              this is the animation that is run on the previous activity
              (which is entering the screen).  The wallpaper remains
              static behind the animation. -->
        <attr name="wallpaperIntraCloseEnterAnimation" format="reference" />
        <!--  When closing a foreround activity that is on top of the wallpaper
              when the previous activity is also on top of the wallpaper,
              this is the animation that is run on the current activity
              (which is exiting the screen).  The wallpaper remains
              static behind the animation. -->
        <attr name="wallpaperIntraCloseExitAnimation" format="reference" />
    </declare-styleable>

The default values for these are in style.xml:

    <!-- Standard animations for a full-screen window or activity. -->
    <style name="Animation.Activity">
        <item name="activityOpenEnterAnimation">@anim/activity_open_enter</item>
        <item name="activityOpenExitAnimation">@anim/activity_open_exit</item>
        <item name="activityCloseEnterAnimation">@anim/activity_close_enter</item>
        <item name="activityCloseExitAnimation">@anim/activity_close_exit</item>
        <item name="taskOpenEnterAnimation">@anim/task_open_enter</item>
        <item name="taskOpenExitAnimation">@anim/task_open_exit</item>
        <item name="taskCloseEnterAnimation">@anim/task_close_enter</item>
        <item name="taskCloseExitAnimation">@anim/task_close_exit</item>
        <item name="taskToFrontEnterAnimation">@anim/task_open_enter</item>
        <item name="taskToFrontExitAnimation">@anim/task_open_exit</item>
        <item name="taskToBackEnterAnimation">@anim/task_close_enter</item>
        <item name="taskToBackExitAnimation">@anim/task_close_exit</item>
        <item name="wallpaperOpenEnterAnimation">@anim/wallpaper_open_enter</item>
        <item name="wallpaperOpenExitAnimation">@anim/wallpaper_open_exit</item>
        <item name="wallpaperCloseEnterAnimation">@anim/wallpaper_close_enter</item>
        <item name="wallpaperCloseExitAnimation">@anim/wallpaper_close_exit</item>
        <item name="wallpaperIntraOpenEnterAnimation">@anim/wallpaper_intra_open_enter</item>
        <item name="wallpaperIntraOpenExitAnimation">@anim/wallpaper_intra_open_exit</item>
        <item name="wallpaperIntraCloseEnterAnimation">@anim/wallpaper_intra_close_enter</item>
        <item name="wallpaperIntraCloseExitAnimation">@anim/wallpaper_intra_close_exit</item>
    </style>





--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

krisdi...@gmail.com

unread,
Jun 12, 2017, 10:11:52 AM6/12/17
to android-porting, hac...@android.com
Hey! 

Do you know what ID/INT the enter/exit animations have? I'm trying to only configure one of the animations on pending, but I only know of that which is mentioned at developers android, which is 0 for no animation.

    overridePendingTransition(0,R.anim.fadestar); //What to use where 0 is to make it not change from the default.
 
Thanks..
Reply all
Reply to author
Forward
0 new messages