Android Question Change color for Actionbar etc.

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Hi,

I try to change the color for Softkey area but doesn't works.
I have do this according below thread

I is still white background and black Buttons.


B4X:
'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="30"/>
<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.DarkTheme)
CreateResourceFromFile(Macro, Themes.LightTheme)
SetActivityAttribute(generalsettings, android:windowSoftInputMode, adjustPan|stateHidden)
'End of default text.
AddPermission(android.permission.FOREGROUND_SERVICE)

CreateResource(values-v21, theme.xml,
<resources>
  <style name="LightTheme" parent="@android:style/Theme.Material.Light">
  <item name="android:colorAccent">#FF5E7A0B</item> <!-- checkboxes,, switches,, etc. -->
 <!--  <item name="android:fontFamily">@font/CustomFontStyle</item>
        <item name="opensansregular">@font/opensansregular</item> -->
  </style>
</resources>
)


SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#ff039be5</color>
   <color name="statusbar">#ff006db3</color>
   <color name="textColorPrimary">#ffffffff</color>
   <color name="navigationBar">#ff006db3</color>
</resources>
)
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: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>
)
 
Top