RecyclerViewAccessibilityDelegate
public
class
RecyclerViewAccessibilityDelegate
extends AccessibilityDelegateCompat
| java.lang.Object | ||
| ↳ | androidx.core.view.AccessibilityDelegateCompat | |
| ↳ | androidx.recyclerview.widget.RecyclerViewAccessibilityDelegate | |
The AccessibilityDelegate used by RecyclerView.
This class handles basic accessibility actions and delegates them to LayoutManager.
Summary
Nested classes | |
|---|---|
class |
RecyclerViewAccessibilityDelegate.ItemDelegate
The default implementation of accessibility delegate for the individual items of the RecyclerView. |
Public constructors | |
|---|---|
RecyclerViewAccessibilityDelegate(RecyclerView recyclerView)
|
|
Public methods | |
|---|---|
AccessibilityDelegateCompat
|
getItemDelegate()
Gets the AccessibilityDelegate for an individual item in the RecyclerView. |
void
|
onInitializeAccessibilityEvent(View host, AccessibilityEvent event)
Initializes an |
void
|
onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info)
Initializes an |
boolean
|
performAccessibilityAction(View host, int action, Bundle args)
Performs the specified accessibility action on the view. |
Inherited methods | |
|---|---|
Public constructors
RecyclerViewAccessibilityDelegate
public RecyclerViewAccessibilityDelegate (RecyclerView recyclerView)
| Parameters | |
|---|---|
recyclerView |
RecyclerView |
Public methods
getItemDelegate
public AccessibilityDelegateCompat getItemDelegate ()
Gets the AccessibilityDelegate for an individual item in the RecyclerView.
A basic item delegate is provided by default, but you can override this
method to provide a custom per-item delegate.
For now, returning an AccessibilityDelegateCompat as opposed to an
ItemDelegate will prevent use of the ViewCompat accessibility API on
item views.
| Returns | |
|---|---|
AccessibilityDelegateCompat |
|
onInitializeAccessibilityEvent
public void onInitializeAccessibilityEvent (View host, AccessibilityEvent event)
Initializes an AccessibilityEvent with information about the
the host View which is the event source.
The default implementation behaves as
ViewCompat#onInitalizeAccessibilityEvent(View v, AccessibilityEvent event) for
the case of no accessibility delegate been set.
| Parameters | |
|---|---|
host |
View: The View hosting the delegate. |
event |
AccessibilityEvent: The event to initialize. |
onInitializeAccessibilityNodeInfo
public void onInitializeAccessibilityNodeInfo (View host, AccessibilityNodeInfoCompat info)
Initializes an AccessibilityNodeInfoCompat with information about the host view.
The default implementation behaves as
ViewCompat#onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfoCompat) for
the case of no accessibility delegate been set.
| Parameters | |
|---|---|
host |
View: The View hosting the delegate. |
info |
AccessibilityNodeInfoCompat: The instance to initialize. |
performAccessibilityAction
public boolean performAccessibilityAction (View host, int action, Bundle args)
Performs the specified accessibility action on the view. For
possible accessibility actions look at AccessibilityNodeInfoCompat.
The default implementation behaves as
View#performAccessibilityAction(int, Bundle) for the case of
no accessibility delegate been set.
| Parameters | |
|---|---|
host |
View |
action |
int: The action to perform. |
args |
Bundle |
| Returns | |
|---|---|
boolean |
Whether the action was performed. |
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 2019-12-27 UTC.

