Skip to content

Instantly share code, notes, and snippets.

@jwill
Last active August 29, 2015 14:02
Show Gist options
  • Save jwill/6e10a96fb5cfde9dd3a3 to your computer and use it in GitHub Desktop.
Save jwill/6e10a96fb5cfde9dd3a3 to your computer and use it in GitHub Desktop.
t
That looks pretty sweet -- but what about users who can’t see your shiny new control? Accessibility is a key consideration when building apps, and particularly when creating new Views.
You can start by adding a contentDescription[draw] as you would for every other View in your layout.
But what about Views like our wind speed & direction gauge -- where the content isn’t static. Knowing you’re looking at a wind gauge isn’t very useful if we don’t know what what the speed and direction it’s displaying is.
Well within your control, send an accessibility event[draw] whenever the visual content has been modified.
Then override the dispatchPopulateAccessibilityEvent handler [draw] adding the current control’s visual value to the accessibiliy event
Add accessibility handlers to your View -- in XML, and within the View if appropriate, and click here when you’re done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment