32 lines
839 B
MonkeyC
32 lines
839 B
MonkeyC
import Toybox.Application;
|
|
import Toybox.Lang;
|
|
import Toybox.WatchUi;
|
|
import Toybox.Communications;
|
|
|
|
class FotoCompanionApp extends Application.AppBase {
|
|
var view;
|
|
|
|
function initialize() {
|
|
AppBase.initialize();
|
|
}
|
|
|
|
function onStart(state as Dictionary?) as Void {
|
|
// Register for messages from the phone
|
|
Communications.registerForPhoneAppMessages(method(:onPhoneMessage));
|
|
}
|
|
|
|
function onStop(state as Dictionary?) as Void {
|
|
}
|
|
|
|
function onPhoneMessage(msg as Communications.Message) as Void {
|
|
if (view != null) {
|
|
view.updateImage(msg.data);
|
|
}
|
|
}
|
|
|
|
function getInitialView() as Array<Views or InputDelegates>? {
|
|
view = new FotoCompanionView();
|
|
return [ view, new FotoCompanionDelegate(view) ] as Array<Views or InputDelegates>;
|
|
}
|
|
}
|