Everyone, including people with disabilities, should have adequate time to interact with your app. People with disabilities may require more time to interact with your app. If certain functions are time-dependent, it will be difficult for some users to finish in time. If content is shown for a limited time, users might not finish reading in time. It should be possible for users to increase time limits, or ideally, disable all time limits.
Relates to 2.2.1
On Android, a Toast
is often used display temporary messages. The display duration might be too short for people to read or hear the message.
We recommend displaying messages by using an AlertDialog
or Snackbar
with the duration set to LENGTH_INDEFINITE
. Don't forget to add a close button.
Also check whether Executors
, Handler
or Timer
are used somewhere. If there are any time limits, make sure they can be extended.
val snackbar = Snackbar
.make(view, "Appt", Snackbar.LENGTH_INDEFINITE)
.setAction("Close") {
// Close
}
snackbar.show()
On iOS, third-party code libraries are sometimes used to display a temporary message, also known as a Toast
. The display duration might be too short for people to read or hear the message.
We recommend showing messages by using an UIAlertController
. Don't forget to add a close button.
Also check whether DispatchQueue
is used somewhere. If there are time limits, make sure they can be extended.
let alert = UIAlertController(
title: nil,
message: "Appt",
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: "Close", style: .default, handler: { action in
// Close
}))
present(alert, animated: true)
In Flutter, a SnackBar
is often used display temporary messages. The display duration might be too short for people to read or hear the message.
We recommend displaying messages by using an AlertDialog
. Or, when using a Snackbar
, you can set the duration to "infinite
". Don't forget to add a close button for both options.
Also make sure that the use of time limits, e.g. by using Future.delayed()
, can be extended.
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
duration: const Duration(days: 1),
content: Text('Appt'),
action: SnackBarAction(
label: 'Close',
onPressed: () {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
},
),
));
In React Native, the react-native-root-toast
is often used to display temporary messages. The display duration might be too short for people to read or hear the message.
We recommend use the SnackBar
in react-native-paper
instead. Set the duration
to Number.MAX_SAFE_INTEGER
to keep it visible. Don't forget to add a close button.
Also make sure that the use of time limits, e.g. by using setTimeout
, can be extended.
import { Button, Snackbar } from 'react-native-paper';
<Snackbar
visible={visible}
onDismiss={onDismissSnackBar}
duration={Number.MAX_SAFE_INTEGER}
action={{
label: 'Close',
onPress: () => {
// Close
},
}}>
Appt
</Snackbar>
In Xamarin, the SnackBar
view from the Xamarin.CommunityToolkit
is often used to display temporary messages. The display duration might be too short for people to read or hear the message.
When using SnackBar
, set the Duration
to Int32.MaxValue
. Or, use DisplayAlert
method to show an alert instead.
Also make sure that the use of time limits, e.g. by using Timer
, can be extended.
var result = await page.DisplaySnackBarAsync("Appt", "Close", async () =>
{ /* Action */ },
Int32.MaxValue
);