Acknowledged
CIQQA-3712

bug: changing font scale doesn't trigger onSettingsChanged or getInitialView in simulator

I'm not 100% sure how this works on real devices, as I don't have a relevant device, but in the simulator in SDK 8.3.0 (i.e venu441mm) onSettingsChanged() isn't called, nor is getInitialView() (as for example when changing time setting between 12h and 24h)

  • > I'd expect this to call onLayout/onUpdate if anything

    > > why? I call it in the main class that extends App.AppBase. That way I can change the settings during an activity even if the field is currently on a non-active screen.

    What are you talking about????? None of these functions (e.g. onSettingsChanged) are called by your own app code, they're called by the device, and implemented in the app. If you meant that you *implement* onSettingsChanged in the main class that extends AppBase, that's literally the only way to do it. Nobody here is saying that you shouldn't implement onSettingsChanged, they're saying that the sim is not calling onSettingsChanged when they expected it to. I would've thought that was 100% clear from the text of the OP.

    To be clear, flocsy (OP) was complaining that changing the device font scale in the simulator doesn't result in onSettingsChanged or getInitialView being called.

    jim_m_58's response was that he expects onLayout or onUpdate to be called when the font scale is changed.

    I chimed in and said that onSettingsChanged is for app settings and not device settings, and that if you want your app to notified of device settings changes, you have to use onDeviceSettingChanged.

    Reading comprehension and clear writing are fundamental. 

    For the record, I don't think it makes sense for any of those other functions to be called directly because the font scale was changed:

    - onSettingsChanged is for app settings

    - getInitialView would obviously only be called if the app restarts

    - onLayout is only supposed to be called on app startup

    - onUpdate is called when the screen needs to be redrawn, which would not necessarily happen *directly* because the font scale was changed [*], although as flocsy pointed out, you could check for any kind of change in onUpdate(), assuming that onUpdate() is called regularly.

    [*] it might depend on whether changing the font scale actually changes the size of the fonts used by your app, without any intervention from the app itself

  • why? I call it in the main class that extends App.AppBase. That way I can change the settings during an activity even if the field is currently on a non-active screen. 

  • > On the other hand some could also argue that the bug is that changing time display or units display restarts the app for no reason...

    Well, yeah, that sucks. Just another example of how the sim doesn't work the same way as a real device.

  • Actually you were right, when I change font scale then onDeviceSettingChanged is called:

    onDeviceSettingChanged: symbol (8392309) = 1.400000

    I'd say this settles it, let's "close" the ticket

  • Well, maybe my expectations were unfounded. But when I change the following "settings" in the simulator, then at least my app is restarted:
    Time Display, Units display, Language. Although some of the other settings (in the Settings menu of the simulator) don't trigger anything (and no, I haven't tried every other setting, just a few).

    Actually I would say Language makes lot of sense, as it means the app needs to reload string resources. But I'd argue (without knowing how Garmin implemented these in real devices or simulator) that the change of 12h vs 24h or metric vs statute is not much different than changing the font scale.

    On the other hand some could also argue that the bug is that changing time display or units display restarts the app for no reason...