Android Simple Welcome animation

Source: Internet
Author: User

1  PackageCom.leolu.fristapp;2 3 Importandroid.app.Activity;4 ImportAndroid.os.Bundle;5 ImportAndroid.view.View;6 Importandroid.view.animation.AlphaAnimation;7 Importandroid.view.animation.Animation;8 ImportAndroid.view.animation.Animation.AnimationListener;9 Ten  Public classSplashpageextendsActivity { One  A @Override -     protected voidonCreate (Bundle savedinstancestate) { -         Super. OnCreate (savedinstancestate); the          -         //Get activity_splash_page.xml layout -View view = View.inflate ( This, R.layout.activity_splash_page,NULL); -         //Loading Layouts + Setcontentview (view); -          +         //animate, Fade fade available alphaanimation, morph animation with rotateanimation, displacement animation with translateanimation A         //The first parameter has a value of 0.3f to start with a transparency of 30%, the second parameter value of 1.0f is the end of the transparency of 100%, that is, opaque.  atAlphaanimation alphaanimation =NewAlphaanimation (0.3f, 1.0f); -          -         //set the duration of the animation, if not set, the time is 0, the animation will not see the effect -Alphaanimation.setduration (2000); -          -         //run the animation for our background in view.startanimation (alphaanimation); -          to         //set up an animation listener +Alphaanimation.setanimationlistener (NewAnimationlistener () { -              the@Override//The animation starts by doing the following *              Public voidOnanimationstart (Animation Animation) { $                 Panax Notoginseng             } -              the@Override//The following methods are performed when the animation repeats +              Public voidonanimationrepeat (Animation Animation) { A                  the             } +              -@Override//at the end of the animation, perform the following methods $              Public voidonanimationend (Animation Animation) { $                  -             } -         }); the          -     }Wuyi  the      -}

Android Simple Welcome animation

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.