Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Toybox.Application as App;
- using Toybox.WatchUi as Ui;
- (:background)
- class Day24OptimizedApp extends App.AppBase {
- var view;
- function initialize() {
- AppBase.initialize();
- }
- // onStart() is called on application start up
- function onStart(state) {
- }
- // onStop() is called when your application is exiting
- function onStop(state) {
- }
- // Return the initial view of your application here
- function getInitialView() {
- view = new Day24OptimizedView();
- return [view];
- /*
- if( Toybox.WatchUi.WatchFace has :onPartialUpdate ) {
- return [ view, new PartialDelegate() ];
- } else {
- return [ view ];
- }
- */
- }
- // This method runs each time the background process starts.
- function getServiceDelegate(){
- return [new BackgroundServiceDelegate()];
- }
- // This method is called when data is returned from our background process.
- function onBackgroundData(data) {
- if (view) {
- view.backgroundEvent(data);
- }
- }
- // New app settings have been received so trigger a UI update
- function onSettingsChanged() {
- view.loadSettings();
- Ui.requestUpdate();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment