Just set this as the drawable in a ProgressBar widget and control it with
that.

On Sat, May 14, 2011 at 5:43 AM, Serdel <[email protected]>wrote:

> That in deed is a nice approach. I wasn't aware that android has such
> a drawable. To abd this is more a 'ring' shape than a filled circle,
> but I guess a ring is also acceptable. But can you give me a hint how
> to control the 'progress' in the java code? So that I can i.e.
> increase it fluently in a timer or indicate a progress in downloading
> a file.
>
> On 13 Maj, 23:19, Romain Guy <[email protected]> wrote:
> > You don't need to do all this. All you need is a drawable that supports
> > levels. Android even provides a circle drawable that gets filled when you
> > change the progress. Here's an example:
> >
> > <layer-list xmlns:android="http://schemas.android.com/apk/res/android";>
> >     <item
> android:drawable="@android:drawable/progress_circular_background" />
> >     <item>
> >         <shape android:shape="ring"
> >                android:innerRadiusRatio="3.4"
> >                android:thicknessRatio="6.0">
> >             <gradient
> >                    android:useLevel="true"
> >                    android:type="sweep"
> >                    android:startColor="#ff000000"
> >                    android:endColor="#ffffffff" />
> >         </shape>
> >     </item>
> >     <item>
> >         <rotate
> >             android:pivotX="50%" android:pivotY="50%"
> >             android:fromDegrees="0" android:toDegrees="360"
> >             android:drawable="@android:drawable/progress_particle" />
> >     </item>
> > </layer-list>
> >
> > On Fri, May 13, 2011 at 2:12 PM, Nicholas Johnson
> > <[email protected]>wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > Here's what you can do:
> >
> > > Extend the AbsSeekBar class<
> http://developer.android.com/reference/android/widget/AbsSeekBar.html>,
> > > and implement the onDraw method to your liking. You can capture the
> height
> > > and width of your custom view by capturing those values in the
> onSizeChanged
> > > method. By drawing your circle programatically you can easily make a
> > > progress circle that looks good at all resolutions. Also, you don't
> have to
> > > worry about different device resolutions, since you just need to
> control the
> > > size of the view in the layout.
> >
> > > Or, you could extend the ProgressBar class and do the same thing.
> >
> > > Nick
> >
> > >  --
> > > 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
> >
> > --
> > Romain Guy
> > Android framework engineer
> > [email protected]
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support.  All such questions should be posted on public
> > forums, where I and others can see and answer them
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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