I build based on this repository my first TWA / PWA App. Everything is working fine, but i can´t change the color of the statusbar.
I modify this file and add this line in the <style>
tag:
<item name="android:statusBarColor">@color/ic_launcher_background</item>
The thing is... it works on the first init of the App well... But 500ms after first init it starts the webview and the statusBarColor is white again.
Any idea how i can fix this?
Updated: The latest version of the Support Library (e849e45c90) has been updated to make it easier to change the status bar color.
The SVGOMG sample has been updated to use it, and the necessary changes for apps to make it work can be seen in this pull request.
The section below is outdated, but leaving here for historical context
It is possible to change the status bar color by customising it when opening the Custom Tabs Intent.
This is not currently configurable in the manifest, and the main way to do it is:
protected CustomTabsIntent getCustomTabsIntent(CustomTabsSession session) {
return new CustomTabsIntent.Builder(session)
.setToolbarColor(Color.parseColor("#FF0000"))
.build();
}
The code above will create a red status bar. Replace #FF0000
with the desire color.