Android form Animation: The activity starts to slide from the bottom up. When it is disabled, it slides down from the top to disappear.

Source: Internet
Author: User
In the IOS system, we open an app with a boot animation. In this way, when a new form is opened, the user feels that there is a transition animation and the experience is very good, I don't think a form will pop up very suddenly. The following is an example of how to enable and disable an android activity.
Knowledge point:1. You need to configure two animation XML files, one is the start animation and the other is the end animation. 2. Start or close the animation call time.
Knowledge Point 1:You need to add two animation files under anim: activity_open.xml ):
<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android">   <translate    android:fromYDelta="100%p"    android:toYDelta="0"android:duration="1500"  /></set>
End animation (activity_close.xml ):
<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android">   <translate    android:fromYDelta="25"    android:toYDelta="100%p"    android:duration="1500"   /></set>

Knowledge Point 2:Set the startup Animation:

Intent intent = new intent (); intent. setclassname (cxt, "com. test. MRN. android. route. routedemoactivity "); // open an activity cxt. startactivity (intent); cxt. overridependingtransition (R. anim. activity_open, 0 );
Set to close the animation:
@ Overridepublic void finish () {// todo auto-generated method stubsuper. Finish (); // close the form animation to display this. overridependingtransition (R. anim. bottom_end, 0 );}


Additional knowledge points:When the status does not need to appear, you need to set the activity status bar to transparent. In androidmanifest. XML, configure Android: theme = "@ Android: style/theme. translucent"

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.