Android custom chrysanthemum and android custom Chrysanthemum
1. Frame Animation
Define res/anim/loading. xml as follows:
<? Xml version = "1.0" encoding = "UTF-8"?>
<Animation-list android: oneshot = "false"
Xmlns: android = "http://schemas.android.com/apk/res/android">
<Item android: duration = "150" android: drawable = "@ drawable/loading_01"/>
<Item android: duration = "150" android: drawable = "@ drawable/loading_02"/>
<Item android: duration = "150" android: drawable = "@ drawable/loading_03"/>
<Item android: duration = "150" android: drawable = "@ drawable/loading_04"/>
<Item android: duration = "150" android: drawable = "@ drawable/loading_05"/>
<Item android: duration = "150" android: drawable = "@ drawable/loading_06"/>
<Item android: duration = "150" android: drawable = "@ drawable/loading_07"/>
</Animation-list>
Reference the following in the layout file:
<ProgressBar android: id = "@ + id/loading_process_dialog_progressBar"
Android: layout_width = "wrap_content" android: layout_height = "wrap_content"
Android: indeterminate = "false" android: indeterminateDrawable = "@ anim/loading"/>
2. Use custom colors
Define res/drawable/dialog_style_xml_color.xml as follows:
<? Xml version = "1.0" encoding = "UTF-8"?>
<Rotate xmlns: android = "http://schemas.android.com/apk/res/android"
Android: shorttx = "50%" android: shortty = "50%" android: fromDegrees = "0"
Android: toDegrees = "360">
<Shape android: shape = "ring" android: innerRadiusRatio = "3"
Android: thicknessRatio = "8" android: useLevel = "false">
<Gradient android: type = "sweep" android: useLevel = "false"
Android: startColor = "# FFFFFF" android: centerColor = "# FFDC35"
Android: centerY = "0.50" android: endColor = "# CE0000"/>
</Shape>
</Rotate>
Reference the following in the layout file:
<ProgressBar android: id = "@ + id/loading_process_dialog_progressBar"
Android: layout_width = "wrap_content" android: layout_height = "wrap_content"
Android: indeterminate = "false" android: indeterminateDrawable = "@ drawable/dialog_style_xml_color"/>
3. By rotating an image definition
Define res/drawable/dialog_style_xml_icon.xml as follows:
<? Xml version = "1.0" encoding = "UTF-8"?>
<Layer-list xmlns: android = "http://schemas.android.com/apk/res/android">
<Item>
<Rotate android: drawable = "@ drawable/dialog_progress_round"
Android: fromDegrees = "0.0" android: toDegrees = "360.0" android: Export Tx = "50.0%"
Android: Ty = "50.0%"/>
</Item>
</Layer-list>