@MainThread public abstract class ObservableChoiceMode extends Object implements ChoiceMode
| Constructor and Description |
|---|
ObservableChoiceMode() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAttached()
Returns true when choice mode is attached to adapter and RecyclerView.
|
void |
notifyAllItemsCheckedChanged(boolean fromUser)
Notifies the registered observers that the selection of the all items
in the choice mode have been changed.
|
void |
notifyItemCheckedChanged(long itemId,
boolean fromUser)
Notifies the registered observers that the selection of the item in the choice mode
have been changed.
|
void |
registerChoiceModeObserver(ChoiceModeObserver observer)
Register a new observer to listen for selection changes.
|
void |
unregisterChoiceModeObserver(ChoiceModeObserver observer)
Unregister an observer currently listening for selection changes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearChoices, getCheckedItemCount, isActivated, isItemChecked, onClick, onLongClick, requiresLongpress, requiresStableIds, setItemCheckedpublic final boolean isAttached()
@CallSuper public void registerChoiceModeObserver(@NonNull ChoiceModeObserver observer)
The choice mode may publish a variety of events describing selection changes.
Components registering observers with a choice mode are responsible for
ChoiceMode.unregisterChoiceModeObserver(ChoiceModeObserver)
unregistering} those observers when finished.
registerChoiceModeObserver in interface ChoiceModeobserver - Observer to register.ChoiceMode.unregisterChoiceModeObserver(ChoiceModeObserver)@CallSuper public void unregisterChoiceModeObserver(@NonNull ChoiceModeObserver observer)
The unregistered observer will no longer receive events about changes to the choice mode.
unregisterChoiceModeObserver in interface ChoiceModeobserver - Observer to unregister.ChoiceMode.registerChoiceModeObserver(ChoiceModeObserver)public void notifyItemCheckedChanged(long itemId,
boolean fromUser)
itemId - The item's id or RecyclerView#NO_ID.fromUser - true if the checked state change was initiated by the user.public void notifyAllItemsCheckedChanged(boolean fromUser)
fromUser - true if the checked state change was initiated by the user.