TrueAnalogClockHand Overview

How this class works?

First of all - the class calculates the position of the hand axis using "axisPoint" and "axisFacePoint" attributes.

Then TrueAnalogClockHand class calculates the angle using current time or value and all the related attributes, like value range, value offset, angle range, angle offset and so on.

When the angle is calculated the hand class rotates canvas, draws shadow (if it is enabled) and draws the hand image.

All the standard hand types (second, minute, hour, hour24, day of week, day of month, month) require nothing from you. They use the time (system with any offset or any custom) and always show correct values. The custom time of hand allows you to display any custom parameter. Of course, retrograde mode can be implemented if hand's angle range is less than 360 degree.

The good example that demonstrates all the important properties of the hand is the power reserve (battery level) indicator based on the custom hand.

The hand was drawn vertical (12 hours position), so the red arch shows the angle offset, the blue arch shows the angle range, the magenta dot matches the value offset, the green dot matches the value range and the orange dot matches the value.

Hand image must be created in the same scale that is used for face and glass drawing.

The clock hand can be initialized and added to clock from the code as well as loaded from clock's XML resource.