From 96985fccdcff69c8410caee23aa088cbd8af34b6 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Tue, 9 Oct 2012 16:25:54 -0700 Subject: Return true on successful accessiblity action click/long click. 1. If a view is clickable or long clickable perfroming the corresponding accessiblity action should return true no matter whether there is a registered on click/long click listener. Currently true is returned only if there is a listener but it is also possible that a sub-class overrides performClick and does work there. For example CompoundButton. Now if the view is clickable or long clickable we will call the perfrom* method and return true, which is we clicked. 2. Fixed some JavaDoc indentation. bug:7318777 Change-Id: Id603fee378b8f7d07f1128b5641ede57640bab53 --- core/java/android/view/View.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index ae51c1d..0d76eac 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -6858,12 +6858,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Performs the specified accessibility action on the view. For * possible accessibility actions look at {@link AccessibilityNodeInfo}. - *

- * If an {@link AccessibilityDelegate} has been specified via calling - * {@link #setAccessibilityDelegate(AccessibilityDelegate)} its - * {@link AccessibilityDelegate#performAccessibilityAction(View, int, Bundle)} - * is responsible for handling this call. - *

+ *

+ * If an {@link AccessibilityDelegate} has been specified via calling + * {@link #setAccessibilityDelegate(AccessibilityDelegate)} its + * {@link AccessibilityDelegate#performAccessibilityAction(View, int, Bundle)} + * is responsible for handling this call. + *

* * @param action The action to perform. * @param arguments Optional action arguments. @@ -6886,12 +6886,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, switch (action) { case AccessibilityNodeInfo.ACTION_CLICK: { if (isClickable()) { - return performClick(); + performClick(); + return true; } } break; case AccessibilityNodeInfo.ACTION_LONG_CLICK: { if (isLongClickable()) { - return performLongClick(); + performLongClick(); + return true; } } break; case AccessibilityNodeInfo.ACTION_FOCUS: { -- cgit v1.1