The CanvasWatchFaceService.Engine class extends the WatchFaceService.Engine class. Here, actual implementation of a watch face that draws on a canvas can be accomplished. We ought to implement onCreateEngine() to reestablish your concrete engine implementation. CanvasWatchFaceService.Engine has one public constructor with a couple of procedures to enable us to implement the watch face. How about we examine a couple of methods that we will implement in the later bit of this chapter:
-
void invalidate (): Plans a call to onDraw(Canvas, Rect) to draw the following frame. This must be approached on the main thread.
-
void onDestroy (): In this callback, we can release the hardware and other resources that we would be using to complete the watch face.
- void onDraw(Canvas canvas, Rect bounds): Draws the watch face, all the visual components, and...