Android Transitions Animation windowanimation and activityanimation differences (RPM)

Source: Internet
Author: User

The difference between Android transition animations Windowanimation and activityanimation

Obviously, window and activity itself know differently from names, but the difference between Windowanimation and activityanimation in project development must be understood.

The main differences are as follows

1.windowAnimation includes windowenteranimation and windowexitanimation; Activityanimation contains android: Activityopenenteranimation, Android:activityopenexitanimation, Android:activitycloseenteranimation and Android: Activitycloseexitanimation

2. The Windowanimation control over the project is greater than the control of the activity, that is, if both windowanimation and Activityanimation are set during the activity transition, Possible (because of this very much) will only execute windowanimation

3. The definition of windowanimation is simple, only need to inherit the animation style in the Style.xml file

   <style name="Animation" parent="@android: Style/animation" >          <!--form into animation        -- <name= "android:windowenteranimation" > @anim/slide_left_enter</<name=" Android:windowexitanimation "> @anim/slide_right_exit</</style>   

For activity, you need to inherit animation activity Style

<style name="Feelyouwindowanimtheme" parent="@android: Style/animation.activity" >      <ItemName="Android:activityopenenteranimation" > @android: Anim/slide_in_left</item> < item name= "Android:activityopenexitanimation" > @android: Anim/slide_out_right</item> <item name= "Android: Activitycloseenteranimation "> @anim/push_right_in</item> <item name= "Android:activitycloseexitanimation" > @anim/push_left_out</item> </STYLE>          
A2 when Android A2 when Android A1 when AndroidA1, Android: Activitycloseenteranimation       

From the definition of the above 2 animation, it is obvious that activityanimation is more complex, but the transition effect of this complex is very good, can control the animation of 2 activity at the same time, Unlike Windowanimation, you can only control the form animation of the next activity.

5. In development, form animations can also use Activity. Overridependingtransition can be set or defined in a theme, but activity can only be used in themes

<Application  Android:name= "Test.view.weitop.BaseApplication"   android:allowbackup= "false"   Android: Hardwareaccelerated= "false"   android:icon= "@drawable/ app_logo "  android: Label= "@string/app_name"    Android:largeheap= "true"    Android:theme= "@style/theme.app" >  </APPLICATION>          

6. For the comparison of the pursuit of aesthetic aesthetics of animation, the use of activityanimation is much better, so for general development use windowanimation can, but for the pursuit of user experience, then directly use Activity Animation Bar

Android Transitions Animation windowanimation and activityanimation differences (RPM)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.