Android ProgressBar style, androidprogressbar
The Android system has been changed by major manufacturers, and the effects of various system components on different mobile phones are completely different. To maintain a unified interface style during development, you must modify the style of all system components. Now you need to modify the defaultProgressBarAs far as the Android system is concerned, different versions of components have different styles.
ProgressBar style in the system
Findandroid-sdkDirectoryplatforms\android-15\data\res\valuesInstyles.xmlAnd then find the ProgressBar, you can find
<style name="Widget.ProgressBar"> <item name="android:indeterminateOnly">true</item> <item name="android:indeterminateDrawable">@android:drawable/progress_medium_white</item> <item name="android:indeterminateBehavior">repeat</item> <item name="android:indeterminateDuration">3500</item> <item name="android:minWidth">48dip</item> <item name="android:maxWidth">48dip</item> <item name="android:minHeight">48dip</item> <item name="android:maxHeight">48dip</item> </style>
android:indeterminateDrawableIs@android:drawable/progress_medium_white, Find progress_medium_white.xml in the drawable directory, and open
<?xml version="1.0" encoding="utf-8"?><animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/spinner_white_48" android:pivotX="50%" android:pivotY="50%" android:framesCount="12" android:frameDuration="100" />
Using a simple spinner_white_48.pngRotating Animation
Custom
android:indeterminateDrawableValue rotation Animation
<?xml version="1.0" encoding="utf-8"?><rotate xmlns:android="http://schemas.android.com/apk/res/android" android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0" android:toDegrees="360"> <bitmap android:src="@mipmap/icon_timeline_stop_blue" android:antialias="true" android:filter="true"></bitmap></rotate>
Then
<ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:indeterminateDrawable="@drawable/loading_anim" android:id="@+id/progressBar" />
You can create a simple ssbar for rotating styles.
Frame Animation
Another style isFrame Animation, There is something to note here
Two images for Frame Animation
<?xml version="1.0" encoding="utf-8"?><animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:duration="100"> <clip android:clipOrientation="horizontal" android:drawable="@mipmap/kaoyan_tip_f1" android:gravity="left" /> </item><item android:duration="100"> <clip android:clipOrientation="horizontal" android:drawable="@mipmap/kaoyan_tip_f2" android:gravity="left" /></item></animation-list>
Note that you must useclipNode to specifyandroid:clipOrientationAndandroid:gravity="left"Otherwise, the screen may be incomplete.