After my experiences with the API36 transition I thought it might be interesting to have a small collection of custom UI themes for future projects. I understand this involves customising one the exisiting native themes at compile-time in the manifest. Using examples from the forum I have the bones of creating a 'child-theme' but I have so far failed to get the code to compile and the errors are not very informative as to the cause. Interaction with the existing themes seems to be the issue. Help appreciated.....
B4X:
' ==============================================================================
' DEFINE THE THEME COLOR PALETTE
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
<color name="mint_primary">#3EB489</color>
<color name="mint_primary_dark">#2C8563</color>
<color name="mint_accent">#50E3C2</color>
<color name="mint_background">#F4F9F6</color>
<color name="mint_text">#1A2E26</color>
</resources>
)
' ==============================================================================
'CREATE THE LIGHT MINT THEME CONFIGURATION
CreateResource(values, theme.xml,
<resources>
<!-- Inherits from the standard native Light theme with no title bar -->
<style name="CustomLightMintTheme" parent="Theme.Material.Light"> '*** Fails on this line
<!-- Apply custom color tokens into standard system variables -->
<item name="colorPrimary">@color/mint_primary</item>
<item name="colorPrimaryDark">@color/mint_primary_dark</item>
<item name="colorAccent">@color/mint_accent</item>
<item name="android:windowBackground">@color/mint_background</item>
<item name="android:textColor">@color/mint_text</item>
</style>
</resources>
)
' ==============================================================================
' 3. APPLY THE THEME APPLICATION-WIDE
SetApplicationAttribute(android:theme, "@style/CustomLightMintTheme")