Java Code Examples for android.support.v4.view.ViewParentCompat#requestSendAccessibilityEvent()

The following examples show how to use android.support.v4.view.ViewParentCompat#requestSendAccessibilityEvent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExploreByTouchHelper.java    From letv with Apache License 2.0 5 votes vote down vote up
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));
}
 
Example 2
Source File: ExploreByTouchHelper.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 3
Source File: ExploreByTouchHelper.java    From adt-leanback-support with Apache License 2.0 3 votes vote down vote up
/**
 * 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);
}
 
Example 4
Source File: ExploreByTouchHelper.java    From android-recipes-app with Apache License 2.0 3 votes vote down vote up
/**
 * 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);
}
 
Example 5
Source File: ExploreByTouchHelper.java    From V.FlyoutTest with MIT License 3 votes vote down vote up
/**
 * 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);
}
 
Example 6
Source File: ExploreByTouchHelper.java    From guideshow with MIT License 3 votes vote down vote up
/**
 * 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);
}