Android Question How to change B4XPages theme color ?

mr.gedo

Member
hello all,

Is a B4XPages better than a Appcompat for the Themes?
i have old project, In the old project I used Appcompat, but I will dispense with it now and switch it to B4XPages becuse i tried to use Appcompat with B4XPages and problems occur

so how can i change app color theme like we do with appcompat ?


B4X:
SetApplicationAttribute(android:theme, "@style/MyAppTheme")

CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">#0076ff</item>
        <item name="colorPrimaryDark">#0076ff</item>
        <item name="colorAccent">#0076ff</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
SetApplicationAttribute(android:theme, "@style/MyAppTheme")

CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="@android:style/Theme.Material.Light.NoActionBar">
        <item name="android:colorPrimary">#0076ff</item>
        <item name="android:colorPrimaryDark">#0076ff</item>
        <item name="android:colorAccent">#0076ff</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
    </style>
</resources>
)
 
Upvote 0
Top