AccessibilityDelegateCompat
open class AccessibilityDelegateCompat
kotlin.Any | |
↳ | androidx.core.view.AccessibilityDelegateCompat |
Helper for accessing AccessibilityDelegate
.
Note: On platform versions prior to API 23
, delegate methods on views in the android.widget.*
package are called before host methods. This prevents certain properties such as class name from being modified by overriding AccessibilityDelegateCompat#onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfoCompat)
, as any changes will be overwritten by the host class.
Starting in API 23
, delegate methods are called after host methods, which all properties to be modified without being overwritten by the host class.
Summary
Public constructors | |
---|---|
<init>() Creates a new instance. |
Public methods | |
---|---|
open Boolean |
dispatchPopulateAccessibilityEvent(host: View!, event: AccessibilityEvent!) Dispatches an |
open Unit |
sendAccessibilityEvent(host: View!, eventType: Int) Sends an accessibility event of the given type. |
open Boolean |
performAccessibilityAction(host: View!, action: Int, args: Bundle!) Performs the specified accessibility action on the view. |
open Unit |
sendAccessibilityEventUnchecked(host: View!, event: AccessibilityEvent!) Sends an accessibility event. |
open Unit |
onPopulateAccessibilityEvent(host: View!, event: AccessibilityEvent!) Gives a chance to the host View to populate the accessibility event with its text content. |
open Unit |
onInitializeAccessibilityEvent(host: View!, event: AccessibilityEvent!) Initializes an |
open Unit |
onInitializeAccessibilityNodeInfo(host: View!, info: AccessibilityNodeInfoCompat!) Initializes an |
open AccessibilityNodeProviderCompat! |
getAccessibilityNodeProvider(host: View!) Gets the provider for managing a virtual view hierarchy rooted at this View and reported to |
open Boolean |
onRequestSendAccessibilityEvent(host: ViewGroup!, child: View!, event: AccessibilityEvent!) Called when a child of the host View has requested sending an |
Public constructors
<init>
AccessibilityDelegateCompat()
Creates a new instance.
Public methods
dispatchPopulateAccessibilityEvent
open fun dispatchPopulateAccessibilityEvent(host: View!, event: AccessibilityEvent!): Boolean
Dispatches an AccessibilityEvent
to the host View
first and then to its children for adding their text content to the event.
The default implementation behaves as View#dispatchPopulateAccessibilityEvent(AccessibilityEvent)
for the case of no accessibility delegate been set.
Parameters | |
---|---|
host |
View!: The View hosting the delegate. |
event |
View!: The event. |
Return | |
---|---|
Boolean: True if the event population was completed. |
sendAccessibilityEvent
open fun sendAccessibilityEvent(host: View!, eventType: Int): Unit
Sends an accessibility event of the given type. If accessibility is not enabled this method has no effect.
The default implementation behaves as View#sendAccessibilityEvent(int)
for the case of no accessibility delegate been set.
Parameters | |
---|---|
host |
View!: The View hosting the delegate. |
eventType |
View!: The type of the event to send. |
See Also
performAccessibilityAction
open fun performAccessibilityAction(host: View!, action: Int, args: Bundle!): Boolean
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 | |
---|---|
action |
View!: The action to perform. |
Return | |
---|---|
Boolean: Whether the action was performed. |
sendAccessibilityEventUnchecked
open fun sendAccessibilityEventUnchecked(host: View!, event: AccessibilityEvent!): Unit
Sends an accessibility event. This method behaves exactly as #sendAccessibilityEvent(View, int)
but takes as an argument an empty AccessibilityEvent
and does not perform a check whether accessibility is enabled.
The default implementation behaves as View#sendAccessibilityEventUnchecked(AccessibilityEvent)
for the case of no accessibility delegate been set.
Parameters | |
---|---|
host |
View!: The View hosting the delegate. |
event |
View!: The event to send. |
onPopulateAccessibilityEvent
open fun onPopulateAccessibilityEvent(host: View!, event: AccessibilityEvent!): Unit
Gives a chance to the host View to populate the accessibility event with its text content.
The default implementation behaves as ViewCompat#onPopulateAccessibilityEvent(AccessibilityEvent)
for the case of no accessibility delegate been set.
Parameters | |
---|---|
host |
View!: The View hosting the delegate. |
event |
View!: The accessibility event which to populate. |
onInitializeAccessibilityEvent
open fun onInitializeAccessibilityEvent(host: View!, event: AccessibilityEvent!): Unit
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 |
View!: The event to initialize. |
onInitializeAccessibilityNodeInfo
open fun onInitializeAccessibilityNodeInfo(host: View!, info: AccessibilityNodeInfoCompat!): Unit
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 |
View!: The instance to initialize. |
getAccessibilityNodeProvider
open fun getAccessibilityNodeProvider(host: View!): AccessibilityNodeProviderCompat!
Gets the provider for managing a virtual view hierarchy rooted at this View and reported to android.accessibilityservice.AccessibilityService
s that explore the window content.
The default implementation behaves as ViewCompat#getAccessibilityNodeProvider(View)
for the case of no accessibility delegate been set.
Return | |
---|---|
AccessibilityNodeProviderCompat!: The provider. |
See Also
onRequestSendAccessibilityEvent
open fun onRequestSendAccessibilityEvent(host: ViewGroup!, child: View!, event: AccessibilityEvent!): Boolean
Called when a child of the host View has requested sending an AccessibilityEvent
and gives an opportunity to the parent (the host) to augment the event.
The default implementation behaves as ViewGroupCompat#onRequestSendAccessibilityEvent(ViewGroup, View, AccessibilityEvent)
for the case of no accessibility delegate been set.
Parameters | |
---|---|
host |
ViewGroup!: The View hosting the delegate. |
child |
ViewGroup!: The child which requests sending the event. |
event |
ViewGroup!: The event to be sent. |
Return | |
---|---|
Boolean: True if the event should be sent |
Interfaces
- LayoutInflaterFactory
- OnApplyWindowInsetsListener
- ViewPropertyAnimatorUpdateListener
- MenuItemCompat.OnActionExpandListener
- ActionProvider.VisibilityListener
- DragStartHelper.OnDragStartListener
- ViewCompat.OnUnhandledKeyEventListenerCompat
- NestedScrollingChild2
- ViewPropertyAnimatorListener
- NestedScrollingParent2
- NestedScrollingParent
- NestedScrollingChild
- TintableBackgroundView
- ScrollingView
Classes
- ViewGroupCompat
- ScaleGestureDetectorCompat
- DisplayCutoutCompat
- NestedScrollingChildHelper
- ViewPropertyAnimatorListenerAdapter
- WindowInsetsCompat
- DragAndDropPermissionsCompat
- MenuItemCompat
- ActionProvider
- DragStartHelper
- ViewCompat
- ViewConfigurationCompat
- NestedScrollingParentHelper
- GravityCompat
- VelocityTrackerCompat
- GestureDetectorCompat
- MotionEventCompat
- InputDeviceCompat
- LayoutInflaterCompat
- ViewParentCompat
- PointerIconCompat
- AccessibilityDelegateCompat
- WindowCompat
- ViewPropertyAnimatorCompat
- MarginLayoutParamsCompat
- MenuCompat