Android Question XML colors and theme

SMOOTSARA

Active Member
Licensed User
Longtime User
hi :)
I have an XML file which is named "colors.xml"
I have the following code into this file
who to use this file in b4a?


B4X:
Code:
<!--?xml version="1.0" encoding="UTF-8"?-->
<resources>
  <color name="primaryColor">#2e7d32</color>
  <color name="primaryLightColor">#60ad5e</color>
  <color name="primaryDarkColor">#005005</color>
  <color name="primaryTextColor">#ffffff</color>
</resources>
</resources>
 

MarkusR

Well-Known Member
Licensed User
Longtime User
i have this in manifest editor (without warranty)
B4X:
'Farb Themen
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
   <color name="navigationBar">#ff400000</color>
   <color name="colorPrimary">#ff800000</color>
   <color name="colorPrimaryDark">#ff400000</color>
   <color name="textColorPrimary">#ff000000</color>
   <color name="colorAccent">#ff800000</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light.DarkActionBar">
        <item name="android:colorPrimary">@color/colorPrimary</item>
        <item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="android:textColorPrimary">@color/textColorPrimary</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
        <item name="android:colorAccent">@color/colorAccent</item>
    </style>
</resources>
)
 
Upvote 0
Top