Activity jump and switching animation in Android

Source: Internet
Author: User

Android or later
OverridePendingTransition (R. anim. translate_in, R. anim. translate_out) can be used to switch the animation.
But the trouble is that you must finish the previous one when switching the animation.
And you cannot control the animation at the return and end times.
Now there is a way to use theme to control
<Style name = "MyTheme">
<Item name = "android: windowAnimationStyle"> @ style/ActivityAnimation </item>
</Style>
<Style name = "AnimationActivity">
<Item name = "android. activityOpenEnterAnimation"> @ anim/activity_open_enter </item>
<Item name = "android. activityOpenExitAnimation"> @ anim/activity_open_exit </item>
<Item name = "android. activityCloseEnterAnimation"> @ anim/activity_close_enter </item>
<Item name = "android. activityCloseExitAnimation"> @ anim/activity_close_exit </item>
</Style>
In this way, you can directly set theme for this activity in manifest. xml, which is much easier than using that system method.

Related Article

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.