Add to AccessibilityEvent#TYPE_ANNOUNCEMENT with suggestion to avoid using it.
Bug: 244788390 Test: n/a Change-Id: I1a9300fb70e0e9b35dd7f1b07686cad00c2ac9a2
This commit is contained in:
@@ -8457,6 +8457,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* accurately supplying the semantics of their UI.
|
||||
* They should not need to specify what exactly is announced to users.
|
||||
*
|
||||
* <p>
|
||||
* In general, only announce transitions and don’t generate a confirmation message for simple
|
||||
* actions like a button press. Label your controls concisely and precisely instead, and for
|
||||
* significant UI changes like window changes, use
|
||||
* {@link android.app.Activity#setTitle(CharSequence)} and
|
||||
* {@link View#setAccessibilityPaneTitle(CharSequence)}.
|
||||
*
|
||||
* <p>
|
||||
* Use {@link View#setAccessibilityLiveRegion(int)} to inform the user of changes to critical
|
||||
* views within the user interface. These should still be used sparingly as they may generate
|
||||
* announcements every time a View is updated.
|
||||
*
|
||||
* @param text The announcement text.
|
||||
*/
|
||||
public void announceForAccessibility(CharSequence text) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.internal.util.BitUtils;
|
||||
|
||||
@@ -519,6 +520,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
|
||||
|
||||
/**
|
||||
* Represents the event of an application making an announcement.
|
||||
* <p>
|
||||
* In general, follow the practices described in
|
||||
* {@link View#announceForAccessibility(CharSequence)}.
|
||||
*/
|
||||
public static final int TYPE_ANNOUNCEMENT = 0x00004000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user