SingleSelectableTask

A task that ensures only one item can be selected at a time from a list of ViewData.

This task filters out AppInfoViewData instances from the input list, extracts their SelectableItem objects, and then manages their selection state.

Key behaviors:

  • If no items are initially selected, the first item in the list will be selected by default.

  • When an item is selected, all other items are automatically deselected.

  • Listeners are registered on each SelectableItem to enforce the single-selection rule.

  • Previous listeners are disposed of before new ones are registered to prevent memory leaks.

  • The task returns the original input list, with the selection states of the SelectableItem objects updated.

See also

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open operator override fun invoke(input: List<ViewData>): List<ViewData>