Android Question Change some menubar colors

jroriz

Active Member
Licensed User
Longtime User
I would like to leave the items highlighted in white.
I've wasted a lot of time on the forum but I couldn't.
Can someone help me?

1671393957946.png




my manifest:
My manifest:
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#FFB200FF</color>
   <color name="statusbar">#FFB200FF</color>
   <color name="textColorPrimary">#ffffffff</color>
   <color name="navigationBar">#ffB200FF</color>
</resources>
)
CreateResource(values, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:colorPrimaryDark">@color/statusbar</item>
        <item name="android:textColorPrimary">@color/textColorPrimary</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
    </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Holo.Light">
       <item name="android:actionBarStyle">@style/CustomActionBarStyle</item>
    </style>

   <style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
       <item name="android:background">@color/actionbar</item>
   </style>
</resources>
)
 

jroriz

Active Member
Licensed User
Longtime User
Try colorAccent

I have sample code for Manifest file in this project
Unfortunately colorAccent didn't do the trick...
I simply included the two lines that reference the colorAccent.
Notice that I had to change
<item name="colorAccent">@color/colorAccent</item>
by
<item name="android:colorAccent">@color/colorAccent</item>
because the project was not compiling with the error
Linking resources Error
res\values\theme.xml:8: error: style attribute 'attr/colorAccent (aka sisweb.app.mothoexpress:attr/colorAccent)' not found.
error: failed linking references.

My new manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#FFB200FF</color>
   <color name="statusbar">#FFB200FF</color>
   <color name="textColorPrimary">#ffffffff</color>
   <color name="navigationBar">#ffB200FF</color>
     <color name="colorAccent">#FFE91E63</color>   

</resources>
)
CreateResource(values, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:colorPrimaryDark">@color/statusbar</item>
        <item name="android:textColorPrimary">@color/textColorPrimary</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
           <item name="android:colorAccent">@color/colorAccent</item>
    </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Holo.Light">
       <item name="android:actionBarStyle">@style/CustomActionBarStyle</item>
    </style>

   <style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
       <item name="android:background">@color/actionbar</item>
   </style>
</resources>
)
 
Upvote 0
Top