SDK 2.3.1 simulator ConfirmationDelegate reopens when opening a menu.
o The Environment:
Windows 10, Eclipse Mars, SDK 2.3.1, simulating VA-HR or fenix 5
o A detailed description of the issue
The simulator fails to correctly display a Ui.MenuInputDelegate when it is run from a Ui.ConfirmationDelegate.
It works correctly on a device.
When the ConfirmationDelegate Confirm option is taken (Tap confirm on VA-HR, press Select button on fx5), the menu appears momentarily and then the confirmation screen returns, making it impossible to make a menu selection
o Steps to reproduce the issue
- Run the attached code,
- press menu button,
- select "Confirm" option.
The menu is momentarily displayed then replaced by the confirmation screen.
On a device, the menu is correctly displayed.
o Any applicable additional information
This trivial code sample has been built just to demonstrate the issue. It is modeled on some actual code in my app that provides the user with a caution that they may be inadvertently changing a critical state, before permitting that change via the menu.
It is a critical issue as is preventing me from replicating a behavior in my app using the sim to debug an entirely different issue.
The code worked correctly prior to 2.3.1
The code runs correctly on a VA-HR watch (I don't have an fx5 to test).
o A code sample that can reproduce the issue
using Toybox.Application as App;
using Toybox.WatchUi as Ui;
var view;
class demoApp extends App.AppBase {
function initialize() {
AppBase.initialize();
}
function getInitialView() {
view = new demoView();
return [ view, new demoDelegate() ];
}
}
class demoView extends Ui.View {
function dispMenu(){
var s_menu_layer = new Menu();
s_menu_layer.setTitle("Menu Title");
s_menu_layer.addItem("First",1);
s_menu_layer.addItem("Second",2);
s_menu_layer.addItem("Third",3);
Ui.pushView(s_menu_layer, new menuDelegate(), Ui.SLIDE_IMMEDIATE);
}
function onUpdate(dc) {
dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_BLACK);
dc.clear();
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
dc.drawText( 74,50, Graphics.FONT_SYSTEM_MEDIUM, "Press Menu", Graphics.TEXT_JUSTIFY_CENTER);
}
}
class demoDelegate extends Ui.BehaviorDelegate {
function initialize() {
BehaviorDelegate.initialize();
}
function onMenu(){
var dialog = new Ui.Confirmation("Sure?");
Ui.pushView(dialog, new menuConfirmationDelegate() , Ui.SLIDE_IMMEDIATE);
}
}
class menuConfirmationDelegate extends Ui.ConfirmationDelegate {
function initialize() {
return Ui.ConfirmationDelegate.initialize();
}
function onResponse(value) {
if (value == CONFIRM_NO) {
return;
}
else {
view.dispMenu();
}
return true;
}
}
class menuDelegate extends Ui.MenuInputDelegate {
function initialize() {
MenuInputDelegate.initialize();
}
function onMenuItem(item) {
System.println("Selected:"+item);
}
}