[android-developers] Re: How to do an animated pie chart?

2009-01-07 Thread Jonathan Parker
Maybe when android support animated gifs that would be easier (assuming
there is an animated gif generator library):
http://groups.google.com/group/android-beginners/browse_thread/thread/edfc219135fe0909?pli=1

I wonder if Google Charts API will support animated gifs in the future. That
would be a killer feature.

On Tue, Jan 6, 2009 at 11:04 AM, melody melodis.andr...@gmail.com wrote:


 I wasn't able to do this with the standard animation classes, but I
 did manage to do it.

 First I used the use of the ArcShape class to generate the slice of
 the pie.  In order to acheive the animation, I set up a worker thread
 to repeatedly change the sweepAngle and call invalidate() on the
 containing view at an arbitrary refresh rate (50ms seems to look
 smooth).  It seems to work fine, but again, if anyone knows of a
 better way to do this, I'm all ears.



 melody wrote:
  Hi,
 
  I tried asking this in the beginners forum but didn't get any
  responses so I thought I'd try here.
 
  I was wondering if someone could give me some guidance on how to do an
  animated pie chart. My initial idea is to have a circle background
  image as my pie, and then create a slice of the pie and animate the
  scale and rotation of the slice.  However I'm not really sure how to
  do that.
 
  Or if there is a completely different but better way to do this, that
  would be great to know too.
 
  Thanks.
 


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



[android-developers] Re: How to do an animated pie chart?

2009-01-05 Thread melody

I wasn't able to do this with the standard animation classes, but I
did manage to do it.

First I used the use of the ArcShape class to generate the slice of
the pie.  In order to acheive the animation, I set up a worker thread
to repeatedly change the sweepAngle and call invalidate() on the
containing view at an arbitrary refresh rate (50ms seems to look
smooth).  It seems to work fine, but again, if anyone knows of a
better way to do this, I'm all ears.



melody wrote:
 Hi,

 I tried asking this in the beginners forum but didn't get any
 responses so I thought I'd try here.

 I was wondering if someone could give me some guidance on how to do an
 animated pie chart. My initial idea is to have a circle background
 image as my pie, and then create a slice of the pie and animate the
 scale and rotation of the slice.  However I'm not really sure how to
 do that.

 Or if there is a completely different but better way to do this, that
 would be great to know too.

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



[android-developers] Re: How to do an animated pie chart?

2009-01-05 Thread Dianne Hackborn
You shouldn't need to use a worker thread.  If you want to run up to the
screen refresh rate, just do invalidate() in onDraw().  Otherwise, you can
use Handler in the main thread to post delayed messages to achieve whatever
update rate you want.

On Mon, Jan 5, 2009 at 4:04 PM, melody melodis.andr...@gmail.com wrote:


 I wasn't able to do this with the standard animation classes, but I
 did manage to do it.

 First I used the use of the ArcShape class to generate the slice of
 the pie.  In order to acheive the animation, I set up a worker thread
 to repeatedly change the sweepAngle and call invalidate() on the
 containing view at an arbitrary refresh rate (50ms seems to look
 smooth).  It seems to work fine, but again, if anyone knows of a
 better way to do this, I'm all ears.



 melody wrote:
  Hi,
 
  I tried asking this in the beginners forum but didn't get any
  responses so I thought I'd try here.
 
  I was wondering if someone could give me some guidance on how to do an
  animated pie chart. My initial idea is to have a circle background
  image as my pie, and then create a slice of the pie and animate the
  scale and rotation of the slice.  However I'm not really sure how to
  do that.
 
  Or if there is a completely different but better way to do this, that
  would be great to know too.
 
  Thanks.
 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---