Skip to content

Instantly share code, notes, and snippets.

@arriolac
Created October 10, 2023 17:50
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/dedb3752f9b1e2b8d6a79c959f2dc292 to your computer and use it in GitHub Desktop.
Save arriolac/dedb3752f9b1e2b8d6a79c959f2dc292 to your computer and use it in GitHub Desktop.
// Copyright 2023 Google LLC.
// SPDX-License-Identifier: Apache-2.0
@Composable
fun DropDownCheckboxMenu(
items: List<String>,
selectedItems: Set<Int>,
onItemToggled: (Boolean, Int) -> Unit,
modifier: Modifier = Modifier
) {
AndroidView(
factory = { /* ... */ },
update = { view ->
view.setItems(items)
view.setSelectedItems(selectedItems)
view.setOnItemToggled(onItemSelected)
},
modifier = modifier
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment