belongs to Maven artifact androidx.recyclerview:recyclerview-selection:1.0.0-alpha1

SelectionTracker.SelectionObserver

public static abstract class SelectionTracker.SelectionObserver
extends Object

java.lang.Object
   ↳ androidx.recyclerview.selection.SelectionTracker.SelectionObserver<K>


Observer class providing access to information about Selection state changes.

Summary

Public constructors

SelectionTracker.SelectionObserver()

Public methods

void onItemStateChanged(K key, boolean selected)

Called when the state of an item has been changed.

void onSelectionChanged()

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

void onSelectionRefresh()

Called when the underlying data set has changed.

void onSelectionRestored()

Called immediately after selection is restored.

Inherited methods

Public constructors

SelectionTracker.SelectionObserver

SelectionTracker.SelectionObserver ()

Public methods

onItemStateChanged

void onItemStateChanged (K key, 
                boolean selected)

Called when the state of an item has been changed.

Parameters
key K

selected boolean

onSelectionChanged

void onSelectionChanged ()

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

onSelectionRefresh

void onSelectionRefresh ()

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

onSelectionRestored

void onSelectionRestored ()

Called immediately after selection is restored. onItemStateChanged(K, boolean) will *not* be called for individual items in the selection.