CIQ 1.1.3 and VA 3.10
For a simplified example, push a progress bar using:
Ui.pushView(new TestProgressBar(), new TestProgressBarDelegate(), Ui.SLIDE_IMMEDIATE);
Then have the following progress bar and delegate code:
using Toybox.WatchUi as Ui;
using Toybox.System as Sys;
class TestProgressBar extends Ui.ProgressBar
{
function initialize() {
ProgressBar.initialize("Searching...", null);
}
}
class TestProgressBarDelegate extends Ui.BehaviorDelegate
{
function initialize(sensor) {
}
function onBack() {
Sys.println("Back was pressed");
Ui.popView(Ui.SLIDE_IMMEDIATE);
return true;
}
function onKey(evt) {
var key = evt.getKey();
if (key == Ui.KEY_ENTER) {
Sys.println("Enter was pressed");
}
return true;
}
}
When this runs on the simulator
1) There is no response to the pressing the Enter Button
2) When the back button is pressed: a) "Back Button was pressed" is printed on the console b) the progress bar view is popped c) the view that I return to is unresponsive. It shows again and OnShow and OnUpdate are called, but it's input delegate does not respond to button pushes.
When this runs on the VivoActive
1) There is no response to pressing the Enter Button
2) There is no response to pressing the Back Button
If I change the code to be a regular view rather than a progress bar, then the Enter and Back responses are like I would expect.
using Toybox.WatchUi as Ui;
using Toybox.System as Sys;
class TestProgressBar extends Ui.View
{
function initialize() {
//ProgressBar.initialize("Searching...", null);
}
}
class TestProgressBarDelegate extends Ui.BehaviorDelegate
{
function initialize(sensor) {
}
function onBack() {
Sys.println("Back was pressed");
Ui.popView(Ui.SLIDE_IMMEDIATE);
return true;
}
function onKey(evt) {
var key = evt.getKey();
if (key == Ui.KEY_ENTER) {
Sys.println("Enter was pressed");
}
return true;
}
}