I have a android.graphics.Bitmap object that I draw on my canvas, what I am trying to do is animate it from position x,y to position x1, y1. So after looking through the Animation library I figured I could use the TranslateAnimation to do the animation how ever the Bitmap object does not have a “startAnimation” method. So how do I animate my bitmap? Do I need to wrap it in some other object?
Share
You could set it to an
ImageViewand animate theImageViewinstead.EDIT: Now that I think about it, you should be displaying the bitmap through some view anyway. Tween animations can be applied to any visible view, so whatever is displaying the Bitmap, just animate that.
Alternatively, you can extend a
Viewand create a custom view. Use thecanvas.translate(toX, toY)method to shift the canvas and draw the bitmap.