summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sally <sallyyuen@google.com> 2024-04-02 18:01:18 +0000
committer Sally Yuen <sallyyuen@google.com> 2024-04-02 19:16:05 +0000
commit5e11e0205bf72d0a5b177d6e578e3ed61993b09a (patch)
tree12801d997d73d6fd6777e10c7201129841378372
parent976207c49e9573d03badfe0057862fd2dcb051e6 (diff)
Add docs in ProgressBar to suggest a11y min durations
setMinDurationBetweenContentChanges was introduced in Android 34. ProgressBars, which frequently emit state changes due to its incrementing state, are examples of where this API can be used to prevent disruptive notifications. Bug: 332393061 Test: na (docs) Change-Id: Ia1b22137d3078211d23d56872af36ad20d0ce19d
-rw-r--r--core/java/android/widget/ProgressBar.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index 356d059ba5dc..6e43d0f1c6cd 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -69,6 +69,7 @@ import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
import java.text.NumberFormat;
+import java.time.Duration;
import java.util.ArrayList;
import java.util.Locale;
@@ -139,6 +140,14 @@ import java.util.Locale;
* <p>The "inverse" styles provide an inverse color scheme for the spinner, which may be necessary
* if your application uses a light colored theme (a white background).</p>
*
+ * <h4>Accessibility</h4>
+ * <p>
+ * Consider using
+ * {@link AccessibilityNodeInfo#setMinDurationBetweenContentChanges(Duration)} to
+ * convey to accessibility services that changes can be throttled. This may reduce the
+ * frequency of potentially disruptive notifications.
+ * </p>
+ *
* <p><strong>XML attributes</b></strong>
* <p>
* See {@link android.R.styleable#ProgressBar ProgressBar Attributes},