Moto wrote:
> I tried doing a ProgressBar and I wanted to change the background and
> the progress bar using my own drawables from the drawable resource.
> Is this possible?
> I just don't want to spend time creating my own custom component if
> can be done relatively easy...

The ProgressBar uses a StateListDrawable, which can be created in Java
(AFAIK) or via XML and the <layer-list> element. The key is in the magic
IDs you need for the layers:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android";>
    <item android:id="@android:id/background">
        <clip>
        <!- some image here, e.g., <shape>...</shape> -->
        </clip>
    </item>
    <item android:id="@android:id/secondaryProgress">
        <clip>
        <!- some image here, e.g., <shape>...</shape> -->
        </clip>
    </item>
    <item android:id="@android:id/progress">
        <clip>
        <!- some image here, e.g., <shape>...</shape> -->
        </clip>
    </item>
</layer-list>

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to