-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Play "reduced motion" marker if UIAccessibility.isReduceMotionEnabled
is true
#2110
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Created by Cal Stephens on 7/14/23. | ||
// Copyright © 2023 Airbnb Inc. All rights reserved. | ||
|
||
/// How animation files should be decoded | ||
public enum DecodingStrategy: Hashable { | ||
/// Use Codable. This is was the default strategy introduced on Lottie 3, but should be rarely | ||
/// used as it's slower than `dictionaryBased`. Kept here for any possible compatibility issues | ||
/// that may come up, but consider it soft-deprecated. | ||
case legacyCodable | ||
|
||
/// Manually deserialize a dictionary into an Animation. | ||
/// This should be at least 2-3x faster than using Codable and due to that | ||
/// it's the default as of Lottie 4.x. | ||
case dictionaryBased | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Created by Cal Stephens on 12/13/21. | ||
// Copyright © 2021 Airbnb Inc. All rights reserved. | ||
|
||
import QuartzCore | ||
|
||
/// Global configuration options for Lottie animations | ||
public struct LottieConfiguration: Hashable { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved this to its own file and added the |
||
|
||
// MARK: Lifecycle | ||
|
||
public init( | ||
renderingEngine: RenderingEngineOption = .automatic, | ||
decodingStrategy: DecodingStrategy = .dictionaryBased, | ||
colorSpace: CGColorSpace = CGColorSpaceCreateDeviceRGB(), | ||
reducedMotionOption: ReducedMotionOption = .reducedMotion) | ||
{ | ||
self.renderingEngine = renderingEngine | ||
self.decodingStrategy = decodingStrategy | ||
self.colorSpace = colorSpace | ||
self.reducedMotionOption = reducedMotionOption | ||
} | ||
|
||
// MARK: Public | ||
|
||
/// The global configuration of Lottie, | ||
/// which applies to all `LottieAnimationView`s by default. | ||
public static var shared = LottieConfiguration() | ||
|
||
/// The rendering engine implementation to use when displaying an animation | ||
/// - Defaults to `RenderingEngineOption.automatic`, which uses the | ||
/// Core Animation rendering engine for supported animations, and | ||
/// falls back to using the Main Thread rendering engine for | ||
/// animations that use features not supported by the Core Animation engine. | ||
public var renderingEngine: RenderingEngineOption | ||
|
||
/// The decoding implementation to use when parsing an animation JSON file | ||
public var decodingStrategy: DecodingStrategy | ||
|
||
/// Options for controlling animation behavior in response to user / system "reduced motion" configuration. | ||
/// - Defaults to `ReducedMotionOption.systemReducedMotionToggle`, which returns `.reducedMotion` | ||
/// when the system `UIAccessibility.isReduceMotionEnabled` option is `true`. | ||
public var reducedMotionOption: ReducedMotionOption | ||
|
||
/// The color space to be used for rendering | ||
/// - Defaults to `CGColorSpaceCreateDeviceRGB()` | ||
public var colorSpace: CGColorSpace | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to its own file