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
public OperationMonitor ()
Public methods
addListener
public void addListener (OperationMonitor.OnChangeListener listener)
Registers supplied listener to be notified when operation status changes.
Parameters | |
---|---|
listener |
OperationMonitor.OnChangeListener |
isStarted
public boolean isStarted ()
Returns | |
---|---|
boolean |
true if there are any running operations. |
removeListener
public void removeListener (OperationMonitor.OnChangeListener listener)
Unregisters listener for further notifications.
Parameters | |
---|---|
listener |
OperationMonitor.OnChangeListener |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-30 UTC.