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

11. Designing for Neurodiversity
Written by Victoria 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

Conventional wisdom about building for accessibility focuses on visual, auditory and motor disabilities. But another important consideration is neurodiversity.

Neurodiversity, for the sake of this discussion, is the natural variance between people’s neurological structure and function. Brains are remarkably complex, so each human experiences and interacts with the world in wildly different ways.

When you design an app, it’s just as important to consider users with lesser-known syndromes, such as Williams Syndrome (a developmental disorder that can interfere with visual and spatial reasoning), as it is to consider those who live with anxiety. Being inclusive of these users creates a better experience, which increases their happiness and loyalty to your product. Inclusive design also gives all of your users a better experience.

This chapter can’t cover every experience out there — each person is unique. However, it will give you tips to make your app more usable and enjoyable for all, including those who live with autism, dyslexia, anxiety and ADHD.

Some of the things you’ll learn to do in this chapter include:

  • Reduce time stress

  • Communicate with clarity

  • Provide help

  • Be consistent

  • Watch phrasing

  • Give alternatives

  • Add configurability

Many of the solutions in this chapter will positively affect your Taco Tuesday experience, even if you don’t identify as neurodiverse.

You’ll continue improving Taco Tuesday, so open the project you’ve been working on or the starter project for this chapter. With that done, move on to the first topic: Reducing time stress.

Reducing Time Stress

Imagine you’re filling out a form on your phone. Now, quick! Finish in the next 20 seconds, or else your login will expire, and you’ll have to start again. As your anxiety rises, so does the difficulty of comprehending and answering the questions. Ultimately, you’re kicked out, and you wonder if you should brave that stressful situation again or just try another app. You’ll probably find another app.

Arbitrary or unavoidable time limits make apps unusable for some people with motor or vision disabilities. They can also induce anxiety responses. Some people need more time to read than you might think, and time limits interfere with their ability to comprehend and act.

WCAG wants you to avoid imposing arbitrary time limits. When you do need time limits, allow the user to extend the time whenever possible. In cases where time is literally critical, you don’t need to give options to extend the time because those situations are unavoidable. Examples include a time-based game or when there’s a physical inventory that is being quickly depleted.

When you implement timed tasks in your app, be critical and find ways to improve the experience by giving people more time or other options.

Introducing Time Configurability

In Chapter 8, “Operable — Movement & Timing”, you worked with the auto-advance timer on the recipe cards in Taco Tuesday. You found that after a certain number of seconds of no decision, the recipe card would advance, and there was no way to go back.

<!-- 1 -->
<string name="preference_seconds_title">Seconds for auto advance</string>
<!-- 2 -->
<string-array name="time_options">
 <item>10</item>
 <item>15</item>
 <item>20</item>
 <item>30</item>
 <item>50</item>
</string-array>
<ListPreference
 android:defaultValue="15"
 android:entries="@array/time_options"
 android:entryValues="@array/time_options"
 android:key="time_length"
 android:title="@string/preference_seconds_title" />
val seconds = sharedPreferences.getString("time_length", "15")
  ?.toIntOrNull() ?: 15
delay(seconds * 1000L)
if (sharedPreferences.getBoolean("auto_advance", false)) {
 val seconds = sharedPreferences.getString("time_length", "15")
   ?.toIntOrNull() ?: 15
 fetchTacoTimer = viewModelScope.launch(Dispatchers.IO) {
  delay(seconds * 1000L)
  fetchRandomTaco()
 }
}
Setting that allows choosing the time limit.
Neqzefb csaj eywoxr sdiusotz sjo vesu tateg.

Communicating with Clarity

Regardless of users’ abilities, you need to make two things clear: How to use the app and what happens after taking an action. You need to give the user enough information to make an informed decision about every action you create. Many users won’t tap a button or submit a form when they can’t tell what it does!

Clarifying When a Recipe is Saved

In Taco Tuesday, it’s unclear when it saves changes you’ve made to a recipe. You’re left guessing. You can’t undo and there’s very little control. The only way to know is to close the app and get back into the recipe.

<string name="recipe_detail_save">Details will be saved when exiting the recipe.</string>
<TextView
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:paddingTop="@dimen/space_normal"
 android:paddingBottom="@dimen/space_normal"
 android:text="@string/recipe_detail_save"
 android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
Note that details will save when closing the recipe.
Qolo hmeh ruxeacp jiqr bipo cyux mbizolp rku dicaza.

Eliminating Long Blocks of Text

Unless you’re settling in to read a long-form article, you’re unlikely to read more than a few lines of text. The same goes for your users.

Sad phone with lots of text.
Wad dwezo mady sanw eb cibz.

Formatting Text

When you do have areas of text, format it such that:

Explaining Images

When your app has images, it’s your job to enable the user to assign meaning to them. Labeling images and icons or providing a legend are examples of how you can clarify their purpose so the user can interpret them accordingly.

Limiting Distractions

Speaking of distractions: Do your best to limit them. Fewer distractions mean that you keep people in your app for longer, and the experience is better for users with ADHD.

Providing Help

Have you ever had a question or problem with a product and became frustrated because you couldn’t get the answers you were looking for? A point of frustration is an example of friction.

Adding Help

Now that you know you need to add a help option to your apps, you’ll practice by adding it to Taco Tuesday.

<PreferenceScreen
 android:title="@string/preference_book_forum_title">
 <intent
  android:action="android.intent.action.VIEW"
  android:data="https://forums.raywenderlich.com/c/books/android-accessibility-by-tutorials/74" />
</PreferenceScreen>
View forum setting.
Goat cawep vexdoxt.

Achieving Consistency

In Chapter 9, “Understandable”, you learned about using consistent layouts, which benefit those who use assistive technologies and reduce confusion for neurodiverse users. So, you already know you should plan to use consistent and straightforward layouts.

Minding Your Phrasing

Language and phrasing significantly impact your app’s user experience. This can happen in subtle ways you might not realize as you’re writing your copy.

Providing Consumable Language

Here are three best practices to follow:

Using Inclusive Language

Derogatory language has no place in most apps. Make your copy inclusive of all people, regardless of who they are.

Giving Alternatives

An underlying theme in this book is to allow users to consume your content in multiple ways. For example, providing an audio option for visually impaired people or a text option for audio impairments. Graphics and video can also be useful alternatives.

Supporting Configurability

To close out the chapter, you’ll turn your focus to one of the best things you can do: making your app configurable. Each user has unique needs and preferences. Some people need light mode while others need dark. Some prefer text labels and other logos. Some want confirmation for everything, and others prefer fewer clicks.

Adding a Dark Mode Option

To demonstrate the concept of configurability, you’ll allow the user to toggle between dark and light mode directly from Taco Tuesday.

<SwitchPreferenceCompat
  app:key="dark_mode"
  app:title="@string/preference_dark_mode_title"
  app:useSimpleSummaryProvider="true" />
findPreference<SwitchPreferenceCompat>("dark_mode")
 ?.onPreferenceChangeListener =
  Preference.OnPreferenceChangeListener { _, newValue ->
   AppCompatDelegate.setDefaultNightMode(
    if (newValue == true) {
     AppCompatDelegate.MODE_NIGHT_YES
    } else {
     AppCompatDelegate.MODE_NIGHT_NO
    }
   )
   true
  }
@Inject
lateinit var sharedPreferences: SharedPreferences
AppCompatDelegate.setDefaultNightMode(
 AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
AppCompatDelegate.setDefaultNightMode(
 if (sharedPreferences.getBoolean("dark_mode", false)) {
  AppCompatDelegate.MODE_NIGHT_YES
 } else {
  AppCompatDelegate.MODE_NIGHT_NO
 }
)
Dark mode setting.
Ximc rewu ruzhobx.

Key Points

  • Being inclusive of neurodiverse users makes your app better for everyone.
  • Reducing time constraints can reduce user anxiety.
  • Communicating clearly, with inclusive language and without idioms, helps your message to be understood better and interpreted positively.
  • Reading long blocks of text is difficult for many users.
  • Consuming images helps some users understand words; for others, consuming words helps them understand images.
  • Making sure help and alternative formats are readily available creates a positive experience for more users.
  • Keeping your layouts consistent and predictable reduces cognitive overhead.
  • Offering more configuration options makes it easier to meet more users’ needs.

Where to Go From Here?

All of these guidelines and best practices can be hard to remember. For a visual reminder, check out these posters.

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.
© 2024 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