Materialdrawer: slider.removeAllItems() now needs arguments, why?

Created on 1 Jun 2020  路  3Comments  路  Source: mikepenz/MaterialDrawer

Hi Mike

In my app I need rebuild slider items several times. Before, I call 'slider.removeAllItems()' to remove them and after call slider.addItems for the new items.. All was ok, but now (8.0.3) that don`t works.

Can you create a method (without arguments) for this functionality?

Thanks in advance

enhancement question

All 3 comments

The removeAllItems is only a small extension wrapper around the adapteR:

https://github.com/mikepenz/MaterialDrawer/blob/659514439e5252238d5093e5b27a6df205b831b8/library/src/main/java/com/mikepenz/materialdrawer/util/MaterialDrawerSliderViewExtensions.kt#L47-L51

You can simple also call

slider.itemAdapter.clear()

now :)

We may want to add back an extension function for this though to ease transition

https://github.com/mikepenz/MaterialDrawer/issues/2612#issuecomment-636869664

perfect, it solves it

thanks Mike

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jd-alexander picture jd-alexander  路  4Comments

HanderWei picture HanderWei  路  3Comments

armoun picture armoun  路  3Comments

DasserBasyouni picture DasserBasyouni  路  4Comments

Ahmed-Emad picture Ahmed-Emad  路  4Comments