You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
result.getAdapter().withOnlyOneExpandedItem(true);
Is not working with the 2nd level of expandable items, It is working for all expandable items including the 1st level of them, So on expanding the 2nd inside-ed item it collapse the 1st level one
even using this method if(previousExpandableItemPosition != position) { result.getAdapter().collapse(previousExpandableItemPosition); previousExpandableItemPosition = position; }
bugged on the 3rd dirffrerent item of 2nd position
for more explanation
Expandable item 1 --> "1st level"
Expandable item 2 -------> "2nd level"
Normal item 3 -----------------> "3rd level"
the method of withOnlyOneExpandedItem needs to be customized with .withLevel()
The text was updated successfully, but these errors were encountered:
@DasserBasyouni the withOnlyOneExpandedItem was not created to work for deeper hierarchies.
If you want to collapse others but allow the single hierachy you will have to handle this manually.
@DasserBasyouni the MaterialDrawer's internals depend on the FastAdapter, so everything which is true for the FastAdapter is true for the MaterialDrawer
You can get the FastAdapter via Drawer.getAdapter(). In general you will have to listen for the click event. and collapse items which are not inside the current hierarchy.
So you can get the current expanded elements via the FastAdapter.
And the FastAdapter also has the methods which allow you to collapse an item.
The general complexity here is that nested collapsable hierarchies are not too easy to handle as many aspects have to be considered.
result.getAdapter().withOnlyOneExpandedItem(true);
Is not working with the 2nd level of expandable items, It is working for all expandable items including the 1st level of them, So on expanding the 2nd inside-ed item it collapse the 1st level one
even using this method
if(previousExpandableItemPosition != position) { result.getAdapter().collapse(previousExpandableItemPosition); previousExpandableItemPosition = position; }
bugged on the 3rd dirffrerent item of 2nd position
for more explanation
Expandable item 1 --> "1st level"
Expandable item 2 -------> "2nd level"
Normal item 3 -----------------> "3rd level"
the method of withOnlyOneExpandedItem needs to be customized with
.withLevel()
The text was updated successfully, but these errors were encountered: