Chrysanthemum circles (Circular loading circles) that often appear in the android UI, androidui

Source: Internet
Author: User

Chrysanthemum circles (Circular loading circles) that often appear in the android UI, androidui

The night was boring. I looked at the old Code and found that we often used the chrysanthemum ring. It was originally made by frame animation. Suddenly, it seems that the frame animation has a good effect, at least it looks good. Code on start:

First, 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:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_2"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_3"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_4"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_5"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_6"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_7"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_8"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_9"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_10"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_11"        android:duration="80"/>    <item        android:drawable="@drawable/pull_ref_pb_12"        android:duration="80"/></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;/*** chrysanthemum 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 (FrameActivity. this, LoginActivity. class); startActivity (intent); finish () ;}, 5000 );}}

Let him jump over at a scheduled time...


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.