Skip to content

aduggin/android-accessibility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Android Accessibility

Notes

  • Explore by touch was added in Android 4.0

Techniques

Adding an accessibility label to an element

To add some text for an image, button or view set the android:contentDescription to the relevant view in your layout xml file

android:contentDescription="@string/logo_alt"

There is also a method for doing this

public void setContentDescription (CharSequence contentDescription)

If you have some furniture which doesn't require some text use @null so you don't get an error in link

android:contentDescription="@null"

Making a view focusable

If a view is not focusable by default you can make it focusable from the XML layout file by setting the android:focusable attribute to "true"

android:focusable="true"

There are also a methods for doing this

setFocusable(boolean)
setFocusableInTouchMode(boolean)

Controlling focus order

You can provide explicit overrides to the ordering using the following XML attributes in the layout file

  • android:nextFocusDown - Defines the next view to receive focus when the user navigates down.
  • android:nextFocusLeft - Defines the next view to receive focus when the user navigates left.
  • android:nextFocusRight - Defines the next view to receive focus when the user navigates right.
  • android:nextFocusUp - Defines the next view to receive focus when the user navigates up.

For more detail see: Controlling focus order

Speak information to a user

announceForAccessibility(CharSequence)

h2. How do you do these?

  1. Set a trait such as selected
  2. Move focus to an element
  3. Group content description on a container
  4. Use a list so that a user knows how many items there are
  5. How to navigate an application using directional control - e.g the D-pad

Resources

Google Documentation

Forums

Articles

Blogs

Presentations / Slides

Videos

Misc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published