CategorySelectableItem

class CategorySelectableItem @JvmOverloads constructor(selectableItemList: List<SelectableItem>, onUpdated: (isSelected: Boolean) -> Unit = { }) : SelectableItem, DisposableHandle(source)

Represents a selectable item that acts as a category for a list of other selectable items.

This class extends SelectableItem and implements DisposableHandle. Its selection state is determined by the selection state of all its child SelectableItems. If all child items are selected, this category item is selected. Otherwise, it's not.

When this category item's selection state changes (either by direct user interaction or programmatically), it propagates that change to all its child items.

Conversely, if any of the child items' selection state changes, this category item updates its own selection state accordingly.

It's important to call dispose when this item is no longer needed to release listeners and prevent memory leaks.

Parameters

selectableItemList

The list of SelectableItems that this category manages.

onUpdated

A lambda function that is invoked when the selection state of this category item changes. It receives a boolean indicating the new selection state (true if selected, false otherwise). Defaults to an empty lambda.

Constructors

Link copied to clipboard
constructor(selectableItemList: List<SelectableItem>, onUpdated: (isSelected: Boolean) -> Unit = { })

Functions

Link copied to clipboard
open override fun dispose()