Example usage for android.view.accessibility AccessibilityEvent TYPE_VIEW_LONG_CLICKED

List of usage examples for android.view.accessibility AccessibilityEvent TYPE_VIEW_LONG_CLICKED

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityEvent TYPE_VIEW_LONG_CLICKED.

Prototype

int TYPE_VIEW_LONG_CLICKED

To view the source code for android.view.accessibility AccessibilityEvent TYPE_VIEW_LONG_CLICKED.

Click Source Link

Document

Represents the event of long clicking on a android.view.View like android.widget.Button , android.widget.CompoundButton , etc.

Usage

From source file:com.android.utils.AccessibilityEventUtils.java

public static int[] getAllEventTypes() {
    return new int[] { AccessibilityEvent.TYPE_ANNOUNCEMENT, AccessibilityEvent.TYPE_ASSIST_READING_CONTEXT,
            AccessibilityEvent.TYPE_GESTURE_DETECTION_END, AccessibilityEvent.TYPE_GESTURE_DETECTION_START,
            AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED,
            AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END,
            AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START,
            AccessibilityEvent.TYPE_TOUCH_INTERACTION_END, AccessibilityEvent.TYPE_TOUCH_INTERACTION_START,
            AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED,
            AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED, AccessibilityEvent.TYPE_VIEW_CLICKED,
            AccessibilityEvent.TYPE_VIEW_CONTEXT_CLICKED, AccessibilityEvent.TYPE_VIEW_FOCUSED,
            AccessibilityEvent.TYPE_VIEW_HOVER_ENTER, AccessibilityEvent.TYPE_VIEW_HOVER_EXIT,
            AccessibilityEvent.TYPE_VIEW_LONG_CLICKED, AccessibilityEvent.TYPE_VIEW_SCROLLED,
            AccessibilityEvent.TYPE_VIEW_SELECTED, AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED,
            AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED,
            AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
            AccessibilityEvent.TYPE_WINDOWS_CHANGED, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED,
            AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED };
}

From source file:com.hrs.filltheform.dialog.FillTheFormDialog.java

private int getModelEventType(int accessibilityEventType) {
    switch (accessibilityEventType) {
    case AccessibilityEvent.TYPE_VIEW_LONG_CLICKED:
        return FillTheFormDialogModel.EVENT_TYPE_VIEW_LONG_CLICKED;
    case AccessibilityEvent.TYPE_VIEW_CLICKED:
        return FillTheFormDialogModel.EVENT_TYPE_VIEW_CLICKED;
    case AccessibilityEvent.TYPE_VIEW_FOCUSED:
        return FillTheFormDialogModel.EVENT_TYPE_VIEW_FOCUSED;
    default://from  w w  w .j ava  2 s.  c o  m
        return FillTheFormDialogModel.EVENT_TYPE_UNKNOWN;
    }
}

From source file:com.android.screenspeak.eventprocessor.ProcessorPhoneticLetters.java

/**
 * Returns true if a pending phonetic letter should be interrupted.
 *//*from  w ww  .ja  v a 2 s. c  o  m*/
private boolean shouldCancelPhoneticLetter(AccessibilityEvent event) {
    return event.getEventType() != AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
            && event.getEventType() != AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED
            && event.getEventType() != AccessibilityEvent.TYPE_VIEW_LONG_CLICKED
            && event.getEventType() != AccessibilityEvent.TYPE_ANNOUNCEMENT;
}

From source file:com.android.inputmethod.accessibility.KeyboardAccessibilityNodeProvider.java

/**
 * Performs the specified accessibility action for the given key.
 *
 * @param key The on which to perform the action.
 * @param action The action to perform.//from w ww  . ja  v a  2 s.  c  om
 * @return The result of performing the action, or false if the action is not supported.
 */
boolean performActionForKey(final Key key, final int action) {
    switch (action) {
    case AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS:
        mAccessibilityFocusedView = getVirtualViewIdOf(key);
        sendAccessibilityEventForKey(key, AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
        return true;
    case AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS:
        mAccessibilityFocusedView = UNDEFINED;
        sendAccessibilityEventForKey(key, AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
        return true;
    case AccessibilityNodeInfoCompat.ACTION_CLICK:
        sendAccessibilityEventForKey(key, AccessibilityEvent.TYPE_VIEW_CLICKED);
        mDelegate.performClickOn(key);
        return true;
    case AccessibilityNodeInfoCompat.ACTION_LONG_CLICK:
        sendAccessibilityEventForKey(key, AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
        mDelegate.performLongClickOn(key);
        return true;
    default:
        return false;
    }
}

From source file:nz.ac.otago.psyanlab.common.designer.program.stage.StageView.java

/**
 * Send any events and feedback that the long press action has taken place.
 *
 * @param handled True if the long press has taken place.
 * @param view    The view the long press was on.
 * @return Pass through of 'handled' parameter.
 *///w  w  w .  j  ava 2s  .  c  o  m
private boolean doLongPressFeedback(final boolean handled, final View view) {
    if (handled) {
        if (view != null) {
            view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
        }
        performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
    }
    return handled;
}