Is it possible to draw an object with pre-set time-lapse animation - AnimationDrawable
on the Bitmap
object, using Canvas
' a. In this case, I would like to draw an already prepared animation on the surface (Surface) of the object of the LiveWallpaper
class. That is, I would like to draw something “live” on “live” wallpaper with a minimum of code (a special new class LiveWallpaper
, appeared in Android from version 2.3)
|
1 answer
AnimationDrawable
like any other Drawable
can draw itself .
animationDrawable.draw(canvas);
Or have you tried and failed?
- Forgive the fool. Hurried with a question. I decided to immediately ask for help. Thank you and happy new year. - zugzug
- @zugzug And you with the coming :) - Sergeyitch
- Hello. Tried this method. But it does not work in this case. The fact is that for drawing on live wallpaper, the SurfaceHolder class provides the Canvas for some time for drawing, that is, it is adapted for drawing work from a stream (Thread). AnimationDrawable and Thread things are different. Is there anyway the scheme of using in this case the prepared animation, i.e. to use AnimationDrawable class in live wallpaper? - zugzug
- @zugzug, how did you solve the problem? - Ivan Vovk
- @IvanVovk Hello. Sorry, now I do not remember. It’s been a long time away from the development for Android, and those sources are most likely already lost. - zugzug
|