Register now for Android Dev Summit 2019!

OperationMonitor

class OperationMonitor
kotlin.Any
   ↳ 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 android.app.Activity or android.app.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 OnChangeListener.

Summary

Nested classes

abstract

Listen to changes in operation status.

Public constructors

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

Public methods

Unit

Registers supplied listener to be notified when operation status changes.

Boolean

Unit

Unregisters listener for further notifications.

Public constructors

<init>

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 android.app.Activity or android.app.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 OnChangeListener.

Public methods

addListener

fun addListener(@NonNull listener: OperationMonitor.OnChangeListener): Unit

Registers supplied listener to be notified when operation status changes.

Parameters
listener OperationMonitor.OnChangeListener:

isStarted

fun isStarted(): Boolean
Return
Boolean: true if there are any running operations.

removeListener

fun removeListener(@NonNull listener: OperationMonitor.OnChangeListener): Unit

Unregisters listener for further notifications.

Parameters
listener OperationMonitor.OnChangeListener: