MaterialDrawer: Selected icon color doesnt work

Does this library support tinting of the icon (a .png file) in selected state? from what I gone thru, the code does so by tint the icon with material_drawer_selected_text color My icons are still white even in selected state.

<style name="CustomStyle" parent="MaterialDrawerTheme">
    <item name="colorPrimary">@color/primary_color</item>
    <item name="colorPrimaryDark">@color/primary_dark_color</item>
    <item name="colorAccent">@color/accent_color</item>

    <item name="material_drawer_selected_text">@color/accent_color</item>
</style>

I have also tried setting it in Java, where i see it has higher priority. but it also doesnt tint with my color accent

new PrimaryDrawerItem()
    .withName(NAVDRAWER_TITLE_RES_ID[i])
    .withIcon(NAVDRAWER_ICON_RES_ID[i])
    .withSelectedIconColorRes(R.color.accent_color)
    .withIdentifier(NAV_ITEMS[i]);

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

@andhie have you tried with .withTintSelectedIcon(true)?