Skip to content

Instantly share code, notes, and snippets.

@fvilarino
Created March 17, 2024 23:12
Show Gist options
  • Save fvilarino/9aa91ecc6bfb7f17c9065f104bc259b3 to your computer and use it in GitHub Desktop.
Save fvilarino/9aa91ecc6bfb7f17c9065f104bc259b3 to your computer and use it in GitHub Desktop.
Cihp Selector - State Holder API
// 1
enum class SelectionMode {
Single,
Multiple,
}
// 2
@Stable
interface ChipSelectorState {
// 3
val chips: List<String>
// 4
val selectedChips: List<String>
// 5
fun onChipClick(chip: String)
// 6
fun isSelected(chip: String): Boolean
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment