With S62, I cannot make onSwipe() work in my widget on simulator.( I have not tried it on real watch.)
A break point at the function doesn't hit at all.
If I swipe up<<>>down the widget is terminated.
If I change device to S70, it will work.
If I change App Type to Watch App in manifest, it wil also work. This issue happens with combination S62 with Widget.
Here are the code of app and delegate
using Toybox.System; using Toybox.WatchUi; class WidgetTestDelegate extends WatchUi.BehaviorDelegate { //! Constructor public function initialize() { BehaviorDelegate.initialize(); } function onKey(keyEvent) { var event=keyEvent.getKey(); System.println("key"); // e.g. KEY_MENU = 7 return true; } function onTap(clickEvent) { var event=clickEvent.getType(); System.println(clickEvent.getCoordinates()); // e.g. [36, 40] // System.println(clickEvent.getType()); // CLICK_TYPE_TAP = 0 return true; } function onSwipe(swipeEvent) { var event=swipeEvent.getDirection(); System.println("swipe"); // e.g. SWIPE_DOWN = 2 return true; } }
import Toybox.Application; import Toybox.Lang; import Toybox.WatchUi; class WidgetTestApp extends Application.AppBase { function initialize() { AppBase.initialize(); } // onStart() is called on application start up function onStart(state as Dictionary?) as Void { } // onStop() is called when your application is exiting function onStop(state as Dictionary?) as Void { } // Return the initial view of your application here function getInitialView() as [Views] or [Views, InputDelegates] { // return [ new WidgetTestView() ]; var view = new WidgetTestView(); var delegate =new WidgetTestDelegate(); return [view, delegate]; } } function getApp() as WidgetTestApp { return Application.getApp() as WidgetTestApp; }