Skip to content

Instantly share code, notes, and snippets.

@arriolac
Created October 10, 2023 17:38
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/f2a1e7e76f778516dfe3eeabdb55534a to your computer and use it in GitHub Desktop.
Save arriolac/f2a1e7e76f778516dfe3eeabdb55534a 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>,
onItemToggled: (Boolean, Int) -> Unit,
modifier: Modifier = Modifier
) {
AndroidView(
factory = {
// Create DropDownCheckboxMenuView here
DropDownCheckboxMenuView(it)
},
update = { view ->
// Update view when `items` or `onItemToggled` changes here
view.setItems(items)
view.setOnItemToggled(onItemToggled)
},
modifier = modifier
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment