diff --git a/core/java/android/view/accessibility/AccessibilityEvent.java b/core/java/android/view/accessibility/AccessibilityEvent.java index cd0dd1df12496..662550b296f90 100644 --- a/core/java/android/view/accessibility/AccessibilityEvent.java +++ b/core/java/android/view/accessibility/AccessibilityEvent.java @@ -440,12 +440,16 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par /** * Represents the event of clicking on a {@link android.view.View} like * {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. + *

See {@link AccessibilityNodeInfo.AccessibilityAction#ACTION_CLICK} for more + * details. */ public static final int TYPE_VIEW_CLICKED = 0x00000001; /** * Represents the event of long clicking on a {@link android.view.View} like * {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. + *

See {@link AccessibilityNodeInfo.AccessibilityAction#ACTION_LONG_CLICK} for more + * details. */ public static final int TYPE_VIEW_LONG_CLICKED = 0x00000002; @@ -563,6 +567,8 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par /** * Represents the event of a context click on a {@link android.view.View}. + *

See {@link AccessibilityNodeInfo.AccessibilityAction#ACTION_CONTEXT_CLICK} for more + * details. */ public static final int TYPE_VIEW_CONTEXT_CLICKED = 0x00800000; diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java index a20b2b2f79a46..0d4977211d11f 100644 --- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java +++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java @@ -251,7 +251,7 @@ public class AccessibilityNodeInfo implements Parcelable { /** * Action that clicks on the node info. * - * See {@link AccessibilityAction#ACTION_CLICK} + * @see AccessibilityAction#ACTION_CLICK */ public static final int ACTION_CLICK = 0x00000010; @@ -259,6 +259,7 @@ public class AccessibilityNodeInfo implements Parcelable { * Action that long clicks on the node. * *

It does not support coordinate information for anchoring.

+ * @see AccessibilityAction#ACTION_LONG_CLICK */ public static final int ACTION_LONG_CLICK = 0x00000020; @@ -4679,7 +4680,7 @@ public class AccessibilityNodeInfo implements Parcelable { * and handled by custom widgets. i.e. ones that are not part of the UI toolkit. For * example, an application may define a custom action for clearing the user history. * - *
  • Overriden standard actions - These are actions that override + *
  • Overridden standard actions - These are actions that override * standard actions to customize them. For example, an app may add a label to the * standard {@link #ACTION_CLICK} action to indicate to the user that this action clears * browsing history. @@ -4729,12 +4730,29 @@ public class AccessibilityNodeInfo implements Parcelable { /** * Action that clicks on the node info. + * + *

    The UI element that implements this should send a + * {@link AccessibilityEvent#TYPE_VIEW_CLICKED} event. In the View system, + * the default handling of this action when performed by a service is to call + * {@link View#performClick()}, and setting a + * {@link View#setOnClickListener(View.OnClickListener)} automatically adds this action. + * + *

    {@link #isClickable()} should return true if this action is available. */ public static final AccessibilityAction ACTION_CLICK = new AccessibilityAction(AccessibilityNodeInfo.ACTION_CLICK); /** * Action that long clicks on the node. + * + *

    The UI element that implements this should send a + * {@link AccessibilityEvent#TYPE_VIEW_LONG_CLICKED} event. In the View system, + * the default handling of this action when performed by a service is to call + * {@link View#performLongClick()}, and setting a + * {@link View#setOnLongClickListener(View.OnLongClickListener)} automatically adds this + * action. + * + *

    {@link #isLongClickable()} should return true if this action is available. */ public static final AccessibilityAction ACTION_LONG_CLICK = new AccessibilityAction(AccessibilityNodeInfo.ACTION_LONG_CLICK); @@ -5047,6 +5065,18 @@ public class AccessibilityNodeInfo implements Parcelable { /** * Action that context clicks the node. + * + *

    The UI element that implements this should send a + * {@link AccessibilityEvent#TYPE_VIEW_CONTEXT_CLICKED} event. In the View system, + * the default handling of this action when performed by a service is to call + * {@link View#performContextClick()}, and setting a + * {@link View#setOnContextClickListener(View.OnContextClickListener)} automatically adds + * this action. + * + *

    A context click usually occurs from a mouse pointer right-click or a stylus button + * press. + * + *

    {@link #isContextClickable()} should return true if this action is available. */ public static final AccessibilityAction ACTION_CONTEXT_CLICK = new AccessibilityAction(R.id.accessibilityActionContextClick);