Change Drawable Based on Theme

Seems like I’m always just a Google search or two away from my answers. The solution is:

in styles.xml

<attr name="buttonface_picture" format="reference"/>

then in the actual theme:

<item name="buttonface_picture">@drawable/buttonface_picture_dark</item>

or

<item name="buttonface_picture">@drawable/buttonface_picture_light</item>

Then, in the menu.xml:

<item
    android:id="@+id/menu_attach_existing_picture"
    android:icon="?attr/buttonface_picture"
    android:showAsAction="always"
    android:title="@string/menu_attach_existing_picture">
</item>

The Accessing Resources Page combined with this SO eventually got it to click in my brain.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)