Progress Bar Input Delegate

I'm having some problems with ProgressBar Input Delegates not responding like expected. I have problems on the Simulator and on a VivoActive, but they are different.

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;
}
}
  • I was able to reproduce this exactly as you described in 1.1.4, but I don't understand the cause. It's reported as a bug, so we'll look into it.
  • Former Member
    Former Member over 9 years ago
    Any progress on this? I haven't been able to use a progress bar delegate on any of the devices I have tried when running current firmware & ciq. Works in the simulator, but not on the devices.
  • The issue reported above was fixed in in the 1.2.2 SDK release right around the first of the year. I haven't seen any other reports of trouble with the progress bar on hardware, but I can check it out. Do you have any other specifics you can provide?
  • Former Member
    Former Member over 9 years ago
    This code will work in simulator. Eclipse Version: Mars.2 Release (4.5.2) connectiq-sdk-win-1.2.8
    but for example does not work on my device. 920XT v7.10

    using Toybox.WatchUi as Ui;

    class ResetDelegate extends Ui.ConfirmationDelegate {

    function onResponse( confirmation ) {
    if( confirmation == Ui.CONFIRM_YES ){
    Ui.pushView( new Ui.ProgressBar( "Resetting", null ), new ResetProgressDelegate(), Ui.SLIDE_UP );
    }
    else {
    Ui.popView( Ui.SLIDE_RIGHT );
    }
    }
    }


    class ResetProgressDelegate extends Ui.BehaviorDelegate {

    function onBack(){
    System.println( "onBack() has been called" );
    Ui.popView( Ui.SLIDE_RIGHT );
    return true;
    }
    }
    have I missed something?