Sheet Selection
minibugdev/SheetSelection with some improvements:
Based on- Multi-selection
- Retained selection callback
- Survive on rotation
- and more little changes...
Sample app (apk)
How to use
class MainActivity (or Fragment) : SheetSelectionListener {
showSheetSelection("MY_TAG") {
title("Sheet Selection")
items(List(25) {
SheetSelectionItem("$it", "#$it")
})
enableDraggableIndicator(true)
enableMultiSelection(true)
enableSearch(true)
enableCloseButton(true)
multiSelectionButtonText("Select")
searchNotFoundText("Empty")
}
override fun onSheetItemsSelected(event: SheetSelectionEvent) {
event.doIfMatches("MY_TAG") { selected ->
Toast.makeText(
this,
"Selected: ${selected.joinToString { it.value }}",
Toast.LENGTH_LONG
).show()
}
}
}
Screenshots
Installation
Add it in your root build.gradle
at the end of repositories:
repositories {
..
maven { url 'https://jitpack.io' }
}
Add the dependency
dependencies {
implementation 'com.github.khoben:sheetselection:3.0.4'
}