Android uses theme custom activity to enter the exit animation method _android

Source: Internet
Author: User
Tags sqlite database

This article describes the way Android uses theme custom activity to enter exit animations. Share to everyone for your reference, specific as follows:

Do you feel that the default animation for an activity is too fast or too ugly?

I used activity.overridependingtransition to customize the activity's entry animation, but I found it impossible to define an exit animation. The result is a strong theme and style, which needs to be studied.

Specifically, this is the case:

Within Androidmanifest, the theme attribute can be defined for application and activity tags. If you define a property for application, it will have an effect on all the activity, and of course you can overwrite it in the activity.

<application android:theme= "@style/themeactivity" >

And then in the Values/themes.xml,

<style name= "Themeactivity" mce_bogus= "1" >
<item name= "Android:windowanimationstyle" > @style animationactivity</item>
<item name= "Android:windownotitle" >true</item>
</style >

In the Values/styles.xml

<style name= "animationactivity" parent= "@android: Style/animation.activity" mce_bogus= "1" >
<item name= "Android:activityopenenteranimation" > @anim/push_left_in</item>
<item name= "Android: Activityopenexitanimation "> @anim/push_left_out</item>
<item name=" Android: Activitycloseenteranimation "> @anim/push_right_in</item>
<item name=" Android: Activitycloseexitanimation "> @anim/push_right_out</item>
</style>

This is OK, as for the animation in Anim, define it yourself, this is the same as the ordinary animation, if you do not know, see

Http://developer.android.com/guide/topics/graphics/view-animation.html.

In this way, in addition to defining the animation of the activity, there are animations that Task,window appear and end, see

Http://developer.android.com/reference/android/R.styleable.html

PS: Here again to provide you with a androidmanifest function of the online inquiry form for your reference:

Android manifest Features and Permissions description Encyclopedia:
Http://tools.jb51.net/table/AndroidManifest

For more information on Android-related content readers can view the site: "The activity of Android programming skills Summary", "Android Resources Operating Skills Summary", "Android File Operating skills summary", " Android Operation SQLite Database skills Summary, "Android operation JSON format Data Skills summary", "Android Database Operation skills Summary", "Android programming development of SD card Operation Summary", "Android Development introduction and Advanced Course", The Android View view tips summary and the Android Control usage summary

I hope this article will help you with the Android program.

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.