mikepenz/MaterialDrawer

Multiple drawer items remain selected

thimovandenberg opened this issue · 3 comments

About this issue

Hi, I have a small issue with multiple drawer items remaining selected when setSelection() is used. I have tried to setting setMultiselect(false), but this causes the problem to persist and items are not selected anymore when clicked on them.

image

I have created a small project to show the behavior here
By pressing the button the selection is changed, but the previously selected item remains selected.
Enabling mSlider.setMultiSelect(false) does not resolve this, but causes the items to not be selected when clicked.

I also saw a similar issue here, but this was not resolved I believe.

Details

  •  Used library version: 9.0.0-b01
  •  Used support library version: AppCompat 1.4.1
  •  Used gradle build tools version: 7.1.2
  •  Used tooling / Android Studio version 2021.1.1
  •  Other used libraries, potential conflicting libraries: N/A

Oh actually I just noticed using setSelectionAtPosition does work

Thank you for the report @thimovandenberg will need to have a look.

Is there a reason for the need to calling multiSelect=false?

I used multiSelect = false because it was mentioned as a potential fix in the other thread. I was migrating from an older version of the library where setSelection() caused the other items to be unselected. I have now changed this to setSelectionAtPosition() and it works as intended. Thanks for looking at it :)