Hi guys :slightly_smiling_face: Is there a way in ...
# compose
j
Hi guys 🙂 Is there a way in compose to have different behaviors on a button click, whether TalkBack is enabled or not? I have tried
semantic { customActions }
but it’s not quite what I want. The user needs to tap with 3 fingers and that brings up a list of custom actions. I could do:
Copy code
onClick = {
    if (screenReaderOn) {
        // Do visually impaired specific action
    } else {
        // Do regular action
    }
}
But it seems wrong 😅 I know our iOS team has access to
accessibilityAction
in SwiftUI, is there anything equivalent for us? Thanks! 🙏
e
https://developer.android.com/reference/android/view/accessibility/AccessibilityManager but changing behavior based on it is a bad idea. TalkBack is not the only accessibility tool.
j
yeah, not quite what I’m looking for anyway 😕 i was more interested in a “pure compose” solution