开发者

Is it possible to animate a drawable without going through a View?

开发者 https://www.devze.com 2023-04-01 08:34 出处:网络
(I am referring to the old Android animation system here, not the property anims that were introduced with Honeycomb.)

(I am referring to the old Android animation system here, not the property anims that were introduced with Honeycomb.)

I am trying to wrap my head around how to animate markers on a Map开发者_StackOverflow中文版View. Since map views use map Overlays, and since overlays are neither views nor expose their markers as Views, but as Drawables, I am looking for ways to animate a drawable without putting it in a view container.

Is that possible at all? Looking at the Android sources, it looks as if Animation and its various implementations merely contain the code to compute the mathematical transformations an animation applies. Similarly, e.g. RotateDrawable only contains the code to compute the rotation, plus code that draws the transformed drawable to a canvas.

However, neither contain code to make an animation play; I was only able to see an animation play when using it through View.startAnimation(animation).

Is there a way to play animations or use an animated drawable without a View?


I am trying to wrap my head around how to animate markers on a MapView.

Write your own Overlay that works like ItemizedOverlay but performs your own animations, either using ImageView and the classic animation framework, or your own drawing code.

Is there a way to play animations or use an animated drawable without a View?

I haven't tried an AnimationDrawable with ItemizedOverlay, so if a frame-by-frame animation is all you need, that's at least worth a shot. Otherwise, again, you're back to doing your own Overlay, I'm afraid.

0

精彩评论

暂无评论...
验证码 换一张
取 消