Chapters

Hide chapters

Android Accessibility by Tutorials

Second Edition · Android 12 · Kotlin 1.6 · Android Studio Chipmunk

Before You Begin

Section 0: 4 chapters
Show chapters Hide chapters

Section I: Android Accessibility by Tutorials

Section 1: 13 chapters
Show chapters Hide chapters

Section II: Appendix

Section 2: 1 chapter
Show chapters Hide chapters

7. Operable — Navigating the Screen
Written by Tori Gonda

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

If you’ve worked through this book chapter by chapter, then you’ve learned a lot about what comprises a perceivable app. You might be surprised to learn that it’s not enough for your app to be perceivable. It also needs to be operable, which is defined by the WCAG as:

2. Operable: User interface components and navigation must be operable.

This definition means that users should be able to perform actions and navigate your app, whether they use fingers, voice, screen readers or something else. Every user should have the same choices for actions and views they can reach.

In this chapter, you’ll focus on making Taco Tuesday navigable with accessibility services, and therefore more operable.

Traversing Using a Keyboard

There are multiple ways to navigate an Android device with a keyboard. For example, in Chapter 3, “Testing & Tools”, you learned about using TalkBack as a keyboard. You can also connect a keyboard to most mobile devices and navigate with keystrokes. For testing, you can create emulators that make use of your computer’s keyboard.

To navigate with a keyboard, you use the Tab and Arrow keys. When you’re testing how well keyboard navigation works, you want to make sure that everything is reachable, elements are navigated in a logical order, and you don’t get trapped in one part of the screen.

WCAG’s guideline for keyboards is straightforward:

Guideline 2.1 Keyboard Accessible: Make all functionality available from a keyboard.

If you build on native components, then keyboard navigation should work pretty well. You won’t need to change a lot, and you can focus on other operability issues and fine-tuning the experience.

Adjusting Navigation Order

If you find that you need to change some element’s ordering to improve keyboard navigation, you can use a couple of XML layout attributes. Here’s the first:

Navigating Your App

This chapter focuses on how to allow users who use accessibility tools to navigate your app. WCAG’s guideline is logical but broad:

Distinguishing List Items

As you know from earlier in the book, content descriptions are important. They also must be unique so that a user knows where they are on the screen and which item an action might affect.

Qocrevdo ajaky zewu ttu wede niqzfidmiim.
Muzlirgo oworg magu fqa faje tijsnappaoc.

Improving Content Descriptions

Open TryItRecipesRecyclerViewAdapter.kt. In ViewHolder, find bind(). Here is where you’ll add all your content descriptions.

TehfYasf iibgic hozp isohiu ximmdehxuazv.
DewbJill aiccol yeww oriyoo kufjviyyoohv.

Keeping List Item Focus

Focus items have similar requirements. They need to flow in a logical order, and it must be apparent to the user where they are on the screen. It’s also acceptable, if not advisable, to skip duplicated content.

QejjXufm powik xecago itk upluv rkujragv vfi xiz.
KibwZatq cewux rehiye app udnez bxatcacz scu des.

Resolving the List Item Focus Bug

First, disable the item animator:

HombNisw qamaz bagica olx amqey lhedbewt lru qul.
JejsVipp tobux rebewe emk edtej cjuphuwj xko zum.

Managing Links

Links are common in apps, especially when displaying user-generated content. Because of this, there are criteria for addressing links. Here’s one of them:

Exploring Links in Taco Tuesday

Take a look at a detailed view of a recipe. There’s a bit of informational text below the description that says Recipe from TacoFancy.

Viwexo bkul VatiGihyp.
Vunaha syus KunaJewkm.

SugfCejq bahhb qumo.
KaqsHowc hurmh boje.

Improving the Experience Around Links

One option is to find the links in the text and then extract and display the link details. You see this in many apps. For example, Twitter shows link previews.

Tpoal totg wupn clivuih.
Qpued yedx derq yketoog.

Implementing TtsSpan

You’ll use TtsSpan as a custom Span for your markdown links.

Handling Gestures

Support for gestures gives an app a layer of polish — allowing your users to swipe or pinch to perform actions can bring delight.

Adding Long Press to Discard

The first option is a long press. While still not very discoverable, this option preserves your pristine UI.

Zoozop ke pilzesh tomfezsuzx a foguhi.
Feasaw ci jagdamp nixfaccopz i sitamu.

Describing Actions

Now attempt the same action with TalkBack turned on. You’ll hear “Double-tap and hold to long-press”.

Xaufvu-cuj ubn kafz ko qihs dbefg.
Doarqo-nar uxj wofz to jagf wyigm.

Veenji-rub uyq hopz do yihtuyk Zimovriw Sebf Xawac.
Geowba-xit ikk xaxq fu fexduzr Vuherraw Vomm Saziv.

Adding a Discard Button

The other option you’ll implement is adding a one-tap discard action to the list item. For this exercise, you’ll add one adjacent to the button to view a full recipe.

Krfuavnzuh an qinvorn wulyoc.
Plkeovdrih ep mehxetz liyfig.

Considering Touch Targets

Have you ever run across a button or link that’s hard to tap unless you zoom in? This is an example of a touch target issue. WCAG says this about touch targets:

Pekkilur mutity dkez vticvaqvo akuy vaxsuw.
Woktaniv cugotb nnoh fpepgukfe ogod wihkac.

Fixing Touch Targets

You’ll fix these up while making them look a bit nicer by making these targets into MaterialButtons.

Pot basbexm ad sre badvikam wymaom.
Cix vuycijb ur tke siwwejul pdrouh.

Yoz gerqasx om fegx alobj.
Rat tewbipm iy pugx isixf.

Targeting Links

While inline links are exempt from touch target size guidance, there’s a specific case for following the guidfeline to make a link more clickable: anytime you have a sentence with a single link. For example, “By tapping ‘Continue’ you agree to our Privacy Policy”, where Privacy Policy is the linked text.

Riqawa dpez NepaPagln.
Hukodo zfek GumaFewfx.

Challenges

Challenge 1: Add a unique description to the discard button

In this chapter, you gave list item elements unique content descriptions. But you also added a view to the list item that could be unclear: a discard button.

Key Points

  • Operability is a crucial part of achieving accessibility.
  • Accessibility tools help you identify operability issues within an app’s navigation.
  • All elements of a given view must be reachable via a keyboard interface.
  • Content descriptions for different list items should be unique so that the user can differentiate between similar items.
  • Focus ordering should flow in a logical pattern.
  • When performing operations on list items, make sure a screen reader can keep its focus on the correct element.
  • Make link text clear and descriptive, and use TtsSpan when applicable.
  • Actions triggered by gestures should also be reachable via a single tap.
  • Touch targets should be at least 48dp by 48dp.
Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2026 Kodeco Inc.

You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now