[Q] Menu Icons with different themes

Search This thread

Auroratic

Member
Jun 15, 2013
48
0
Austria
Hello,
in the settings of my App the users can switch between Holo.Light and Holo theme.

But I show some Menu options in the ActionBar. I've copied the icons for Holo.Light into my App.
When I switch to Holo theme, the icons looks not really good.

How can I implement the icons for the dark theme?
 
Last edited:

Auroratic

Member
Jun 15, 2013
48
0
Austria
I've tried the following: http://stackoverflow.com/a/12339924

But it dont work..

values/attrs.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <declare-styleable name="main">
        <attr name="search_icon" format="reference" />
    </declare-styleable>

</resources>

values/styles.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="MyTheme" parent="android:Theme.Holo">
        <item name="search_icon" [user=3944923]@drawab[/user]le/ic_action_search</item>
    </style>

    <style name="MyTheme.Light" parent="android:Theme.Holo.Light">
        <item name="search_icon" [user=3944923]@drawab[/user]le/ic_action_search_light</item>
    </style>

</resources>

menu/main.xml
Code:
    <item
        android:id="@+id/action_search"
        android:icon="?search_icon"
.....

manifest:
Code:
<application
        android:theme="@style/MyTheme"

wheres the error? it does always show the @drawable/ic_action_search_light icon..
 
Last edited: