SelectionTracker.SelectionObserver


abstract class SelectionTracker.SelectionObserver<K>


Observer class providing access to information about Selection state changes.

Parameters
<K>

Selection key type. @see StorageStrategy for supported types.

Summary

Public constructors

Public functions

Unit
onItemStateChanged(key: K, selected: Boolean)

Called when the state of an item has been changed.

Unit

Called immediately after completion of any set of changes, excluding those resulting in calls to onSelectionRefresh and onSelectionRestored.

Unit

Called when the underlying data set has changed.

Unit

Called immediately after selection is restored.

Public constructors

SelectionObserver

Added in 1.0.0
SelectionObserver()

Public functions

onItemStateChanged

Added in 1.0.0
fun onItemStateChanged(key: K, selected: Boolean): Unit

Called when the state of an item has been changed.

onSelectionChanged

Added in 1.0.0
fun onSelectionChanged(): Unit

Called immediately after completion of any set of changes, excluding those resulting in calls to onSelectionRefresh and onSelectionRestored.

onSelectionRefresh

Added in 1.0.0
fun onSelectionRefresh(): Unit

Called when the underlying data set has changed. After this method is called SelectionTracker will traverse the existing selection, calling onItemStateChanged for each selected item, and deselecting any items that cannot be selected given the updated data-set (and after consulting SelectionPredicate).

onSelectionRestored

Added in 1.0.0
fun onSelectionRestored(): Unit

Called immediately after selection is restored. onItemStateChanged will *not* be called for individual items in the selection.