0

There is Holo.ProgressBar.Large style in android holo theme:

<style name="Widget.Holo.ProgressBar.Large" parent="Widget.ProgressBar.Large">
    <item name="android:indeterminateDrawable">@android:drawable/progress_large_holo</item>
</style>

There is progress_large_holo.xml:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <rotate
         android:drawable="@drawable/spinner_76_outer_holo"
         android:pivotX="50%"
         android:pivotY="50%"
         android:fromDegrees="0"
         android:toDegrees="1080" />
</item>
<item>
    <rotate
         android:drawable="@drawable/spinner_76_inner_holo"
         android:pivotX="50%"
         android:pivotY="50%"
         android:fromDegrees="720"
         android:toDegrees="0" />
</item>

Why there`s two item in layer-list?

4 Answers4

2

The spinner is composed of two rotating PNGs. One rotates clockwise from 0 to 1080 degrees, that is 3 full turns, and the other one counterclockwise from 720 degrees to 0, that is 2 turns.

They both use the same time amount for the animation, so the effect is that the one that rotates three times moves faster than the other one.

You can find the PNGs in yourAndroidSDKrootFolderPath\platforms\android-xx\data\res\drawable-mdpi

You can also see them in this other question How can I get the same undefined ProgressBar as ICS with 2 rotating circles?

Community
  • 1
  • 1
Lucas L.
  • 1,001
  • 11
  • 19
0

One turns from 720 degrees to 0 and the other one turns from 0 to 1080. So basically you can choose, at least that is what i can get out of that piece of code without knowing what the layer-list is or should do.

fonZ
  • 2,428
  • 4
  • 21
  • 40
  • I see that one turns from 720 degrees to 0 and the other one turns from 0 to 1080. But for what reason? – user2630548 Nov 13 '13 at 19:16
  • I dont know, it might be because on mobile phones the screen turns. So it should have two positions and ways to transit from one to the other. Try to remove it and see what happens, or change the values. That is usually a good way to find out. – fonZ Nov 13 '13 at 19:21
0

when background is white theres only white progress bar, when background is black theres to progress bar(one in foreground one in background). If you whant to see it just open android settings and got to applications screen.

0

A LayerDrawable is a drawable object that manages an array of other drawables. Each drawable in the list is drawn in the order of the list—the last drawable in the list is drawn on top.

Each drawable is represented by an element inside a single element.

Take a look at the Android documentation for Layer Lists. http://developer.android.com/guide/topics/resources/drawable-resource.html#LayerList

Community
  • 1
  • 1
mdupls
  • 2,012
  • 1
  • 27
  • 40