android.support.v4.view.ViewCompat#performAccessibilityAction ( )源码实例Demo

下面列出了android.support.v4.view.ViewCompat#performAccessibilityAction ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: DateTimepicker   文件: TouchExplorationHelper.java
@Override
public boolean performAction(int virtualViewId, int action, Bundle arguments) {
    if (virtualViewId == View.NO_ID) {
        return ViewCompat.performAccessibilityAction(mParentView, action, arguments);
    }

    final T item = getItemForId(virtualViewId);
    if (item == null) {
        return false;
    }

    boolean handled = false;

    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS:
            if (mFocusedItemId != virtualViewId) {
                mFocusedItemId = virtualViewId;
                sendEventForItem(item, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
                handled = true;
            }
            break;
        case AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS:
            if (mFocusedItemId == virtualViewId) {
                mFocusedItemId = INVALID_ID;
                sendEventForItem(item, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
                handled = true;
            }
            break;
    }

    handled |= performActionForItem(item, action, arguments);

    return handled;
}
 
源代码2 项目: letv   文件: ExploreByTouchHelper.java
private boolean performActionForHost(int action, Bundle arguments) {
    return ViewCompat.performAccessibilityAction(this.mView, action, arguments);
}
 
源代码3 项目: brailleback   文件: ExploreByTouchHelper.java
@Override
public boolean performAction(int virtualViewId, int action, Bundle arguments) {
    boolean handled = false;

    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS:
            // Only handle the FOCUS action if it's placing focus on
            // a different view that was previously focused.
            if (mFocusedVirtualViewId != virtualViewId) {
                mFocusedVirtualViewId = virtualViewId;
                mHost.invalidate();
                sendEventForVirtualViewId(virtualViewId,
                        AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
                handled = true;
            }
            break;
        case AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS:
            if (mFocusedVirtualViewId == virtualViewId) {
                mFocusedVirtualViewId = INVALID_ID;
            }
            // Since we're managing focus at the parent level, we are
            // likely to receive a FOCUS action before a CLEAR_FOCUS
            // action. We'll give the benefit of the doubt to the
            // framework and always handle FOCUS_CLEARED.
            mHost.invalidate();
            sendEventForVirtualViewId(virtualViewId,
                    AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
            handled = true;
            break;
        default:
            // Let the node provider handle focus for the root node, but
            // the root node should handle everything else by itself.
            if (virtualViewId == View.NO_ID) {
                return ViewCompat.performAccessibilityAction(mHost, action, arguments);
            }
    }

    // Since the client implementation may want to do something special
    // when a FOCUS event occurs, let them handle all events.
    handled |= performActionForVirtualViewId(virtualViewId, action, arguments);

    return handled;
}
 
源代码4 项目: MiBandDecompiled   文件: ExploreByTouchHelper.java
private boolean a(int l, Bundle bundle)
{
    return ViewCompat.performAccessibilityAction(h, l, bundle);
}
 
private boolean performActionForHost(int action, Bundle arguments) {
    return ViewCompat.performAccessibilityAction(mView, action, arguments);
}
 
private boolean performActionForHost(int action, Bundle arguments) {
    return ViewCompat.performAccessibilityAction(mView, action, arguments);
}
 
源代码7 项目: V.FlyoutTest   文件: ExploreByTouchHelper.java
private boolean performActionForHost(int action, Bundle arguments) {
    return ViewCompat.performAccessibilityAction(mView, action, arguments);
}
 
源代码8 项目: guideshow   文件: ExploreByTouchHelper.java
private boolean performActionForHost(int action, Bundle arguments) {
    return ViewCompat.performAccessibilityAction(mView, action, arguments);
}
 
 同类方法