Skip to content

Add support for Touch Exploration#646

Merged
khaykov merged 6 commits intodevelopfrom
feature/awesome-accessibility-editor
Mar 30, 2018
Merged

Add support for Touch Exploration#646
khaykov merged 6 commits intodevelopfrom
feature/awesome-accessibility-editor

Conversation

@malinajirka
Copy link
Copy Markdown
Contributor

Adds support for Touch Exploration to the AztecText and SourceViewEditText.

Test

  1. Enable TalkBack
  2. Open the AztecApp
  3. Hover over lines - each line should be read by talkback.
  4. The cursor should be moved to the last position of your finger when you move up you finger.
  5. Make sure that the TalkBack context menu contains "Cursor control/Editing" menu item(naming depends on the SDK version).

Issues

  1. When we want to move the cursor to the new position, we need to remove the cursor first, otherwise the TalkBack reads the text between old and new cursor position.
    The issues is that on SDK 27, TalkBack announces "selection cleared" when the ".removeSelection(...)" method is invoked.

  2. It reads raw text ignoring spans. I wanted to add support for spans, but I run out of time. Some spans (eg. Comment, More, PageBreak) are in different modules, so I'm not even sure it's doable.

Note: The app sometimes crashed when I changed TalkBack navigation granularity (characters, words, lines, default etc..). So I added if check into the getAppliedStyles(..) method, but tbh I'm not sure if it doesn't break something else. I've tested it and it seemed ok.... I just wanted to point it out.
Steps to reproduce (before the fix)

  1. Enable TalkBack
  2. Keep swiping right, after the editor view is focused (focused with talkback)
  3. Swipe down to change TalkBack navigation granularity
  4. Boom

@malinajirka malinajirka requested a review from khaykov March 29, 2018 14:57
}

private fun updateContentDescription(parentForAccessibility: View, lineOffset: Int) {
// we can't use announceForAccessibility(..) as the announcement doesn't get interrupted as we move to another element
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this will change anything, but accessibilityManager has interrupt() method :)

@malinajirka
Copy link
Copy Markdown
Contributor Author

Not sure if this will change anything, but accessibilityManager has interrupt() method :)

Thanks @khaykov, I wasn't aware of the interrupt() method.

I've replaced the View.setContentDescription() call with AccessibilityManager.interrupt() followed by View.announceForAccessibility(). I was a bit worried that the interrupt() method would interrupt announcements from other applications - new email notifications etc. But as it turned out announcements from other applications are getting interrupted whenever the AccessibilityFocus is changed. So we are ok, I guess.

Copy link
Copy Markdown
Contributor

@khaykov khaykov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixes! Amazing improvement over what we had before, and a step in right direction. I believe there are still things that we can do, but It should probably be a separate project, with input from designers and accessibility experts. 👍

@khaykov khaykov merged commit 840ed9c into develop Mar 30, 2018
@khaykov khaykov deleted the feature/awesome-accessibility-editor branch March 30, 2018 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants