Implement AccountHeaderish behaviour without flickering
I want to implement a behaviour like the account header does:
A view inside the Header should replace the items with others. My current solution is to call drawer.removeAllItems() followed by drawer.addItems(myOtherItems...). This replaces the items as expected but the replacement takes ~500ms and flickers white. Also, the drawer scrolls to the bottom after replacement.
Is there any way to mimic the AccountHeaders behaviour?
@couchcrew-thomas you can even use the same API I use for the AccountHeader
You can check out the source of the AccountHeader here:
https://github.com/mikepenz/MaterialDrawer/blob/develop/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1338
and the second spot here
https://github.com/mikepenz/MaterialDrawer/blob/develop/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1380
Brilliant. switchDrawerContent(...) and resetDrawerContent() work as expected.
Is there a way to preserve sticky footer items when switching content?
@couchcrew-thomas hmmm it is the expected behavior that the switchDrawerContent also removes the sticky footer items. You may just simply readd them for the changed content too