lightbulb_outline Please take our October 2018 developer survey. Start survey
added in version 1.0.0
belongs to Maven artifact androidx.recyclerview:recyclerview-selection:1.0.0

OperationMonitor

public final class OperationMonitor
extends Object

java.lang.Object
   ↳ androidx.recyclerview.selection.OperationMonitor


OperationMonitor provides a mechanism to coordinate application logic with ongoing user selection activities (such as active band selection and active gesture selection).

The host Activity or Fragment should avoid changing Adapter data while there are active selection operations, as this can result in a poor user experience.

To know when an operation is active listen to changes using an OperationMonitor.OnChangeListener.

Summary

Nested classes

interface OperationMonitor.OnChangeListener

Listen to changes in operation status. 

Public constructors

OperationMonitor()

Public methods

void addListener(OperationMonitor.OnChangeListener listener)

Registers supplied listener to be notified when operation status changes.

boolean isStarted()
void removeListener(OperationMonitor.OnChangeListener listener)

Unregisters listener for further notifications.

Inherited methods

Public constructors

OperationMonitor

added in version 1.0.0
public OperationMonitor ()

Public methods

addListener

added in version 1.0.0
public void addListener (OperationMonitor.OnChangeListener listener)

Registers supplied listener to be notified when operation status changes.

isStarted

added in version 1.0.0
public boolean isStarted ()

Returns
boolean true if there are any running operations.

removeListener

added in version 1.0.0
public void removeListener (OperationMonitor.OnChangeListener listener)

Unregisters listener for further notifications.