This might sound a little stupid, but where did you get this from?

I am trying to figure out how to change the colour of one of the progress 
bars at runtime when its value gets above a certain level.. I want it to be 
identical except just the colour value.

On Saturday, 4 October 2008 07:12:46 UTC+1, Jason Parekh wrote:
>
> Hi Allan,
>
> Here's an example XML drawable for the horizontal progress bar.  You could 
> set the ProgressBar.setProgressDrawable to this.
>
> <layer-list xmlns:android="http://schemas.android.com/apk/res/android";>
>     
>     <item android:id="@android:id/background">
>         <shape>
>             <corners android:radius="5dip" />
>             <gradient
>                     android:startColor="#ff9d9e9d"
>                     android:centerColor="#ff5a5d5a"
>                     android:centerY="0.75"
>                     android:endColor="#ff747674"
>                     android:angle="270"
>             />
>         </shape>
>     </item>
>     
>     <item android:id="@android:id/secondaryProgress">
>         <clip>
>             <shape>
>                 <corners android:radius="5dip" />
>                 <gradient
>                         android:startColor="#80ffd300"
>                         android:centerColor="#80ffb600"
>                         android:centerY="0.75"
>                         android:endColor="#a0ffcb00"
>                         android:angle="270"
>                 />
>             </shape>
>         </clip>
>     </item>
>     
>     <item android:id="@android:id/progress">
>         <clip>
>             <shape>
>                 <corners android:radius="5dip" />
>                 <gradient
>                         android:startColor="#ffffd300"
>                         android:centerColor="#ffffb600"
>                         android:centerY="0.75"
>                         android:endColor="#ffffcb00"
>                         android:angle="270"
>                 />
>             </shape>
>         </clip>
>     </item>
>     
> </layer-list>
>
>
>
>
> And just for future reference, here's an example of the circular 
> indeterminate progress bar XML drawable 
> (ProgressBar.setIndeterminateDrawable):
>
> <rotate xmlns:android="http://schemas.android.com/apk/res/android";
>         android:pivotX="50%" android:pivotY="50%"
>         android:fromDegrees="0" android:toDegrees="360">
>         
>     <shape
>             android:shape="ring"
>             android:innerRadiusRatio="3"
>             android:thicknessRatio="8"
>             android:useLevel="false">
>
>         <size
>                 android:width="48dip"
>                 android:height="48dip"
>         />
>         
>         <gradient
>                 android:type="sweep"
>                 android:useLevel="false"
>                 android:startColor="#4c737373"
>                 android:centerColor="#4c737373"
>                 android:centerY="0.50"
>                 android:endColor="#ffffd300"
>         />
>         
>     </shape>
>     
> </rotate>
>
>
> On Fri, Oct 3, 2008 at 6:39 PM, Allan Hsu <[email protected]<javascript:>
> > wrote:
>
>>
>> Does anybody know the proper format for declaring custom horizontal
>> progressbar drawables in xml? I've searched and searched, but the only
>> documentation/discussions I can find are for custom button graphics,
>> which seem to work via a different system.
>>
>>        -Allan
>> --
>> Allan Hsu <allan at counterpop dot net>
>>
>>
>>
>>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to