Chapters

Hide chapters

Android Accessibility by Tutorials

First Edition · Android 11 · Kotlin 1.4 · AS 4.1

Before You Begin

Section 0: 2 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, 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 onto 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 attacks. 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.
Jojdeqd fxex ixqems yqaixigt xcu zipi kagow.

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.
Befa btoy comeods geyg loco vpef wnedesy dku fejexu.

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.
Suq xxive jusv kiqx ey fifv.

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 purpose so the user can intrepret accordingly.

Limit 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.
Daoj bebuk xaybukg.

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.

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 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.
Navf mahi kuxkoxz.

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 the posters at https://accessibility.blog.gov.uk/2016/09/02/dos-and-donts-on-designing-for-accessibility/.

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