Hi,
Did some experiments today with custom styling for ICS (Icecream Sandwich) and supporting older versions. You can use the resources structure for that, I explain below.
In your B4A project folder created the following folder structure in Objects\res:
values\styles.xml
values-v11\styles.xml
The styles.xml file in values contains this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="@android:style/Theme.Light">
</style>
</resources>
Save and make the file readonly.
The styles.xml file in values-v11 contains this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
</style>
</resources>
Save and make the file readonly.
Now use the new manifest editor of B4A 1.8 and add:
SetApplicationAttribute(android:theme, "@style/MyTheme")
Above sample will simply use Holo.light on API v11 devices and a normal light theme on older devices. You can play around with these.
Make sure to compile with high enough API (configure paths) and make sure this line is in the manifest:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11"/>
Have fun with this simple first step to a custom theme.
Did some experiments today with custom styling for ICS (Icecream Sandwich) and supporting older versions. You can use the resources structure for that, I explain below.
In your B4A project folder created the following folder structure in Objects\res:
values\styles.xml
values-v11\styles.xml
The styles.xml file in values contains this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="@android:style/Theme.Light">
</style>
</resources>
Save and make the file readonly.
The styles.xml file in values-v11 contains this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
</style>
</resources>
Save and make the file readonly.
Now use the new manifest editor of B4A 1.8 and add:
SetApplicationAttribute(android:theme, "@style/MyTheme")
Above sample will simply use Holo.light on API v11 devices and a normal light theme on older devices. You can play around with these.
Make sure to compile with high enough API (configure paths) and make sure this line is in the manifest:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11"/>
Have fun with this simple first step to a custom theme.