Reputation: 5976
So I've built an application that uses a certain default color scheme in API 15. However, I am aware that most devices are still running API 10. In order to appeal to these devices, I switched the minimum SDK on my device to 10. After doing this, I noticed that the default grayish-black color of my buttons now became white on the older devices - I suspect this is because that particular color was not available in API 10. My question is thus as follows: Is there anyway to package this resource into my APK file in order to allow these devices to see the color as I intended it, or do I need to re-design?
Upvotes: 1
Views: 151
Reputation: 7585
If you want to use an API level 15 theme everywhere, I strongly suggest you look at the HoloEverywhere project.
This allows your app to use the same type of theme and buttons regardless of API level.
Upvotes: 1
Reputation: 134714
If you need to use resources that aren't available in older versions, you can easily go grab them out of the platforms
folder of your SDK and copy them into your app locally. Alternately, you can define a fallback style (and just manually code the theme yourself instead of using android styles) by placing your old device-compatible theme in res/values/styles.xml
and placing the newer device-compatible version of the theme in res/values-v11/styles.xml
(replacing v11 with whatever version your resource became available -- typically v11 is the major change).
EDIT: Per your below comment, just make another themes.xml
file under res/values
, and copy that style into it, changing the parent to @android:style/Theme
instead of Theme.Holo
.
Upvotes: 0
Reputation: 40744
Not sure which certain default color scheme you're referring to, but HoloEverywhere has been pretty useful for me to use the various Holo themes in android 2.1 and up.
Upvotes: 0