android.support.v4.view
Class AccessibilityDelegateCompat

java.lang.Object
  extended by android.support.v4.view.AccessibilityDelegateCompat

public class AccessibilityDelegateCompat
extends Object

Helper for accessing View.AccessibilityDelegate introduced after API level 4 in a backwards compatible fashion.


Constructor Summary
AccessibilityDelegateCompat()
          Creates a new instance.
 
Method Summary
 boolean dispatchPopulateAccessibilityEvent(android.view.View host, android.view.accessibility.AccessibilityEvent event)
          Dispatches an AccessibilityEvent to the host View first and then to its children for adding their text content to the event.
 AccessibilityNodeProviderCompat getAccessibilityNodeProvider(android.view.View host)
          Gets the provider for managing a virtual view hierarchy rooted at this View and reported to AccessibilityServices that explore the window content.
 void onInitializeAccessibilityEvent(android.view.View host, android.view.accessibility.AccessibilityEvent event)
          Initializes an AccessibilityEvent with information about the the host View which is the event source.
 void onInitializeAccessibilityNodeInfo(android.view.View host, AccessibilityNodeInfoCompat info)
          Initializes an AccessibilityNodeInfoCompat with information about the host view.
 void onPopulateAccessibilityEvent(android.view.View host, android.view.accessibility.AccessibilityEvent event)
          Gives a chance to the host View to populate the accessibility event with its text content.
 boolean onRequestSendAccessibilityEvent(android.view.ViewGroup host, android.view.View child, android.view.accessibility.AccessibilityEvent event)
          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.
 boolean performAccessibilityAction(android.view.View host, int action, android.os.Bundle args)
          Performs the specified accessibility action on the view.
 void sendAccessibilityEvent(android.view.View host, int eventType)
          Sends an accessibility event of the given type.
 void sendAccessibilityEventUnchecked(android.view.View host, android.view.accessibility.AccessibilityEvent event)
          Sends an accessibility event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessibilityDelegateCompat

public AccessibilityDelegateCompat()
Creates a new instance.

Method Detail

sendAccessibilityEvent

public void sendAccessibilityEvent(android.view.View host,
                                   int eventType)
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 - The View hosting the delegate.
eventType - The type of the event to send.
See Also:
View#sendAccessibilityEvent(int)

sendAccessibilityEventUnchecked

public void sendAccessibilityEventUnchecked(android.view.View host,
                                            android.view.accessibility.AccessibilityEvent event)
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 - The View hosting the delegate.
event - The event to send.
See Also:
View#sendAccessibilityEventUnchecked(AccessibilityEvent)

dispatchPopulateAccessibilityEvent

public boolean dispatchPopulateAccessibilityEvent(android.view.View host,
                                                  android.view.accessibility.AccessibilityEvent event)
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 - The View hosting the delegate.
event - The event.
Returns:
True if the event population was completed.
See Also:
View#dispatchPopulateAccessibilityEvent(AccessibilityEvent)

onPopulateAccessibilityEvent

public void onPopulateAccessibilityEvent(android.view.View host,
                                         android.view.accessibility.AccessibilityEvent event)
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 - The View hosting the delegate.
event - The accessibility event which to populate.
See Also:
ViewCompat#onPopulateAccessibilityEvent(View, AccessibilityEvent)

onInitializeAccessibilityEvent

public void onInitializeAccessibilityEvent(android.view.View host,
                                           android.view.accessibility.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 - The View hosting the delegate.
event - The event to initialize.
See Also:
ViewCompat#onInitializeAccessibilityEvent(View, AccessibilityEvent)

onInitializeAccessibilityNodeInfo

public void onInitializeAccessibilityNodeInfo(android.view.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 - The View hosting the delegate.
info - The instance to initialize.
See Also:
ViewCompat#onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfoCompat)

onRequestSendAccessibilityEvent

public boolean onRequestSendAccessibilityEvent(android.view.ViewGroup host,
                                               android.view.View child,
                                               android.view.accessibility.AccessibilityEvent event)
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 - The View hosting the delegate.
child - The child which requests sending the event.
event - The event to be sent.
Returns:
True if the event should be sent
See Also:
ViewGroupCompat#onRequestSendAccessibilityEvent(ViewGroup, View, AccessibilityEvent)

getAccessibilityNodeProvider

public AccessibilityNodeProviderCompat getAccessibilityNodeProvider(android.view.View host)
Gets the provider for managing a virtual view hierarchy rooted at this View and reported to AccessibilityServices that explore the window content.

The default implementation behaves as ViewCompat#getAccessibilityNodeProvider(View) for the case of no accessibility delegate been set.

Returns:
The provider.
See Also:
AccessibilityNodeProviderCompat

performAccessibilityAction

public boolean performAccessibilityAction(android.view.View host,
                                          int action,
                                          android.os.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:
action - The action to perform.
Returns:
Whether the action was performed.
See Also:
View#performAccessibilityAction(int, Bundle)


Copyright © 2013 Marek Kedzierski. All Rights Reserved.