Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!

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 RecyclerView.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

Public methods
Unit

Unregisters listener for further notifications.

Unit

Registers supplied listener to be notified when operation status changes.

Boolean

Public constructors

<init>

OperationMonitor()

Public methods

removeListener

fun removeListener(listener: OperationMonitor.OnChangeListener): Unit

Unregisters listener for further notifications.

Parameters
listener OperationMonitor.OnChangeListener:

addListener

fun addListener(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.