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)

Parents
  • > 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

Comment
  • > 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

Children
No Data