summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alan Viverette <alanv@google.com> 2015-10-01 01:08:53 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-10-01 01:08:53 +0000
commit4d4b9fd78f2256aed1e0c0e0e2d50e63f7f32b0a (patch)
tree39a09df03e83c552de83ef01d493eb3dc2b4aa59
parent2e76dca29d8b9d51bdd8b217189407de641cdd30 (diff)
parentc687c194181308b01f9b5d343eb40e419145b07e (diff)
Merge "Document API-level-specific delegate behavior"
-rw-r--r--core/java/android/view/View.java34
1 files changed, 29 insertions, 5 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 263ec7d18f08..2c7a43648f2c 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -6649,12 +6649,24 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
- * Sets a delegate for implementing accessibility support via composition as
- * opposed to inheritance. The delegate's primary use is for implementing
- * backwards compatible widgets. For more details see {@link AccessibilityDelegate}.
- *
- * @param delegate The delegate instance.
+ * Sets a delegate for implementing accessibility support via composition
+ * (as opposed to inheritance). For more details, see
+ * {@link AccessibilityDelegate}.
+ * <p>
+ * <strong>Note:</strong> On platform versions prior to
+ * {@link android.os.Build.VERSION_CODES#M API 23}, delegate methods on
+ * views in the {@code android.widget.*} package are called <i>before</i>
+ * host methods. This prevents certain properties such as class name from
+ * being modified by overriding
+ * {@link AccessibilityDelegate#onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfo)},
+ * as any changes will be overwritten by the host class.
+ * <p>
+ * Starting in {@link android.os.Build.VERSION_CODES#M API 23}, delegate
+ * methods are called <i>after</i> host methods, which all properties to be
+ * modified without being overwritten by the host class.
*
+ * @param delegate the object to which accessibility method calls should be
+ * delegated
* @see AccessibilityDelegate
*/
public void setAccessibilityDelegate(@Nullable AccessibilityDelegate delegate) {
@@ -22277,6 +22289,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* corresponding delegate method without altering the behavior of the rest
* accessibility related methods of the host view.
* </p>
+ * <p>
+ * <strong>Note:</strong> On platform versions prior to
+ * {@link android.os.Build.VERSION_CODES#M API 23}, delegate methods on
+ * views in the {@code android.widget.*} package are called <i>before</i>
+ * host methods. This prevents certain properties such as class name from
+ * being modified by overriding
+ * {@link AccessibilityDelegate#onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfo)},
+ * as any changes will be overwritten by the host class.
+ * <p>
+ * Starting in {@link android.os.Build.VERSION_CODES#M API 23}, delegate
+ * methods are called <i>after</i> host methods, which all properties to be
+ * modified without being overwritten by the host class.
*/
public static class AccessibilityDelegate {