using DeviceSettings.isGlanceModeEnabled attribute

I'm finally trying to properly update my METAR/TAF widget with support for glance views. Because the widget has multiple screens of information, prior to glance views I followed the Garmin de facto standard of displaying further information when the user presses the start button. Now with glance views, the user presses the start button to move from the glance to the full screen so for devices with glance view enabled I need to handle the start button input differently; the initial view for non-glance devices needs to function as before but for glance devices the initial view has to jump right in to the "started" view. I am using the "has" functionality to determine if the device supports glance views and if it's enabled:

if (System.DeviceSettings has :isGlanceModeEnabled) {

  // this is a device that supports glance views
}

This works just fine however whenever I access that attribute within DeviceSettings it is always set to false.

if (System.getDeviceSettings().isGlanceModeEnabled) {

  // this code is NEVER run as this attribute is always "false"

}

I'm using SDK 3.1.6 on MacOS and can see no way to set this attribute. I'm pretty sure that the way I'm doing things will work for glance view devices but without an actual device and without the ability to set this attribute it's a bit hard to be sure.

  • It looks like the attribute didn't get hooked up to the menu item. This is a pretty small change, so I'll try to get it in tonight.

  • I'm a bit confused as to how this would work in the sim.  On the real device, you can set if glance mode is used or not in settings.

    Seems there, if glance mode is enabled, you start with a glance, and then if the glance is the middle one, and start is pressed, the widget goes to full screen and isGlanceModeEnabled is true, but if glance mode isn't enabled in settings, the widget always runs full screen and isGlanceModeEnabled  would be false.

    Would the isGlanceModeEnabled only be true in the sim is if the run started with glance view on and then you turned glance view off and went full screen, but if you started the run with glance mode off, it would be false?

    Maybe a new setting in the sim for enabling glance view in addition to the current one if glance view is on or off?

    In other words  with a target like the f6, in the sim you need to be able to run full screen with isGlanceModeEnabled either true and false.

  • I think that a NEW menu item is required, which I think is what is eluding to. What we need to be able to simulate is whether or not the device supports glance view and if it does, whether or not the user has glance view enabled.

    I'm also curious what happens when you call the isGlanceModeEnabled() method on a device with CIQ 3.1.x but that doesn't have glance views, for example the Vivoactive 4. I would presume that the method is accessible but that it will return "false"?

  • This is a case where I'd use "has", as while the ROW/WW version of a device may have 3.1, the APAC version may not have been updated yet.

  • Well, this is why I'm looking for clarification from on this. I'm unsure as to whether or not the method will be included on non-glance devices since it is conceivable that returning false would be a potentially acceptable result.

  • If the device doesn't have glance support, then the isGlanceModeEnabled attribute would not exist. You'd have to use a has check, and it would fail.

  • I must be missing something.

    As you've mentioned, on a physical device like the fenix6 there is a device setting to enable or disable glance mode. As I understand it, the DeviceSettings::isGlanceModeEnabled option is intended to mirror this. I do not understand why the simulator would need another toggle.

    In my mind, if the menu item is enabled, the value of isGlanceModeEnabled would be true. If you start simulating a widget while this menu item is enabled, it would start in glance mode. Pressing Select/Enter when the glance view is active (in the middle) would enter the widget. If the option is disabled when you start simulating, it would go straight to the initial widget view as always.

    I _think_ the intent is for something like this:

    (:glance) function getGlanceView() {
        return [ new MyGlanceView(), new MyGlanceViewDelegate() ];
    }
    
    function getInitialView() {
        var deviceSettings = System.getDeviceSettings();
        if ( (deviceSettings has :isGlanceModeEnabled) && (deviceSettings.isGlanceModeEnabled) ) {
            return [ new MyDetailsView(), new MyDetailsViewDelegate() ];
        } else {
            return [ new MySummaryView(), new MySummaryViewDelegate() ];
        }
    }

    I can verify with , but I'm pretty confident that this is how it is supposed to work. As it is you can currently toggle the menu item to flip between glance/non-glance mode, but you should be able to use it just like you do on a device.

  • I think we are agreeing, with the caveat that the simulator currently doesn't work like that (which I believe is causing the confusion). Right now, for me on MacOS at least, the only way to get from the glance view to the started, details view of my widget is to unselect "Glance View" from the Simulation menu. This is why I suggested that a new menu item was required.

    But if, as you suggest, that I can click on the "Start" button when the widget glance is in the middle then I support the process you have suggested.

  • what if we add the support to enable the 'select' button in 'glance view' page, then when user select a 'glance', sim will start the widget in full running mode and set 'isGlanceModeEnabled' to true.

    on the other hand, if glance view is disabled when starting the widget, it will imply the 'isGlanceModeEnabled' is off.

  •   I think that would be great.  And what I was trying to suggest a few posts back! Slight smile