Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a2b357e authored by Sally Yuen's avatar Sally Yuen Committed by Android (Google) Code Review
Browse files

Merge "Add documentation about errors for announceForAccessibility." into main

parents a8998599 48b29458
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -8562,6 +8562,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * announcements every time a View is updated.
     *
     * <p>
     * For notifying users about errors, such as in a login screen with text that displays an
     * "incorrect password" notification, that view should send an AccessibilityEvent of type
     * {@link AccessibilityEvent#CONTENT_CHANGE_TYPE_ERROR} and set
     * {@link AccessibilityNodeInfo#setError(CharSequence)} instead. Custom widgets should expose
     * error-setting methods that support accessibility automatically. For example, instead of
     * explicitly sending this event when using a TextView, use
     * {@link android.widget.TextView#setError(CharSequence)}.
     *
     * <p>
     * Use {@link #setStateDescription(CharSequence)} to convey state changes to views within the
     * user interface. While a live region may send different types of events generated by the view,
     * state description will send {@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED} events of