Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slider.removeAllItems() now needs arguments, why? #2612

Closed
fuentepa opened this issue Jun 1, 2020 · 3 comments
Closed

slider.removeAllItems() now needs arguments, why? #2612

fuentepa opened this issue Jun 1, 2020 · 3 comments

Comments

@fuentepa
Copy link

fuentepa commented Jun 1, 2020

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

  • materialdrawer:8.0.3
  • androidx.appcompat:appcompat:1.1.0
  • com.android.tools.build:gradle:4.0.0
  • Android Studio 4.0
@mikepenz
Copy link
Owner

mikepenz commented Jun 1, 2020

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

fun MaterialDrawerSliderView.removeAllItems(vararg drawerItems: IDrawerItem<*>) {
drawerItems.forEach {
itemAdapter.removeByIdentifier(it.identifier)
}
}

You can simple also call

slider.itemAdapter.clear()

now :)

@mikepenz
Copy link
Owner

mikepenz commented Jun 1, 2020

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

@fuentepa
Copy link
Author

fuentepa commented Jun 1, 2020

#2612 (comment)

perfect, it solves it

thanks Mike

@mikepenz mikepenz closed this as completed Jun 1, 2020
mikepenz added a commit that referenced this issue Jun 6, 2020
- rename function to remove provided items
  - FIX #2612
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants