Inclusive Android Apps #8: The Problem of Animations
Eighth issue covers the problems animations can create.
Some types of animations make me feel sick. Like, literally sick. And it has ruined my day more than once, sometimes preventing me from working because I've needed to take a rest after encounters with these animations.
The Problem of Animations
Animations can be helpful and delightful, but they can also be distracting, harmful, and symptom-triggering.
Some types of animations create more problems than others. Val Head (Link to article in Links-section) lists three types of conditions to create problematic movement for people with vestibular disorders: Relative size of movement, mismatched directions and speed, and distance covered.
The relative size of movement means that animations moving objects across a large amount of space can trigger symptoms. Mismatched directions and speed, on the other hand, mean that parallax and scrolljacking animations are likely to trigger symptoms. Finally, perceived distance is also a factor, so something that is objectively small can become a big problem on a phone screen if it takes up a large space on that screen.
It's also important to remember that animations can be distracting. If there is constant movement on the screen, and the user tries to read the text, reading might be impossible because attention is constantly drawn to the animation.
Who This Hurts
- People with vestibular disorders
- People with epilepsy
- People with migraine
- People with ADHD
- Autistic people
- Stressed people
Why Developers (or Designers) Do This
Animations are often seen as a sign of a polished, high-quality app. They're satisfying to build, they look great in design reviews and app store screenshots, and when you don't experience motion sensitivity yourself, it's easy to not realize they can make someone feel physically ill. There's also a tendency to think of animations as purely decorative, something that can be safely ignored or skipped, rather than something that can actively cause harm.
The Solution
Android has a setting called 'Remove animations' ('Reduce motion' on other platforms). Your app should respect that user setting.
Luckily, with modern Android development, it's straightforward. Compose from version 1.2 up supports that setting automatically. But if you use older Compose versions, third-party code, or, for example, Views, you'll need to add the support manually.
Android doesn't expose the value of the Remove animations setting as easily as it does for some other accessibility settings, but we can use the animation duration scale as a proxy. If the user has set the Remove animations setting to on, its value is 0f.
So, we can use the following snippet to get its value:
fun isRemoveAnimationsEnabled(): Boolean {
val animationDuration = try {
Settings.Global.getFloat(
context.contentResolver,
Settings.Global.ANIMATOR_DURATION_SCALE
)
} catch (e: Settings.SettingNotFoundException) {
1f
}
return animationDuration == 0f
}
We try to get the value of the animation duration scale in the try block. If this throws a SettingNotFoundException, we set the value to 1f, since we already know it's not enabled. Finally, we return a comparison of animationDuration: if it's 0f, Remove animations is enabled; otherwise, it's not.
A good thing to remember is to test your app with the Remove animations setting on. This way, you'll find out whether something isn't working for users with this setting and whether there are any information gaps. Trust me, I've seen both.
Testing
- Open accessibility settings and visibility-related settings
- Turn Remove animations on
- Navigate around your app and see if everything's still working
It's also important to test with real users, but a word of caution: If you want to test your animations with real people, there is always a risk of triggering some symptoms. So never just show the animation; make sure the person is up to it and knows what is happening.
Read More
Designing Safer Web Animation For Motion Sensitivity
Author: Val Head
An older, but classic article about motion sensitivity and how to design safer animations. While it's about the web, Android folks can benefit a lot from it, too!
My war on animation
Author: s.e. smith
s.e. smith explains the experience of an individual with motion sensitivity and what it feels like to navigate the internet with so much motion. I highly recommend reading it to understand that animations are not always a delight.
Android, Animations and Reduced Motion
Author: Eevis Panula
My blog post, which I wrote some years back, is about the same themes as this newsletter.
That's a wrap for Issue #8 of Inclusive Android Apps. What are your thoughts about animations? Hit reply and let me know!
Next month: How fixed heights of components turn into a problem.
Thanks for reading!
-Eevis
eevis.codes