AccessibilityManager


Interface for managing accessibility.

Summary

Public functions

Long
calculateRecommendedTimeoutMillis(
    originalTimeoutMillis: Long,
    containsIcons: Boolean,
    containsText: Boolean,
    containsControls: Boolean
)

Calculate the recommended timeout for changes to the UI needed by this user.

Cmn

Public functions

calculateRecommendedTimeoutMillis

fun calculateRecommendedTimeoutMillis(
    originalTimeoutMillis: Long,
    containsIcons: Boolean = false,
    containsText: Boolean = false,
    containsControls: Boolean = false
): Long

Calculate the recommended timeout for changes to the UI needed by this user. Controls should remain on the screen for at least this long to give users time to react. Some users may need extra time to review the controls, or to reach them, or to activate assistive technology to activate the controls automatically.

Use the boolean parameters to indicate contents of UI. For example, set [containsIcons] and [containsText] to true for message notification which contains icons and text, or set [containsText] and [containsControls] to true for button dialog which contains text and button controls.

Parameters
originalTimeoutMillis: Long

The timeout appropriate for users with no accessibility needs in milliseconds.

containsIcons: Boolean = false

The contents of UI contain icons.

containsText: Boolean = false

The contents of UI contain text.

containsControls: Boolean = false

The contents of UI contain controls.

Returns
Long

The recommended UI timeout for the current user in milliseconds.