Closed Bug 1812063 Opened 3 years ago Closed 2 days ago

Animations Accessibility/Reduce Motion settings in Android not respected in Fenix

Categories

(Firefox for Android :: General, defect)

All
Android
defect

Tracking

()

RESOLVED FIXED
154 Branch
Accessibility Severity s3
Tracking Status
firefox152 --- ?
firefox153 --- ?
firefox154 --- fixed

People

(Reporter: csadilek, Assigned: segun)

References

Details

(Keywords: access, Whiteboard: [fxdroid] [group1])

Attachments

(1 file)

From github: https://github.com/mozilla-mobile/fenix/issues/3597.

Steps to reproduce

  1. Navigate to settings > accessibility
  2. Enable "Remove animations"
  3. Use Fenix

Expected behavior

Tab switching animation is disabled.

Actual behavior

Tab switching animation is not disabled.

Device information

  • Android device: Pixel 2
  • Fenix version: latest

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Flags: needinfo?(cpeterson)
Keywords: access
Accessibility Severity: --- → s3
Severity: -- → S3
Duplicate of this bug: 1813754
Assignee: nobody → sfamisa
Status: NEW → ASSIGNED
Whiteboard: [fxdroid] [group1]

I was looking at this today, and want to explore some ideas to solve it.

I can confirm we do not respect the reduced motion and it's affecting every single place we define our own custom animation in our navigation graph xml, which is.....a lot

https://searchfox.org/firefox-main/search?q=Anim%3D%22&path=.xml&case=false&regexp=false

Upgrading the severity to S2 because it's an accessibility issue and a workaround does not exist.

Severity: S3 → S2

This bug is happening because we have set custom animations with custom duration that we have defined in all our animations.

Some options I considered to solve the bug:

Option #1 - Use style attributes to set the duration

I considered using theme attributes to set the duration, instead of the hard-coded value, and then set the value in our Normal & Private tab themes.
This was considered too risky because we would need to ensure that every single theme sets this attribute default value. Else, we could end up with runtime fatalities

Option #2 - Use an extension function to programmatically check settings before navigation

This seems like a welcome approach, but involves changing a lot of files, and leaves room for missing some options. We will need to go through every place each "navigation action of interest" is being dispatched from.

Option #3 - Custom navigator alone

I tried using a custom Navigator to implement the system reduced motion awareness, but I encountered another problem.
We set the nav graph in the fragment container view directly in activity_home.xml.

Adding the custom Navigator and then programmatically setting the nav graph in HomeActivity by doing HomeActivity.navHost.navController.setGraph(..), causes the fragment transaction (that powers the navigation) to be queued up, and by the time HomeFragment gets created, the fragment may not have been set, and any findNavController() that happens in HomeFragment could throw. I experienced this crash a few times.

Option #4 - Custom navigator + custom nav host fragment

The working solution was to combine the custom navigator with a custom NavHostFragment that overrides the onCreateNavController(..) so we can set our custom navigator that is aware of motion.


Another option that could be explored, which I did not have time to explore was to keep our custom animations, but rely on the system animation duration. I do not have context about why we have those values, and I am not confident enough to change the values.

Pushed by sfamisa@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d5171e9e0f47 https://hg.mozilla.org/integration/autoland/rev/e3ade567c585 Implement a compat NavHostFragment and custom Navigator that respects device reduced-motion setting r=android-reviewers,kaya
Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch

Nominating this for the next dot release because it's a rather important accessibility fix, and the blast radius for the fix is small.

Since the status is marked as fixed for nightly and as ? for release, is it fixed or ? for beta?
For more information, please visit BugBot documentation.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: