Am using mike penz material drawer for my project and its working great except this issue. After visiting a previous fragment which falls under a collapse menu, say for example, Create New job as shown in the screenshot, and i go to Profile, i want the the collapsed menu for which that item falls under in this case Jobs to be closed automatically. Any help is appreciated.
Asked
Active
Viewed 194 times
1
-
Did you find any solutions? – Mahmoud Heretani Aug 03 '20 at 17:07
-
@MahmoudHeretani sorry not yet. – Aug 08 '20 at 04:26
1 Answers
0
The MaterialDrawer
library uses the FastAdapter
as adapter behind the scenes to offer expandable functionality, and additional APIs to simplify the work with the RecyclerView
showing the elements.
To collapse all expanded items within the drawer, it is possible to access the expandableExtension
from the MaterialDrawerSliderView
, and use its API to for example collapse all items.
binding.slider.expandableExtension.collapse()
To connect this to the Drawer
, call this for example when the Profile
item was clicked and you were notified via the onDrawerItemClickListener
The provided sample code is based on the MaterialDrawer v8.x.y version

mikepenz
- 12,708
- 14
- 77
- 117