How to close compose dialog in accessibility mode?

27 views Asked by At

There is a compose dialog

...
    Dialog(
        properties = DialogProperties(usePlatformDefaultWidth = false),
        onDismissRequest = { eventReceiver.contentEventReceiver.onCellClick?.invoke(null) }
    ) {
        (LocalView.current.parent as DialogWindowProvider).window.apply {
            setDimAmount(0.8f)
            setGravity(Gravity.CENTER_VERTICAL)
        }

        rotator.ContentCellHorizontalRotator(
            selectedContent = selectedItem
        )
    }
...

The question is that this dialog doesn't have an X button where the user can click to close it. It is implied that the user clicks outside the dialog to close it.

However, the issue arises in accessibility mode (for example, for people with visual disabilities). In this case, the screen reader will read everything on the screen, including the available options, but there is no option to close the dialog. In other words, the person who opened the dialog cannot close it.

In iOS, for example, there is an out-of-the-box gesture to close the dialog - swipe with two fingers across the screen in a Z shape, but I couldn't find such a feature on Android.

Does anyone have any ideas about this?

1

There are 1 answers

0
Quintin Balsdon On BEST ANSWER

Did you try a "Backwards L" shape (Single finger down and left - sort of like the return symbol)? That's the default for the back gesture in what I am seeing on my version of TalkBack.

If that doesn't work, these gestures can be found in:

Settings -> Accessibility -> TalkBack -> Settings -> Customise gestures.

I made a screen reader cheatsheet a while back if that helps.

Self-plug:

I also made an Android Studio plugin for using TalkBack a little easier if you like.