I have CustomClass with image at the center.
I use compass and rotate canvas.
When data from compass is changed the canvas is invalidate and redraw.
Have you any idea, to draw Canvas and rotate it without redraw?
My code is below:
@Override
protected void onDraw(Canvas canvas) {
Paint paint = mPaint;
paint.setAntiAlias(true);
paint.setStyle(Paint.Style.FILL);
canvas.translate(getWidth()/2, getHeight()/2);
if (mValues != null) {
rotate=-mValues[0];
}
canvas.rotate(rotate);
canvas.drawBitmap(imgtable, - imgtable.getWidth()/2, - imgtable.getHeight()/2, null);
}