user2630548
user2630548

Reputation: 9

Android Holo.ProgressBar.Large style

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?

Upvotes: 0

Views: 2492

Answers (4)

mdupls
mdupls

Reputation: 2012

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

Upvotes: 0

Lucas L.
Lucas L.

Reputation: 1021

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?

Upvotes: 2

user2630548
user2630548

Reputation: 9

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.

Upvotes: 0

fonZ
fonZ

Reputation: 2479

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.

Upvotes: 0

Related Questions