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

Some problems with Expanded Client Areas on Android

    XMLWordPrintable

Details

    • Android
    • 2025wk18s1QtforAndroid, 2025wk20s1QtforAndroid

    Description

      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)

      Attachments

        1. A1_statusbar_overlapped.png
          1.70 MB
          Ekkehard
        2. A2_statusbar_rotated_and_back.png
          1.58 MB
          Ekkehard
        3. android_no_margins.png
          1002 kB
          Ekkehard
        4. android_with_margins.png
          953 kB
          Ekkehard
        5. B_statusbar_black.png
          1.58 MB
          Ekkehard
        6. C1_statusbar_wrong.png
          1.58 MB
          Ekkehard
        7. C2_statusbar_ok.png
          1.58 MB
          Ekkehard
        8. example1.txt
          4 kB
          Ekkehard
        9. image-2025-04-08-17-42-24-010.png
          485 kB
          Tor Arne Vestbø

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              assam Assam Boudjelthia
              ekkescorner Ekkehard
              Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes