user1949413
user1949413

Reputation: 3

Android L Change Theme Colors Error

I've been following the new steps for Android L here: http://developer.android.com/preview/material/theme.html I've have been trying to change the colors of the status bar but it doesn't work.

My styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:style/Theme.Material.Light">
<!-- Main theme colors -->
<!--   your apps branding color (for the app bar) -->
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorPrimary">@color/primary</item>
<!--   darker variant of colorPrimary (for status bar, contextual app bars) -->
<!--   theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/accent</item>
</style>
</resources>

My colors.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#03a9f4</color>
<color name="primary_dark">#0091ea</color>
<color name="accent">#e1f5fe</color>
</resources>

Upvotes: 0

Views: 3829

Answers (4)

Aniruddha K.M
Aniruddha K.M

Reputation: 7511

as of oct 2014, It will not be visible in the layout preview but works when viewed inside on the emulator.

Upvotes: 0

ZackBoe
ZackBoe

Reputation: 125

I don't have enough rep to elaborate upon @Allavaz's answer, but his solution worked for me. I changed the generated theme name in both styles.xml and AndroidManifest.xml from AppTheme to a different name.

I'm using Android Studio 0.8.2.

Upvotes: 0

David Zavalla
David Zavalla

Reputation: 33

I made it work by changing the style name in styles.xml and in AndroidManifest.xml.

Upvotes: 2

sheimi
sheimi

Reputation: 48

I have the same problem. And I fix this by change sdk to

<uses-sdk android:minSdkVersion="L" android:targetSdkVersion="L" />

Hope it can help.

Upvotes: 0

Related Questions