Solution 1 :
to change the status bar (the notification bar):
<item name="android:windowLightStatusBar">false</item>
<item name="android:statusBarColor">@color/black</item>
to change the title bar:
change the value of “colorPrimary”
Solution 2 :
Use getConfig()
to get the configuration instance and then use Config.mToolbarColor
to set the color. You need to use ARGB color.
You can refer to the source code is here for other configurable properties
Problem :
I am working with Mesibo SDK for android and I am trying to change the toolbar color without results.
I would to like to change both colors:
https://ibb.co/LrXf4d8
I tried to edit colors.xml and styles.xml but nothing is changing.
Someone has the solution?
I paste part of code.
activity_settings.xml:
<com.google.android.material.appbar.AppBarLayout
android_id="@+id/settings_appbar"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<androidx.appcompat.widget.Toolbar
android_id="@+id/settings_toolbar"
android_layout_width="match_parent"
android_layout_height="?attr/actionBarSize"
android_background="?attr/colorPrimary"
app_popupTheme="@style/ThemeOverlay.AppCompat.Light">
</androidx.appcompat.widget.Toolbar>
In the colors.xml file I changed colorPrimary but nothing happened.
Comments
Comment posted by MrPlunk
yes, I tried to change value on colorPrimary in colors.xml file but nothing happend.
Comment posted by MrPlunk
Hi, thank you for your answer. I am working on android source code, is not possible to change it only editing colors.xml file? Because, on your documents there are not informations to use getConfig() and Config.mToolbarColor
Comment posted by mesibo
If you want it in a particular way, you can download the source code, modify and compile it yourself. It is open-source.
Comment posted by MrPlunk
Hi friend, thank you for your message. I downloaded the code from github. I started the code via android studio and I opened the colors.xml file. In this file I changed
Comment posted by ibb.co/RHG78fG
please check this image: