How create ScaleAnimation in canvas? I have several sprites to my canvas and i want to apply ScaleAnimation. My code:
public void onDraw(Canvas canvas){
ScaleAnimation scale = new ScaleAnimation(0, 2, 0, 2);
scale.setInterpolator(new AccelerateDecelerateInterpolator());
scale.setDuration(1000L);
startAnimation(scale);
rect.set(150, 150, 300, 300);
paint.setColor(Color.RED);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(3);
canvas.drawRoundRect(rect, sizeCage / 10, sizeCage / 10, paint);
}
As I doubted and Described Here You cannot use view animations inside the canvas objects since they belongs to Graphics Class.
Here is A simple code which may help you get started.
}