mikepenz / MaterialDrawer

The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
https://mikepenz.dev
Apache License 2.0
11.67k stars 2.05k forks source link

Multiple NavigationDrawerItem with same resId #2764

Closed merlin-zaraza closed 2 years ago

merlin-zaraza commented 2 years ago

About this issue

I have multiple NavigationDrawerItem with same resId and when I'm trying to select this item - navigation works, but selection doesn't. Selection is dropped to first item.

Details

Checklist

mikepenz commented 2 years ago

@merlin-zaraza thank you for the report.

This is not possible at the moment as the res id will also be used as identifier for the item itself: https://github.com/mikepenz/MaterialDrawer/blob/develop/materialdrawer-nav/src/main/java/com/mikepenz/materialdrawer/model/NavigationDrawerItem.kt#L23

merlin-zaraza commented 2 years ago

@mikepenz thanks for reply. Could you make possible to use item identifier instead of resId?

mikepenz commented 2 years ago

@merlin-zaraza you should be able to adjust the identifier of the items after creating:

NavigationDrawerItem(...).also { it.identifier = 123 }

mikepenz commented 2 years ago

Closing due to inactivity