Activity jump and toggle animation in Android

Source: Internet
Author: User

android2.0 above
You can use Overridependingtransition (r.anim.translate_in, r.anim.translate_out); This method toggles the animation
But the trouble is to toggle the animation time must finish the front one
And you can't control the animation at the back and end.
Now there's a way to control with theme
<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>
This allows you to set theme on this activity directly in Manifest.xml, which is more convenient than using the 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.