Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Customize Top Status/Notification Bar Android
Forum Update on Monday, May 27th 2025

Customize Top Status/Notification Bar Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 2.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • carles.sole.grauC Offline
    carles.sole.grauC Offline
    carles.sole.grau
    wrote on last edited by carles.sole.grau
    #1

    Hi everybody,
    I would like to know if it's possible to change the color of the Top Status/Notification Bar in Android using QML (or QtC++) as it can be seen in this image:
    Tinted Status Bar

    Thank you very much.

    1 Reply Last reply
    0
    • kd_walaK Offline
      kd_walaK Offline
      kd_wala
      wrote on last edited by
      #2

      Hi, I think QML, or QtC++ not support, so You can put this snippet into OnCreate() on MainActivity of Java

      Window window = activity.getWindow();
      window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
      window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
      window.setStatusBarColor(ContextCompat.getColor(activity, R.color.example_color));

      You can see more on link: http://stackoverflow.com/questions/27093287/how-to-change-status-bar-color-to-match-app-in-lollipop-android
      and https://developer.android.com/training/material/theme.html#StatusBar

      1 Reply Last reply
      2
      • carles.sole.grauC Offline
        carles.sole.grauC Offline
        carles.sole.grau
        wrote on last edited by
        #3

        Thanks, and where I could fine this file?

        Thanks again.

        1 Reply Last reply
        0
        • kd_walaK Offline
          kd_walaK Offline
          kd_wala
          wrote on last edited by
          #4

          Hi,
          You can check sample at: http://doc.qt.io/qt-5/qtandroidextras-notification-example.html
          It teach you how to create file AndroidManifest.xml config for Android,
          Then you create MainActivity contain java code in it.

          Blog of BogDan contain more example about Qt on Android, you can check more at :https://www.kdab.com/author/bogdan-vatra/

          1 Reply Last reply
          2
          • GTDevG Offline
            GTDevG Offline
            GTDev
            wrote on last edited by
            #5

            Hi!

            You can also have a look at the V-Play Apps SDK, which includes QML components to create native looking iOS and Android apps. The tint-color can easily be changed for all relevant components like the navigation bar or the used controls and buttons.

            The following example creates a simple app with a green navigation-bar:

            import VPlayApps 1.0
            import QtQuick 2.0
            
            App {
            
              // theme configuration (also changeable at runtime)
              onInitTheme: {
                Theme.colors.tintColor = "green"
              }
            
              // NavigationStack automatically adds a NavigationBar to the Page
              NavigationStack {
                Page {
                  title: "Green NavigationBar"
            
                  // some page content
                  AppButton {
                    anchors.centerIn: parent
                    text: "Click Me"
                    onClicked: { /* do something */ }
                  }
                }
              }
            
            }
            

            Cheers,
            Günther

            Senior Developer at Felgo - https://felgo.com/qt

            Develop mobile Apps for iOS & Android with Qt
            Felgo is an official Qt Technology Partner

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved