Chris2222000
Chris2222000

Reputation: 67

Android - apply theme from older API

I would like to deploy my app on APIs 8-17. However, for purely aesthetic reasons I would like to apply the default theme as it appears on api 8 as the theme for the app across all API levels.

For example, the older theme has an edittext that has an orangeish border around it, whereas the newer them uses a borderless blue line.

By limiting which APIs i deploy too I have been able to accomplish this but that isn't really a solution.

Does anyone know how this can be accomplished?

Thanks

Update

For whatever reason applying "Theme" as the theme did not force it to revert to the "Theme" theme, but instead left it as the default Holo. Using the answers below I simply called "Theme" as the parent in my custom theme (without altering any of its attributes) and set it as my application theme in the manifest. This solved it.

Upvotes: 0

Views: 283

Answers (2)

Anup Cowkur
Anup Cowkur

Reputation: 20563

In your res/values directory, you can have a themes.xml file with:

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="Theme" parent="@android:Theme">

    </style>

</resources>

Your app theme will now subclass from default Theme instead of Theme.Holo and you should be able to get older theme on newer android versions as well.

Upvotes: 1

g00dy
g00dy

Reputation: 6778

If you're using the default theme, it will be different between the API levels. However in the styles, you can create a custom Theme, modify an existing Theme or give a different Theme to each different API of your choice.

Upvotes: 1

Related Questions