Class: $.AnalogView
- Inherits:
-
WatchUi.WatchFace
-
WatchUi.WatchFace
-
Overview
This implements an analog watch face Original design by Austen Harbour
Instance Member Summary collapse
- _dateBuffer as Graphics.BufferedBitmap or Null
- _dndIcon as WatchUi.BitmapResource or Null
- _font as WatchUi.FontResource or Null
- _fullScreenRefresh as Lang.Boolean
- _isAwake as Lang.Boolean or Null
- _offscreenBuffer as Graphics.BufferedBitmap or Null
- _partialUpdatesAllowed as Lang.Boolean
- _screenCenterPoint as Lang.Array<Lang.Number> or Null
- _screenShape as System.ScreenShape
Instance Method Summary collapse
-
drawBackground(dc as Graphics.Dc) as Void
Draw the watch face background onUpdate uses this method to transfer newly rendered Buffered Bitmaps to the main display.
-
drawDateString(dc as Graphics.Dc, x as Lang.Number, y as Lang.Number) as Void
Draw the date string into the provided buffer at the specified location.
-
drawHashMarks(dc as Graphics.Dc) as Void
Draws the clock tick marks around the outside edges of the screen.
-
generateHandCoordinates(centerPoint as Lang.Array<Lang.Number>, angle as Lang.Float, handLength as Lang.Number, tailLength as Lang.Number, width as Lang.Number) as Lang.Array<[ Lang.Numeric, Lang.Numeric ]>
This function is used to generate the coordinates of the 4 corners of the polygon used to draw a watch hand.
-
getBoundingBox(points as Lang.Array<[ Lang.Numeric, Lang.Numeric ]>) as Lang.Array<[ Lang.Numeric, Lang.Numeric ]>
Compute a bounding box from the passed in points.
-
initialize()
Initialize variables for this view.
-
onEnterSleep() as Void
This method is called when the device re-enters sleep mode.
-
onExitSleep() as Void
This method is called when the device exits sleep mode.
-
onLayout(dc as Graphics.Dc) as Void
Configure the layout of the watchface for this device.
-
onPartialUpdate(dc as Graphics.Dc) as Void
Handle the partial update event.
-
onUpdate(dc as Graphics.Dc) as Void
Handle the update event.
-
turnPartialUpdatesOff() as Void
Turn off partial updates.
Instance Attribute Details
var _dateBuffer as Graphics.BufferedBitmap or Null
var _dndIcon as WatchUi.BitmapResource or Null
var _font as WatchUi.FontResource or Null
var _fullScreenRefresh as Lang.Boolean
var _isAwake as Lang.Boolean or Null
var _offscreenBuffer as Graphics.BufferedBitmap or Null
var _partialUpdatesAllowed as Lang.Boolean
var _screenCenterPoint as Lang.Array<Lang.Number> or Null
var _screenShape as System.ScreenShape
Instance Method Details
drawBackground(dc as Graphics.Dc) as Void
Draw the watch face background onUpdate uses this method to transfer newly rendered Buffered Bitmaps to the main display. onPartialUpdate uses this to blank the second hand from the previous second before outputting the new one.
drawDateString(dc as Graphics.Dc, x as Lang.Number, y as Lang.Number) as Void
Draw the date string into the provided buffer at the specified location
drawHashMarks(dc as Graphics.Dc) as Void
Draws the clock tick marks around the outside edges of the screen.
generateHandCoordinates(centerPoint as Lang.Array<Lang.Number>, angle as Lang.Float, handLength as Lang.Number, tailLength as Lang.Number, width as Lang.Number) as Lang.Array<[ Lang.Numeric, Lang.Numeric ]>
This function is used to generate the coordinates of the 4 corners of the polygon used to draw a watch hand. The coordinates are generated with specified length, tail length, and width and rotated around the center point at the provided angle. 0 degrees is at the 12 o'clock position, and increases in the clockwise direction.
getBoundingBox(points as Lang.Array<[ Lang.Numeric, Lang.Numeric ]>) as Lang.Array<[ Lang.Numeric, Lang.Numeric ]>
Compute a bounding box from the passed in points
initialize()
Initialize variables for this view
onEnterSleep() as Void
This method is called when the device re-enters sleep mode. Set the isAwake flag to let onUpdate know it should stop rendering the second hand.
onExitSleep() as Void
This method is called when the device exits sleep mode. Set the isAwake flag to let onUpdate know it should render the second hand.
onLayout(dc as Graphics.Dc) as Void
Configure the layout of the watchface for this device
onPartialUpdate(dc as Graphics.Dc) as Void
Handle the partial update event
onUpdate(dc as Graphics.Dc) as Void
Handle the update event
turnPartialUpdatesOff() as Void
Turn off partial updates