AFAIK, neither <rotate> nor <translate> are valid for a drawable
resource. Those are used with tween animations for animation
resources:

http://developer.android.com/guide/topics/resources/animation-resource.html#Tween

As for how to solve your problem, one solution put an ImageView with
your needle atop your ProgressBar and use margins to position it.
Crude, but as you point out, in app widgets, you don't exactly have
tons o' options.

Another possible solution is to make your progress drawable be a
nine-patch PNG, where the needle is outside of the stretch area. That
may not give you quite accurate results for low progress values, but
it will asymptotically approach accuracy by the time you complete the
bar.

On Tue, Jan 4, 2011 at 9:30 PM, Henrik Lindqvist
<henrik.lindqv...@gmail.com> wrote:
> I'am trying to make a ProgressBar with a moving needle. Since it's in
> a app-widget I can't make any custom code. It all needs to be done
> with Drawables.
>
> Creating a rotating ProgressBar is easy, just use <rotate>. But to
> move a needle image I've tried <translate>, it gives an error "invalid
> drawable tag translate".
>
> Anyone got any suggestions?
>
> --
> 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
>



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

Android Training in London: http://bit.ly/smand1 and http://bit.ly/smand2

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

Reply via email to