mikepenz/Android-Iconics

How to make icons take on highlighted color of MaterialDrawerItem in XML?

Sternbach-Software opened this issue · 3 comments

In your MaterialDrawerLayout, when a GoogleMaterial icon is used with iconicsIcon in a drawer item, when the item is selected and the holder is highlighted with the primary color, the icon assumes a highlight of the primary color. I want to achieve the same effect in XML. How can I do that? Also, what color is the icon filled with?

@shmueldabomb441 the MaterialDrawer's iconics module will add the ability to just specify the icon, and it will be tinted automatically: https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/java/com/mikepenz/materialdrawer/app/FullscreenDrawerActivity.kt#L56

If you do not want to use this API, you can enable icon tinting on drawables:
https://github.com/mikepenz/MaterialDrawer/blob/develop/materialdrawer/src/main/java/com/mikepenz/materialdrawer/model/BaseDrawerItem.kt#L20

This issue seems to be only MaterialDrawer specific, and not Android-Iconics related.

Thank you! I apologize for misplacing the question. I thought that it was related to the icon and not the drawer. What color is it filled with? The reason for this issue is because I want to reduce the number of external dependancies, so was looking for ways to do it without including the iconics module in the dependancies.

As you want to not use iconcis. closing this issue as it's unrelated.

If you enable tinting on the materialdrawer it will apply the same color as it would on iconics