forked from jverkoey/nimbus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NIAttributedLabel overrides accessibleElements to essentially 'flatte…
…n' an accessibility container layer (link elements) on top of the text. When the links are sorted in-order then VO+VC work ideally as all accessibility elements sit on one layer. We can make sure that each element in this case has a unique touch point, which we make sure is on top of the link so that VO+VC and along with the UIView all direct gestures through the right selector. Yes you heard that right, the elements (NIViewAccessibilityElement) are actually just views but regardless override accessibility APIs directly instead of using a dummy accessibility view, meaning that the behavior of the links outside of VO are tied to the their VO functionailty (ie the activation point or ordering) but that is a whole other can of worms. When links are pre-ordered then an accessibleElement for the whole text is generated and added after all the link elements, meaning that VO+VC recognize all accessibleElements and once again the feature WAI. This ordering is weird since links come before the text which makes for a confusing UE. Links would ideally be post-ordered by since again a VO element is generated in NIAttributedLabel's accessibleElements and this time comes before the links, now we have more issues since VC does not recognize the links (breaking GAR requirements) and also links are no longer tap-able (not a GAR requirement). This change aligns most of the accessibilityActivationPoints by ensuring they are either the center point when not merging multiline links and is the bottom left point otherwise. PiperOrigin-RevId: 565122233
- Loading branch information
1 parent
fd5143a
commit 11237e2
Showing
2 changed files
with
151 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.