0

I'm trying to create a custom set of colors, to further reference them throughout a theme.

I found a similar post here and by following those steps, I'm trying to define holo_blue_dark as the custom color:

res\values\attrs.xml

<attr name="holo_blue_dark" format="reference|color" />

res\values\styles.xml

<style name="AppTheme.Dark" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="holo_blue_dark">@color/red</item>
</style>

res\values\colors.xml

<color name="holo_blue_dark">#FF33B5E5</color>

I always get Failure [INSTALL_FAILED_THEME_AAPT_ERROR] in Android Studio 0.8.2, so I must be missing something.

Community
  • 1
  • 1
Mathieu
  • 75
  • 1
  • 2
  • 5

1 Answers1

0

res\values\attrs.xml

<attr name="holo_blue_dark" format="color"/>

res\values\styles.xml

<style name="AppTheme.Dark" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="holo_blue_dark">@color/your_color</item>
</style>

res\values\colors.xml

<color name="your_color">#FF33B5E5</color>

And make sure you are using the theme AppTheme.Dark where you are using that attribute.

Ionut Negru
  • 6,186
  • 4
  • 48
  • 78