Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Disable animations and transitions when reduced motion accessibility setting is enabled #15187

Closed

Description

@1ec5

When the “Reduce Motion” setting is enabled in the Accessibility section of Settings on iOS, map views should perform animations and transitions instantaneously. This would ensure parity with GL JS, which added support for CSS’s prefers-reduced-motion media query in mapbox/mapbox-gl-js#8494.

The iOS map SDK can detect this setting by calling UIAccessibilityIsReduceMotionEnabled() and can detect when the setting changes by observing for UIAccessibilityReduceMotionStatusDidChangeNotification. There is a similar user setting on macOS but no corresponding notification or getter that I can find.

One wrinkle is that some developers may have baked in an assumption that an animations lasts for a certain amount of time before starting a different animation. We should recommend that developers use completion handlers to chain animations rather than hard-coding delays.

/cc @mapbox/maps-ios

Activity

  1. added
    GL JS parity
    iOS
    MapKit parity
    accessibility
    on Jul 19, 2019
  2. dieterdreist commented on Sep 4, 2019

    @dieterdreist

    Animations and transitions can be used as eye candy, but they can also be an integral part of an application. Apple's "Reduce Motion" feature is not intended to remove essential functionality (which animations and transitions sometimes are), it should only keep the screen calmer. Turning the feature on should not prevent you from using an app as intended.
    Mapbox, please, if you implement this, make it developer configurable (respect / ignore setting) or time dependent (animations with longer than x seconds duration should not be prevented).

    For example this is broken if the flyTo gets replaced by a jumpTo

  3. 1ec5 commented on Sep 10, 2019

    @1ec5
    ContributorAuthor

    We should probably match how MapKit respects (or doesn’t respect) this setting with regard to simpler methods like -[MKMapView setCamera:animated:]. On the other hand, MapKit doesn’t have any precedent for longer animations; its animations are fixed to a very short length.

    Explicitly making the behavior configurable per camera operation would require additional parameters, which would be unfortunate, due to unwieldiness but also due to forcing the developer to make this decision every time they change the camera. Another approach would be to always perform all animations and expect the developer to check UIAccessibilityIsReduceMotionEnabled() as needed, but I’m not confident that developers would generally heed that advice.

    If the iOS/macOS map SDK could support Core Animation implicit animation (#4352), then we might have more ways to encapsulate reduced motion support without forcing developers to explicitly opt in or out every time.

  4. added
    archived
    on Mar 8, 2020
  5. stale commented on Mar 8, 2020

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GL JS parityMapKit parityaccessibilityarchivediOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions