Android Question AppCompat ToolBar ThemeLight with White Color Title/SubTitle

Anser

Well-Known Member
Licensed User
Longtime User
Hi,

I need to have the Action Bar Title and SubTitles in White Color. I understand that for this, I need to use Theme Dark. But I don't want my whole App in Dark Theme.

I believe that if I know how to change the Tite/SubTitle colors in a Material Design app that uses AppCompat then I could solve the issue. My plan is to use a Light Theme.

Can anyone point me to the righ direction ?

I am using Corwins Appcompat and ToolBar as ActionBar example as a base for my app. I do have a resource folder inside my project. I know how to modify the Theme.xml to change to ToolBar color, unfortunately no idea where to change the Color of Title and SubTitle on the ActionBar.

Thanks & Regards

Anser
 

Anser

Well-Known Member
Licensed User
Longtime User
I am aware about this xml file, unfortunately it doesn't contain any entries for the text color of the Title/SubTitle
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
These are the entries in the Themes.xml in my project path ie resource\values\themes.xml.
I don't understand where do I specify the color of the Title and SubTitle Text.

B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat">
        <item name="colorPrimary">#418BEA</item>
        <item name="colorPrimaryDark">#2C7FE8</item>
        <item name="colorAccent">#5698EC</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>

Any help will be appreciated.

Regards

Anser
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
Tried parent theme "Theme.AppCompat.Light.DarkActionBar"
Unfortunately, the Title and SubTitle text appear only in Black Color

B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">#418BEA</item>
        <item name="colorPrimaryDark">#2C7FE8</item>
        <item name="colorAccent">#5698EC</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
Screen Snapshot
Theme_App_Compat_Light.png

MsgBox2()
Theme_App_Compat_Light_2.png



Using parent="Theme.AppCompat.Light"
Unfortunately, the Title and SubTitle text appear only in Black Color
B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light">
        <item name="colorPrimary">#418BEA</item>
        <item name="colorPrimaryDark">#2C7FE8</item>
        <item name="colorAccent">#5698EC</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
Screen Snapshot
Theme_App_Compat_Light.png

MsgBox2().

Theme_App_Compat_Light_2.png




Using parent="Theme.AppCompat"

The Title and SubTitle is in White Color and this is what I am looking for, but please see the color of the MsgBox2(), it is in dark background. I need the MsgBox2() to be displayed in White Color

B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat">
        <item name="colorPrimary">#418BEA</item>
        <item name="colorPrimaryDark">#2C7FE8</item>
        <item name="colorAccent">#5698EC</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
Screen Snapshot
Theme_App_Compat.png

MsgBox2(). It is appearing in Dark BackGround and White Color Text

Theme_App_Compat_2.png


What I am looking for is, the Theme as shown below

Title and SubTitle on ActionBar in White Color
Theme_App_Compat.png

MsgBox2() ie The backgound color of MsgBox2 etc in Light/White Color and the text on it in Dark Color as shown Below

Theme_App_Compat_Light_2.png



Summary
I prefer to use the ParentTheme Parent="Theme.AppCompat.Light.DarkActionBar", but with the Text on the ActionBar on White color. So if, I could find a way to change just the Text color of the Title and SubTitle on the ActionBar, my problem will be solved.

Any help will be appreciated.

Regards
Anser
 
Upvote 0

Bright

New Member
Licensed User
Hello
Tried parent theme "Theme.AppCompat.Light.DarkActionBar"
Unfortunately, the Title and SubTitle text appear only in Black Color

B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">#418BEA</item>
        <item name="colorPrimaryDark">#2C7FE8</item>
        <item name="colorAccent">#5698EC</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
Screen Snapshot
Theme_App_Compat_Light.png

MsgBox2()
Theme_App_Compat_Light_2.png



Using parent="Theme.AppCompat.Light"
Unfortunately, the Title and SubTitle text appear only in Black Color
B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light">
        <item name="colorPrimary">#418BEA</item>
        <item name="colorPrimaryDark">#2C7FE8</item>
        <item name="colorAccent">#5698EC</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
Screen Snapshot
Theme_App_Compat_Light.png

MsgBox2().

Theme_App_Compat_Light_2.png




Using parent="Theme.AppCompat"

The Title and SubTitle is in White Color and this is what I am looking for, but please see the color of the MsgBox2(), it is in dark background. I need the MsgBox2() to be displayed in White Color

B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat">
        <item name="colorPrimary">#418BEA</item>
        <item name="colorPrimaryDark">#2C7FE8</item>
        <item name="colorAccent">#5698EC</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
Screen Snapshot
Theme_App_Compat.png

MsgBox2(). It is appearing in Dark BackGround and White Color Text

Theme_App_Compat_2.png


What I am looking for is, the Theme as shown below

Title and SubTitle on ActionBar in White Color
Theme_App_Compat.png

MsgBox2() ie The backgound color of MsgBox2 etc in Light/White Color and the text on it in Dark Color as shown Below

Theme_App_Compat_Light_2.png



Summary
I prefer to use the ParentTheme Parent="Theme.AppCompat.Light.DarkActionBar", but with the Text on the ActionBar on White color. So if, I could find a way to change just the Text color of the Title and SubTitle on the ActionBar, my problem will be solved.

Any help will be appreciated.

Regards
Anser
Hello ,

Have you any luck with this problem? have been at it the whole day and nothing seems to work
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
Hello

Hello ,

Have you any luck with this problem? have been at it the whole day and nothing seems to work
If I am not wrong, I made the following changes to the themes.xml

B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">#418BEA</item>
        <item name="colorPrimaryDark">#2C7FE8</item>
        <item name="colorAccent">#5698EC</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>

In Process_Globals

Private ActionBar As ACToolBarDark
 
Upvote 0
Top