Unsolved Customize Top Status/Notification Bar Android
-
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 BarThank you very much.
-
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 -
Thanks, and where I could fine this file?
Thanks again.
-
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/
-
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