SelectionTracker.SelectionObserver


public 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 methods

void
onItemStateChanged(@NonNull K key, boolean selected)

Called when the state of an item has been changed.

void

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

void

Called when the underlying data set has changed.

void

Called immediately after selection is restored.

Public constructors

SelectionObserver

Added in 1.0.0
public SelectionObserver()

Public methods

onItemStateChanged

Added in 1.0.0
public void onItemStateChanged(@NonNull K key, boolean selected)

Called when the state of an item has been changed.

onSelectionChanged

Added in 1.0.0
public void onSelectionChanged()

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

onSelectionRefresh

Added in 1.0.0
public void onSelectionRefresh()

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
public void onSelectionRestored()

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