差满多乃几

Android自己写一个动画

1.1,动画:

<?xml version="1.0" encoding="utf-8"?>

<rotate xmlns:android="https://schemas.android.com/apk/res/android"

    android:fromDegrees="0"

    android:pivotX="50%"

    android:pivotY="50%"

    android:toDegrees="360" >

    <shape

        android:innerRadiusRatio="3"

        android:shape="ring"

        android:thicknessRatio="8"

        android:useLevel="false" >

        <gradient

            android:centerColor="#FFFFFF"

            android:centerY="0.50"

            android:endColor="#1E90FF"

            android:startColor="#000000"

            android:type="sweep"

            android:useLevel="false" />

    </shape>

</rotate>

1.2,图片动画

<?xml version="1.0" encoding="utf-8"?>

<animated-rotate xmlns:android="https://schemas.android.com/apk/res/android"

    android:drawable="@drawable/wifi_progress_img"

    android:pivotX="50%"

    android:pivotY="50%" />


2,xml 中的ProgressBar:

<ProgressBar

            android:id="@+id/progressBar_openwifi"

            style="?android:attr/progressBarStyleLarge"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_gravity="center"

            android:focusable="false"

            android:indeterminateDrawable="@drawable/progress_wait_wifi" />