-
Notifications
You must be signed in to change notification settings - Fork 0
Application
Igor Usenko edited this page May 25, 2022
·
30 revisions
Provides access to watch functions.
Controls the power life cycle of the watch.
Controls which application is active at the moment.
Manages switches between applications by calling activate
or deactivate
functions of applications.
Controls which tile is active at the moment.
Calls the Application manager if a change application is needed.
-
setActiveTile
- sets tile as active and renders it in the force mode. -
render
- renders changed or everything in case force mode. -
findComponent
- finds component which contains specific coordinates.
Up
<-> Down
- switch application.
Left
<-> Right
- switch application's tile.
Controls touchscreen events.
- Detects touchscreen event.
- Asks the tile manager to find a target component and calls its event handler. If no target component, then tile is target.
- Component calls event handler.
- Component event handler return tile event handler result.
- If the component event handler return
render
as the result - then call Tiler render.
- Application state
- Tiles
- Background task (optional)
-
activate()
- makes application active. Set default tile as active. Resumes the background task if needed. Only one application can be active. -
deactivate()
- makes application inactive. Pauses the background task if needed. -
getActiveTile()
- returns active tile of the application. -
getNextWakeUpPeriod()
- returns period after which clock should be active so application can run its logic.
- active - receives touch-screen and button events. Draws its own UI.
- inactive - does nothing
Set of internal application data. Can be updated only by event handlers.
Application state + Tile state + Tile event handlers Event handler can return following
-
noop
- no operation needed. -
update
- need to call render.
Set of components
- State - set of variables describing the state of the component.
- Render - function which renders component on the screen.
- Provider - function which provides the state.
FreeRTOS task for serving background activities of the application. Calls dedicated application`s function(s).