because you wouldn't have to worry, because the user wouldn't be looking.
I'd need an experiment to prove it, but it seems like the OS will call onUpdate just before onHide when a watch face is shutting down.
View.initialize
View.onShow
View.onUpdate
View.onHide
App.initialize
App.onStart
WatchFace.initialize
WatchFace.onShow
WatchFace.onUpdate
WatchFace.onUpdate
WatchFace.onEnterSleep
WatchFace.onUpdate
WatchFace.onExitSleep
WatchFace.onUpdate
WatchFace.onEnterSleep
WatchFace.onUpdate
WatchFace.onExitSleep
WatchFace.onUpdate
WatchFace.onEnterSleep
App.onStop
function onUpdate(dc) {
if(doLoop){
loopFunc();
return;
}
else if(isHiding) {
return;
}
else {
pauseTimer.stop();
}
// .....
doLoop = true;
}
function loopFunc(){
doLoop = false;
pauseTimer.start(method(:requestUpdate),100,false);
}
Sharkbait, that seems clever and we could hope for a more direct way, but that sort of approach seems like a possibility. I haven't thought it through all the way yet, however.
I don't think a watchface can catch button presses, but I may be wrong...
The earth is calculated dynamically rather than via a series of images. I'd considered that approach but it isn't possible to fit too many images into 64K, even at 1 bit-per-pixel. I wanted the earth to be oriented realistically, i.e. tilt as well as rotation from the perspective of the sun.
Battery life isn't too bad since there is only a partial update of the earth each minute.
What if from the timer callback, it had the dc, and from within the "expensive stuff" it put it on the display itself, and onUpdate just handled the simple stuff? You probably couldn't use layouts, and there would be some housekeeping involved, such as clearing the display and such.