1.一种是Drawable 来实现 ,直接设置xml格式的drawable ,实用的场景比较多,包括通短栏的使用、drawable/ic_stat_download.xml

<?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/stat_sys_download_anim0"
        android:duration="200"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim1"
        android:duration="200"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim2"
        android:duration="200"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim3"
        android:duration="200"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim4"
        android:duration="200"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim5"
        android:duration="200"/>

</animation-list>

2.第二种 是用自定义的progressbar 来anim/downloading.xml

<?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/stat_sys_download_anim0"
        android:duration="150"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim1"
        android:duration="150"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim2"
        android:duration="150"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim3"
        android:duration="150"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim4"
        android:duration="150"/>
    <item
        android:drawable="@drawable/stat_sys_download_anim5"
        android:duration="150"/>

</animation-list>

用法,

<ProgressBar
     android:id="@+id/progressBar1"
     android:layout_width="36px"
     android:layout_height="36px"
     android:layout_margin="20dp"
     android:indeterminateDrawable="@anim/downloading"
     android:indeterminateOnly="true" />

其实这两种的xml写法是一样的..都是animation-list