下面列出了android.support.v4.view.ViewParentCompat#requestSendAccessibilityEvent ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public boolean sendEventForVirtualView(int virtualViewId, int eventType) {
if (virtualViewId == Integer.MIN_VALUE || !this.mManager.isEnabled()) {
return false;
}
ViewParent parent = this.mView.getParent();
if (parent == null) {
return false;
}
return ViewParentCompat.requestSendAccessibilityEvent(parent, this.mView, createEvent(virtualViewId, eventType));
}
public boolean sendEventForVirtualView(int l, int i1)
{
android.view.ViewParent viewparent;
if (l != 0x80000000 && g.isEnabled())
{
if ((viewparent = h.getParent()) != null)
{
AccessibilityEvent accessibilityevent = a(l, i1);
return ViewParentCompat.requestSendAccessibilityEvent(viewparent, h, accessibilityevent);
}
}
return false;
}
/**
* Populates an event of the specified type with information about an item
* and attempts to send it up through the view hierarchy.
* <p>
* You should call this method after performing a user action that normally
* fires an accessibility event, such as clicking on an item.
*
* <pre>public void performItemClick(T item) {
* ...
* sendEventForVirtualViewId(item.id, AccessibilityEvent.TYPE_VIEW_CLICKED);
* }
* </pre>
*
* @param virtualViewId The virtual view id for which to send an event.
* @param eventType The type of event to send.
* @return true if the event was sent successfully.
*/
public boolean sendEventForVirtualView(int virtualViewId, int eventType) {
if ((virtualViewId == INVALID_ID) || !mManager.isEnabled()) {
return false;
}
final ViewParent parent = mView.getParent();
if (parent == null) {
return false;
}
final AccessibilityEvent event = createEvent(virtualViewId, eventType);
return ViewParentCompat.requestSendAccessibilityEvent(parent, mView, event);
}
/**
* Populates an event of the specified type with information about an item
* and attempts to send it up through the view hierarchy.
* <p>
* You should call this method after performing a user action that normally
* fires an accessibility event, such as clicking on an item.
*
* <pre>public void performItemClick(T item) {
* ...
* sendEventForVirtualViewId(item.id, AccessibilityEvent.TYPE_VIEW_CLICKED);
* }
* </pre>
*
* @param virtualViewId The virtual view id for which to send an event.
* @param eventType The type of event to send.
* @return true if the event was sent successfully.
*/
public boolean sendEventForVirtualView(int virtualViewId, int eventType) {
if ((virtualViewId == INVALID_ID) || !mManager.isEnabled()) {
return false;
}
final ViewParent parent = mView.getParent();
if (parent == null) {
return false;
}
final AccessibilityEvent event = createEvent(virtualViewId, eventType);
return ViewParentCompat.requestSendAccessibilityEvent(parent, mView, event);
}
/**
* Populates an event of the specified type with information about an item
* and attempts to send it up through the view hierarchy.
* <p>
* You should call this method after performing a user action that normally
* fires an accessibility event, such as clicking on an item.
*
* <pre>public void performItemClick(T item) {
* ...
* sendEventForVirtualViewId(item.id, AccessibilityEvent.TYPE_VIEW_CLICKED);
* }
* </pre>
*
* @param virtualViewId The virtual view id for which to send an event.
* @param eventType The type of event to send.
* @return true if the event was sent successfully.
*/
public boolean sendEventForVirtualView(int virtualViewId, int eventType) {
if ((virtualViewId == INVALID_ID) || !mManager.isEnabled()) {
return false;
}
final ViewParent parent = mView.getParent();
if (parent == null) {
return false;
}
final AccessibilityEvent event = createEvent(virtualViewId, eventType);
return ViewParentCompat.requestSendAccessibilityEvent(parent, mView, event);
}
/**
* Populates an event of the specified type with information about an item
* and attempts to send it up through the view hierarchy.
* <p>
* You should call this method after performing a user action that normally
* fires an accessibility event, such as clicking on an item.
*
* <pre>public void performItemClick(T item) {
* ...
* sendEventForVirtualViewId(item.id, AccessibilityEvent.TYPE_VIEW_CLICKED);
* }
* </pre>
*
* @param virtualViewId The virtual view id for which to send an event.
* @param eventType The type of event to send.
* @return true if the event was sent successfully.
*/
public boolean sendEventForVirtualView(int virtualViewId, int eventType) {
if ((virtualViewId == INVALID_ID) || !mManager.isEnabled()) {
return false;
}
final ViewParent parent = mView.getParent();
if (parent == null) {
return false;
}
final AccessibilityEvent event = createEvent(virtualViewId, eventType);
return ViewParentCompat.requestSendAccessibilityEvent(parent, mView, event);
}