diff options
| -rw-r--r-- | core/java/android/view/View.java | 34 |
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 { |