Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135808

Some problems with Expanded Client Areas on Android

XMLWordPrintable

    • Android
    • e96a4b84e (dev), 1d014381f (6.9), 05f8abc61 (dev), 0b69f2f7a (6.10), 09cdda952 (6.9), f8aad368f (dev), c0b1a310e (dev), 357580c22 (dev), e2a9ab46d (dev)
    • 2025wk18s1QtforAndroid, 2025wk20s1QtforAndroid, 2025wk22s1-2QtforAndroid, 2025wk36s2QtforAndroid

      Added Example App

      see example1.txt
      slightly modified from vestbo 
      https://gist.github.com/torarnv/6923a4ae199d44b5763060be3c00d169 

      added a button to toggle between Dark and White
      and displaying SafeArea values

      Application.styleHints.colorScheme = Qt.ColorScheme.Dark
      darkGreen ToolBar with white text

      -------
      Android
      Starting the app directly from the device two workflows are happening:

      A) usually, but not always: 
      no SafeArea values available, so StatusBar and ToolBar overlapping
      see image A1_statusbar_overlapped.png

      manually rotating from Portrait to Landscape and back, the SafeArea values are coming in and ToolBar is positioned below StatusBar. 
      Also colors are correct: Toolbar and StatusBar white
      see image A2_statusbar_rotated_and_back.png

      Toggling the color between dark and light works for the Toolbar, but StatusBar always remains white text

      B) sometimes SafeArea values are available directly after starting the app, but in this case, ToolBar was with white text (correct) and StatusBar with black text (faulty).
      Toggling the color between darkgreen and lightgray works for the ToolBar, but StatusBar always remains with black text in this case
      see image B_statusbar_black.png

      -------
      Android
      running from QtCreator

      C) Now we're getting StatusBar with black text-color (wrong).
      see image C1_statusbar_wrong.png
      Manually rotating into Landscape and back gives correct white text-color in StatusBar
      see image C2_statusbar_ok.png

      Toggling color doesn't work

      BTW: while trying to use it together with QtQuick.Controls.Material, sometimes StatusBar and ToolBar overlap also running from QtC

      -------
      iOS
      no different behavior between starting from device or QtCreator
      no problems with themes/colors using example1

      can switch between Dark and Light without any problems, colors of ToolBar and StatusBar always as expected.

      but there are problems with SafeArea.margins Left and Right, on iOS both always have same values 

      iPhone XR, iOS 17.5.1
      Portrait:
      SafeArea Top: 48, Left: 0, Right: 0, Bottom: 34
      OK

      Rotate from Portrait into Landscape:
      SafeArea Top: 0, Left: 48, Right: 48, Bottom: 21
      WRONG - should be:
      SafeArea Top: 0, Left: 0, Right: 48, Bottom: 21
      or
      SafeArea Top: 0, Left: 48, Right: 0, Bottom: 21

      -------

      Question Light vs Dark Themes

      In my Android and iOS Apps I'm using QtQuick.Controls.Material, usually with Material.Light theme. The ToolBar Background comes from Material.primary color.
      This works with 6.9.0 Expanded Client Areas. 
      ToolBar and StatusBar both have same background color.
      This is OK for me.

      On iOS using Dark and Light Themes to set black or white StatusBar-text-color already works, so hopefully on Android in 6.9.1 ?

      The theme for 6.9.0 Expanded Client Areas is set by Application.styleHints.colorScheme = Qt.ColorScheme.Dark / Light - so at application level.
      Hopefully there will be no collision when Material.Light is used from my apps together with a dark colorized ToolBar/StatusBar.

      Currently I'm using MobileUI (https://github.com/emericg/MobileUI) from Emeric Grange, where I can set explicitly statusbarTheme: MobileUI.Dark (or Light)

        1. A1_statusbar_overlapped.png
          1.70 MB
          Ekkehard
        2. A2_statusbar_rotated_and_back.png
          1.58 MB
          Ekkehard
        3. B_statusbar_black.png
          1.58 MB
          Ekkehard
        4. C1_statusbar_wrong.png
          1.58 MB
          Ekkehard
        5. C2_statusbar_ok.png
          1.58 MB
          Ekkehard
        6. example1.txt
          4 kB
          Ekkehard
        7. image-2025-04-08-17-42-24-010.png
          485 kB
          Tor Arne Vestbø
        8. android_no_margins.png
          1002 kB
          Ekkehard
        9. android_with_margins.png
          953 kB
          Ekkehard
        10. image-2025-08-13-12-58-16-464.png
          1.47 MB
          Assam Boudjelthia
        11. image-2025-08-28-12-26-37-085.png
          3 kB
          Jiri Zaloudek
        12. Screenshot_2025-08-29-13-54-13-031_io.emeric.qmlmobilescanner.jpg
          685 kB
          Emeric Grange
        13. image-2025-09-03-21-48-47-179.png
          687 kB
          Assam Boudjelthia
        14. image-2025-09-03-21-49-51-351.png
          791 kB
          Assam Boudjelthia
        15. image-2025-09-03-21-50-28-598.png
          791 kB
          Assam Boudjelthia
        16. image-2025-09-03-21-51-15-876.png
          682 kB
          Assam Boudjelthia
        17. image-2025-09-03-21-51-33-421.png
          795 kB
          Assam Boudjelthia
        18. image-2025-09-03-21-54-23-196.png
          679 kB
          Assam Boudjelthia
        19. image-2025-09-03-21-54-42-881.png
          765 kB
          Assam Boudjelthia
        20. image-2025-09-03-12-10-49-714.png
          343 kB
          Niels Mayer
        21. image-2025-09-03-12-11-41-718.png
          444 kB
          Niels Mayer
        22. image-2025-09-03-12-12-52-523.png
          158 kB
          Niels Mayer
        23. image-2025-09-03-12-13-27-091.png
          268 kB
          Niels Mayer
        24. image-2025-09-03-12-56-03-262.png
          886 kB
          Niels Mayer
        25. image-2025-09-03-12-57-14-880.png
          827 kB
          Niels Mayer
        26. image-2025-09-03-12-59-07-105.png
          716 kB
          Niels Mayer
        27. systemBar_overlapped_android14.jpg
          270 kB
          Irfan Omair
        28. image-2025-09-04-16-23-48-229.png
          1.22 MB
          Assam Boudjelthia
        29. image-2025-09-04-16-24-15-643.png
          929 kB
          Assam Boudjelthia
        30. image-2025-09-04-16-24-40-303.png
          820 kB
          Assam Boudjelthia
        31. image-2025-09-04-16-25-11-393.png
          823 kB
          Assam Boudjelthia
        32. image-2025-09-04-16-26-46-970.png
          944 kB
          Assam Boudjelthia
        33. image-2025-09-04-16-27-20-807.png
          846 kB
          Assam Boudjelthia
        34. image-2025-09-04-16-28-17-368.png
          617 kB
          Assam Boudjelthia
        35. image-2025-09-04-16-28-17-514.png
          635 kB
          Assam Boudjelthia
        36. image-2025-09-04-16-28-17-810.png
          665 kB
          Assam Boudjelthia
        For Gerrit Dashboard: QTBUG-135808
        # Subject Branch Project Status CR V

            assam Assam Boudjelthia
            ekkescorner Ekkehard
            Votes:
            10 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: