TrueAnalogClockHand

TrueAnalogClockHand Programming Interface

Interfaces

BeforeDrawListener
public Boolean onBeforeDraw(TrueAnalogClockHand hand, Canvas canvas)
Called before drawing the hand and its shadow and allows to draw hand from code manually. Return true to disable default drawing.

AfterDrawListener
public void onAfterDraw(TrueAnalogClockHand hand clock, Canvas canvas)
Called after drawing the hand and its shadow and allows to draw hand from code manually.

Methods

public void setBeforeDrawListener(BeforeDrawListener beforeDrawListener)
Sets BeforeDrawListener.

public void setAfterDrawListener(BeforeDrawListener beforeDrawListener)
Sets AfterDrawListener.

public boolean isUseSystemTime()
Returns true if hand uses current system time, otherwise false.

public void setUseSystemTime(boolean useSystemTime)
If true the hand must use the current system time, otherwise the internal time is used (see getTime/setTime).

public long getTime()
Returns current time in milliseconds (the value is returned by getTimeInMillis function of the internal calendar object).

public void setTime()
Sets internal clock time using the system current time.

public void setTime(long newTime)
public void setTime(int hour, int minute, int second)
public void setTime(int year, int month, int day, int hour, int minute, int second)
Sets internal clock time using the passed parameters.

public void setTimeOffset(long time)
public void setTimeOffset(int hour, int minute, int second)
Sets time offset using passed values. TrueAnalogClock class does not keep the value and just sets time offset for all contained hands.

public boolean getJumping()
Returns true if the hand is in the jumping mode.

public void setJumping(boolean jumping)
Sets the jumping mode.

public String getName()
Gets the name of hand.

public void setName(String name)
Sets the name of hand.

public boolean isHidden()
Returns true if the hand is hidden.

public void setHidden(boolean hidden)
Sets the hidden state. If true is passed the hand is not drawn.

public boolean isCounterclockwise()
Returns true if the hand has counterclockwise direction of rotation.

public void setCounterclockwise(boolean counterclockwise)
Set the direction of rotation.

public boolean isUnderFace()
If true, the hand is drawn before face drawing.

public void setUnderFace(boolean underFace)
If the passed parameter true the hand will be drawn before face image drawing.

public long getTimeOffset()
Returns the current time offset. This value is internal value of the hand object and does not relate to the current time zone.

public void setTimeOffset(long timeOffset)
public void setTimeOffset(int hour, int minute, int second)
Sets the internal time offset.

public long getTime()
Returns the time that is currently used in the hand object. If isUseSystemTime is true, the current system time is returned.

public void setTime(long time)
Sets the time of the hand object.

public HandType getType()
Returns type of the hand object.

public void setType(HandType type)
public enum HandType {Month, DayOfMonth, DayOfWeek, Hour24, Hour, Minute, Second, Custom}
Sets type of the hand.

public Point getAxisPoint()
Returns the axis point in the hand image coordinates.

public void setAxisPoint(Point axisPoint)
Sets the axis point in the hand image coordinates.

public Point getAxisFacePoint()
Gets the face axis point for this hand in the face image coordinates.

public void setAxisFacePoint(Point axisFacePoint)
Set the face axis point for this hand in the face image coordinates.

public float getAngleOffset()
Gets the start angle.

public void setAngleOffset(float angleOffset)
Sets the start angle.

public float getAngleRange()
Gets the angle range.

public void setAngleRange(float angleRange)
Sets the angle range.

public float getValue()
Gets the current value.

public void setValue(float value)
Sets the current value.

public float getValueOffset()
Gets the value offset. Default offset is 0.

public void setValueOffset(float valueOffset)
Sets the value offset.

public float getValueRange()
Gets the value range.

public void setValueRange(float valueRange)
Sets the value range.

public Bitmap getBitmap()
Gets the hand image.

public void setBitmap(Bitmap bitmap)
Sets the hand image.

public boolean isShadow()
Returns true if the hand shadow is enabled.

public void setShadow(boolean shadow)
If true is passed the hand shadow will be drawn.

public int getShadowColor()
Gets the color of hand shadow.

public void setShadowColor(int shadowColor)
Sets the color of hand shadow.

public float getShadowBlurRadius()
Gets hand shadow blur radius.

public void setShadowBlurRadius(float shadowBlurRadius)
Sets hand shadow blur radius.

public Point getShadowOffset()
Returns offset of the hand shadow.

public void setShadowOffset(Point shadowOffset)
Sets the offset of the hand shadow.

public float calculateValue()
Returns current value of the hand. Use it for calculating value for standard hand types.

public float calculateAngle()
Returns current angle of the hand. Returned value depends from the complete set of other properties: value, value offset, value range, angle offset and angle range.

public void DrawHand(Canvas canvas)
Draws the hand and calls the listener's callback functions.