I'm developing a watch face and want to rotate the second's hand 1.2 degrees in 1/5 of a second.
Why these numbers?
1) 360 degrees / 60 seconds = 6 degress per second
2) 6 degrees / 5 = 1.2 degrees (rotates 1.2 degrees in a fifth of a second).
Below is the normal rotation (6 degress in a second).
The image above spends one second to rotate 6 degrees.
My question is: How to spends one fifth of a second to rotate 1.2 degress?
This is my code:
private void drawClassicSecondsHand(Canvas canvas) {
final int seconds = (mCalendar.get(Calendar.SECOND));
final float secondsRotation = seconds * 6;
float originRadius = complicationHandBitmap.getWidth() / 2f;
float secondsAreaCenterX = mCenterX - (float) (mCenterX * 0.45);
canvas.rotate(secondsRotation, secondsAreaCenterX, mCenterY);
classicSecondsComplication.draw(
canvas,
secondsAreaCenterX,
mCenterY,
classicComplicationRadius,
complicationHandBitmap,
originRadius);
}
The above method is called in the onDraw
method of my watch face service.
public void onDraw(Canvas canvas, Rect bounds) {
...
drawClassicSecondsHand(Canvas canvas);
}