Skip to content

Instantly share code, notes, and snippets.

@arriolac
Last active October 10, 2023 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arriolac/155279b9beff48b62419d9a5334ca058 to your computer and use it in GitHub Desktop.
Save arriolac/155279b9beff48b62419d9a5334ca058 to your computer and use it in GitHub Desktop.
API for DropDownCheckboxMenuView
// Copyright 2023 Google LLC.
// SPDX-License-Identifier: Apache-2.0
class DropDownCheckboxMenuView(context: Context) : View(context) {
/**
* The set of items to display in this menu
*/
fun setItems(items: List<String>) { /* ... */ }
/**
* @return the set indices for checked items in the menu
*/
fun getSelectedItems(): Set<Int> { /* ... */ }
/**
* Sets a listener to be invoked when items are toggled.
* @param onItemToggled - invoked when an item is toggled. The boolean
* indicates is the item was selected, and the integer is the index of
* the item toggled
*/
fun setOnItemToggled(onItemToggled: (Boolean, Int) -> Unit) { /* ... */ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment