Java 类android.support.v4.view.ViewParentCompat 实例源码

项目:android-numberpickercompat    文件:AccessibilityNodeProviderImpl.java   
private void sendAccessibilityEventForVirtualText(int eventType) {
    AccessibilityManager accessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
        AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
        ViewCompat.onInitializeAccessibilityEvent(getInputText(), event);
        ViewCompat.onPopulateAccessibilityEvent(getInputText(), event);
        record.setSource(mNumberPicker, VIRTUAL_VIEW_ID_INPUT);

        ViewParentCompat.requestSendAccessibilityEvent(mNumberPicker, mNumberPicker, event);
    }
}
项目:android-numberpickercompat    文件:AccessibilityNodeProviderImpl.java   
private void sendAccessibilityEventForVirtualButton(int virtualViewId, int eventType,
                                                    String text) {
    AccessibilityManager accessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
        AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
        event.setPackageName(getContext().getPackageName());
        record.setClassName(Button.class.getName());
        record.getText().add(text);
        record.setEnabled(isEnabled());
        record.setSource(mNumberPicker, virtualViewId);

        ViewParentCompat.requestSendAccessibilityEvent(mNumberPicker, mNumberPicker, event);
    }
}
项目:letv    文件:ExploreByTouchHelper.java   
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));
}
项目:boohee_v5.6    文件:ExploreByTouchHelper.java   
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));
}
项目:MiBandDecompiled    文件:ExploreByTouchHelper.java   
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;
}
项目:MyCTFWriteUps    文件:ExploreByTouchHelper.java   
public boolean sendEventForVirtualView(int i, int j)
{
    android.view.ViewParent viewparent;
    if (i != 0x80000000 && mManager.isEnabled())
    {
        if ((viewparent = mView.getParent()) != null)
        {
            AccessibilityEvent accessibilityevent = createEvent(i, j);
            return ViewParentCompat.requestSendAccessibilityEvent(viewparent, mView, accessibilityevent);
        }
    }
    return false;
}
项目:ShoppingMall    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:adt-leanback-support    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:generator-android    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:informant-droid    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:android-recipes-app    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:bitcast    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:V.FlyoutTest    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:guideshow    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:IntranetEpitechV2    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:MoSeS--Client-    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:android.support.v4    文件:ExploreByTouchHelper.java   
/**
 * 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);
}
项目:DateTimePickerCompat    文件:TouchExplorationHelper.java   
/**
 * Populates an event of the specified type with information about an item
 * and attempts to send it up through the view hierarchy.
 * 
 * @param item
 *            The item for which to send an event.
 * @param eventType
 *            The type of event to send.
 * @return {@code true} if the event was sent successfully.
 */
public boolean sendEventForItem(T item, int eventType) {
    if (!mManager.isEnabled()) {
        return false;
    }

    final AccessibilityEvent event = getEventForItem(item, eventType);
    final ViewGroup group = (ViewGroup) mParentView.getParent();
    return ViewParentCompat.requestSendAccessibilityEvent(group, mParentView, event);
}