Initial commit: Android & Garmin Remote Camera App with Live Preview
This commit is contained in:
31
garmin-app/source/FotoCompanionApp.mc
Normal file
31
garmin-app/source/FotoCompanionApp.mc
Normal file
@@ -0,0 +1,31 @@
|
||||
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>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user