Acknowledged
CIQQA-4730

Button "Back" closes an Connect IQ aplication when it is pressed in Confirmation view

Hello! 

I would like to report about very old issue with Confirmation View. When I added it into my application TimeToSail to confirm Exit I found this problem. If you press Back callback function response() is not called, but application is closed suddenly. There is no way to handle Back button actions, like it is implemented in other delegate classes. I expect that ConfirmationDelegate should ignore pressing button, except Accept and Cancel buttons. 

Hope you to fix the issue. There are several reports on the forum during last 4 years.

 Back button in Confirmation Delegate 

 Back in confirmation quits app instead of popping (Vivoactive 3)  

Thank you in advance

Best regards

Konstantin

Parents
  • I'll have someone look at this and escalate it to see if this is a bug we should address—since it's been like this for a while, it seems likely that we've looked at this before and decided to leave it as-is to avoid breaking changes, but I honestly don't remember. In the meantime, here's a possible solution that we use internally in some cases when handling confirmation dialogs (unless I'm completely misunderstanding the problem):

    class ConfirmationDelegate2 extends WatchUi.ConfirmationDelegate {
        function initialize() {
            ConfirmationDelegate.initialize();
        }
        // This function always pops a view at the end in an attempt to pop the confirmation view.
        // This has a side effect of popping the last view that the user tries to push in onResponse.
        // This works around the issue by first popping the confirmation, then executing any user code,
        // then passing a dummy view on top at the end. The dummy view is popped by the default pop behavior.
        function onResponse(aResponse as Confirm) as Boolean {
            WatchUi.popView(WatchUi.SLIDE_IMMEDIATE);
            if (aResponse == WatchUi.CONFIRM_YES) {
                onAffirmativeResponse();
            } else if (aResponse == WatchUi.CONFIRM_NO) {
                onNegativeResponse();
            }
            WatchUi.pushView(new WatchUi.View(), null, WatchUi.SLIDE_IMMEDIATE);
            return false;
        }
        function onAffirmativeResponse() as Void {
            // overridden by derived class
        }
        function onNegativeResponse() as Void {
            // overridden by derived class
        }
    }

Comment
  • I'll have someone look at this and escalate it to see if this is a bug we should address—since it's been like this for a while, it seems likely that we've looked at this before and decided to leave it as-is to avoid breaking changes, but I honestly don't remember. In the meantime, here's a possible solution that we use internally in some cases when handling confirmation dialogs (unless I'm completely misunderstanding the problem):

    class ConfirmationDelegate2 extends WatchUi.ConfirmationDelegate {
        function initialize() {
            ConfirmationDelegate.initialize();
        }
        // This function always pops a view at the end in an attempt to pop the confirmation view.
        // This has a side effect of popping the last view that the user tries to push in onResponse.
        // This works around the issue by first popping the confirmation, then executing any user code,
        // then passing a dummy view on top at the end. The dummy view is popped by the default pop behavior.
        function onResponse(aResponse as Confirm) as Boolean {
            WatchUi.popView(WatchUi.SLIDE_IMMEDIATE);
            if (aResponse == WatchUi.CONFIRM_YES) {
                onAffirmativeResponse();
            } else if (aResponse == WatchUi.CONFIRM_NO) {
                onNegativeResponse();
            }
            WatchUi.pushView(new WatchUi.View(), null, WatchUi.SLIDE_IMMEDIATE);
            return false;
        }
        function onAffirmativeResponse() as Void {
            // overridden by derived class
        }
        function onNegativeResponse() as Void {
            // overridden by derived class
        }
    }

Children
  • Ok Brandon.  I dug up my f7, charged it, and did some testing with both it and an fr170.

    for both, li looks like this in the sim:

    (a generic screen, but if I recall, it's how it looks on some pre-ciq4 devices).  "Back" works as expected.

    Now on the f7, here's a screen shot:

    The indicators show for select and down (nothing for back/esc)  Back does result in the app terminating.

    Now with the fr170:

    The arcs are a different color and "back" is ignored.

  • Thank you for the answer. It is look like you don't catch the problem. 

    Please look the video https://drive.google.com/file/d/1A58Fn3PhKfLB8ewzeBJi_BLAUFpfdUVK/view?usp=sharing 

    Please take the Garmin sample ConfirmationDialog from SDK 9.2.0. and test it by you own.

    According to your code example:
    function onResponse is not called at all when you press right lower button Back. Please test it on device but not in simulator. Because as I wrote before simulator is not matched to the device and Back button is assigned inside simulator implementation as Confirm button.