1. I wanted to process Up/Down button presses and started with InputDelegete. Everything worked in simulator (and mind you, I read about onKeyRelease problems, so I started with onKey insted) but it seems that input delegate is not working at all on watch since I don't get any reaction when pressing buttons. When I replaced InputDelegate with BehaviorDelegate mapping necessary keys to delegate methods, everything works fine even on watch. Almost. When I long press up key and expect only onMenu to happen, I receive two callbacks in sequence: first onPreviousPage and then onMenu. This happens only on watch, in simulator everything works fine. Is there any way to distinguish if onPreviousPage happened because of onMenu? Below is the code exerpt.
...
function getInitialView() {
view = new AppView();
return [ view, new AppDelegate(view) ];
}
...
class AppDelegate extends Ui.BehaviorDelegate {
...
function onPreviousPage() {
return view.updateRowIndex(-1);
}
function onMenu() {
return view.onMenuPressed();
}
}
...
2. Another input related issue: in my app I have main screen, that handles user input and several menus custom coded by extending View. Almost every time after I pushView or popView happens when I return false in onBack of view delegate, first button press is not processed. General scenario: I long press Up, then call Ui.pushView with custom delegate, then first up or down press is not processed (again, this happens only on watch). Maybe this is performance related issue when memory is allocated and/or freed in large segments since if I wait for a couple of seconds before this first press, then it is processed, but if I press same button two times after staring new view without waiting, then relevant delegate method is called immediately. It's not critical, but unexplainable and rather irritating. Please, if someone faced similar app behavior, advise how to resolve such issues.
3. I tried to implement partial screen redraw, setting full redraw flag only in view's onShow, meaning that I need to redraw full screen only in case if view was pushed into screen either from stack or as initial view. Once again, everything works fine in simulator, but on real watch my screen gets distorted. I found out that this happens because of standard slide animations, that happen, for example, during application start when initial view is sliding from right to left. I was unable to find any callback for a view, that will be called after standard slide animation has ended. Is there a way to handle such situations? And yet another redraw question: if i don't bother with partial redraw - I don't have any screen distortions and view is even animated during slides with full content. Does this mean, that redraw performance including dc.clear, 5 to 10 dc.setColor and about 20 drawText every second is not considered a hard work for a watch? Is it even necessary to implement partial redraws to improve battery life in the long run?