tomasslavicek

Day24OptimizedApp.mc

Nov 15th, 2017
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.29 KB | None | 0 0
  1. using Toybox.Application as App;
  2. using Toybox.WatchUi as Ui;
  3.  
  4. (:background)
  5. class Day24OptimizedApp extends App.AppBase {
  6.     var view;
  7.  
  8.     function initialize() {
  9.         AppBase.initialize();
  10.     }
  11.  
  12.     // onStart() is called on application start up
  13.     function onStart(state) {
  14.     }
  15.  
  16.     // onStop() is called when your application is exiting
  17.     function onStop(state) {
  18.     }
  19.  
  20.     // Return the initial view of your application here
  21.     function getInitialView() {
  22.         view = new Day24OptimizedView();
  23.         return [view];
  24.         /*
  25.         if( Toybox.WatchUi.WatchFace has :onPartialUpdate ) {
  26.             return [ view, new PartialDelegate()  ];
  27.         } else {
  28.             return [ view ];
  29.         }
  30.         */
  31.     }
  32.  
  33.     // This method runs each time the background process starts.
  34.     function getServiceDelegate(){
  35.         return [new BackgroundServiceDelegate()];
  36.     }
  37.    
  38.     // This method is called when data is returned from our background process.
  39.     function onBackgroundData(data) {
  40.         if (view) {
  41.             view.backgroundEvent(data);
  42.         }
  43.     }
  44.        
  45.     // New app settings have been received so trigger a UI update
  46.     function onSettingsChanged() {
  47.         view.loadSettings();
  48.         Ui.requestUpdate();
  49.     }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment