Android Question Action Bar Overflow button color

Acuario

Active Member
Licensed User
Longtime User
Here is all the Manifest. I have set the action bar to a dark grey just so I can see the overflow buttons.
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="5" 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$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

AddPermission("android.permission.VIBRATE")

SetApplicationAttribute(android:theme, "@style/LightTheme")

'
'   <color name="textColorPrimary">#FFF0FFFF</color>
CreateResource(values, colors.xml,
<resources>
   <color name="actionbar">#FF748787</color>
   <color name="statusbar">#ff000000</color>
   <color name="navigationBar">#ff000000</color>
   <color name="white">#FFF0FFFF</color>
</resources>
)

'        <item name="android:textColorPrimary">@color/textColorPrimary</item>
CreateResource(values-v20, 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:navigationBarColor">@color/navigationBar</item>
        <item name="android:textColorSecondary">@color/white</item>
        <item name="android:colorControlNormal">@color/white</item>
    </style>
</resources>
)

'        <item name="android:actionOverflowButtonStyle">@color/white</item>
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

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Don't forget to remove the CreateResourceFromFile.
2. The Android 4 theme can be removed. Android 4 devices are obsolete.
3:
B4X:
SetApplicationAttribute(android:theme, "@style/LightTheme")

CreateResource(values, colors.xml,
<resources>
   <color name="actionbar">#ff000000</color>
   <color name="statusbar">#ff000000</color>
   <color name="navigationBar">#ff000000</color>
   <color name="white">#FFF0FFFF</color>
</resources>
)
CreateResource(values, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light.DarkActionBar">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:colorPrimaryDark">@color/statusbar</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
        <item name="android:textColorSecondary">@color/white</item>
        <item name="android:colorControlNormal">@color/white</item>
    </style>
</resources>
)
 
Upvote 0

Acuario

Active Member
Licensed User
Longtime User
Great, thanks.
It looks like I was almost there but the line:
B4X:
CreateResourceFromFile(Macro, Themes.LightTheme)
was causing it to fail.
 
Upvote 0
Top