Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] Menu Icons with different themes

OP Auroratic

11th January 2014, 12:50 AM   |  #1  
Auroratic's Avatar
OP Member
Flag Austria
Thanks Meter: 0
 
45 posts
Join Date:Joined: Jun 2013
More
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 by Auroratic; 11th January 2014 at 01:02 AM.
11th January 2014, 02:27 PM   |  #2  
Auroratic's Avatar
OP Member
Flag Austria
Thanks Meter: 0
 
45 posts
Join Date:Joined: Jun 2013
More
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" @drawable/ic_action_search</item>
    </style>

    <style name="MyTheme.Light" parent="android:Theme.Holo.Light">
        <item name="search_icon" @drawable/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 by Auroratic; 11th January 2014 at 02:35 PM.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes