Daisy loops (circular loading rings) that often appear in the Android UI

Source: Internet
Author: User

Late at night is also boring, look at the old code, found that we often use the Chrysanthemum ring, the original is a frame animation, a little meaning. Suddenly feel the frame animation do something good ah, at least it seems to listen to engaging. Start on the code:

First, the layout file:

<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android"    xmlns:tools= "http// Schemas.android.com/tools "    android:layout_width=" match_parent "    android:layout_height=" Match_parent "    android:background= "@drawable/login_bg" >   <progressbar       android:layout_width= "24dip"       android:layout_height= "24dip"       android:layout_alignparentbottom= "true"       android:layout_centerhorizontal= "True"       android:layout_marginbottom= "100dip"       android:indeterminate= "true"       Android: indeterminatedrawable= "@drawable/progress_animation"/></relativelayout>

<?xml version= "1.0" encoding= "Utf-8"? ><animation-list xmlns:android= "http://schemas.android.com/apk/res/ Android "android:oneshot=" false "> <item android:drawable=" @drawable/pull_ref_pb_1 "Android:dura         tion= "/> <item android:drawable=" @drawable/pull_ref_pb_2 "android:duration="/> <item android:drawable= "@drawable/pull_ref_pb_3" android:duration= "/> <item android:drawable="        @drawable/pull_ref_pb_4 "android:duration="/> <item android:drawable= "@drawable/pull_ref_pb_5" android:duration= "/> <item android:drawable=" @drawable/pull_ref_pb_6 "android:duration=" 80        "/> <item android:drawable=" @drawable/pull_ref_pb_7 "android:duration="/> <item android:drawable= "@drawable/pull_ref_pb_8" android:duration= "/> <item android:drawable=" @drawabl E/pull_ref_pb_9 "Android:duration= "/> <item android:drawable=" @drawable/pull_ref_pb_10 "android:duration="/> < Item android:drawable= "@drawable/pull_ref_pb_11" android:duration= "/> <item Android:drawa" ble= "@drawable/pull_ref_pb_12" android:duration= "/></animation-list>"

Package Com.woyou.frameanimation;import Java.util.timer;import Java.util.timertask;import android.content.Intent; Import android.os.bundle;import android.support.v7.app.actionbaractivity;/** * Daisy Ring Layout * @author Administrator * */  public class Frameactivity extends actionbaractivity {@Overrideprotected void onCreate (Bundle savedinstancestate) { Super.oncreate (savedinstancestate); Setcontentview (R.layout.login_main); Timer timer = new timer (); Timer.schedule (new TimerTask () {@Overridepublic void run () {Intent Intent = new Intent (frameacti Vity.this, Loginactivity.class); startactivity (intent); Finish ();}}, 5000);}}

It's time for him to jump over the clock.


Daisy loops (circular loading rings) that often appear in the Android UI

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.