lottie-ios 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/main.yml +117 -11
- package/Gemfile +1 -0
- package/Gemfile.lock +5 -0
- package/Lottie.xcodeproj/project.pbxproj +1542 -194
- package/Lottie.xcodeproj/project.xcworkspace/xcuserdata/calstephens.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/Lottie.xcodeproj/xcshareddata/xcschemes/Lottie (iOS).xcscheme +1 -1
- package/Lottie.xcodeproj/xcshareddata/xcschemes/Lottie (macOS).xcscheme +1 -1
- package/Lottie.xcodeproj/xcshareddata/xcschemes/Lottie (tvOS).xcscheme +4 -5
- package/Lottie.xcodeproj/xcshareddata/xcschemes/Lottie (visionOS).xcscheme +66 -0
- package/Lottie.xcodeproj/xcuserdata/calstephens.xcuserdatad/xcschemes/xcschememanagement.plist +18 -0
- package/Lottie.xcworkspace/xcshareddata/swiftpm/Package.resolved +2 -11
- package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +346 -102
- package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Expressions.xcexplist +16 -5
- package/Package.resolved +2 -2
- package/Package.swift +16 -9
- package/README.md +2 -2
- package/Rakefile +122 -25
- package/Sources/Private/CoreAnimation/Animations/DropShadowAnimation.swift +160 -0
- package/Sources/Private/CoreAnimation/Animations/LayerProperty.swift +83 -10
- package/Sources/Private/CoreAnimation/Animations/TransformAnimations.swift +85 -79
- package/Sources/Private/CoreAnimation/CoreAnimationLayer.swift +7 -7
- package/Sources/Private/CoreAnimation/Extensions/Keyframes+combined.swift +67 -6
- package/Sources/Private/CoreAnimation/Layers/AnimationLayer.swift +2 -2
- package/Sources/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +9 -0
- package/Sources/Private/CoreAnimation/Layers/ImageLayer.swift +1 -0
- package/Sources/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +1 -1
- package/Sources/Private/CoreAnimation/Layers/RepeaterLayer.swift +2 -0
- package/Sources/Private/CoreAnimation/Layers/ShapeLayer.swift +11 -13
- package/Sources/Private/CoreAnimation/Layers/SolidLayer.swift +20 -5
- package/Sources/Private/CoreAnimation/Layers/TextLayer.swift +13 -3
- package/Sources/Private/CoreAnimation/ValueProviderStore.swift +6 -4
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +263 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +18 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +32 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +99 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +29 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +57 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +41 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +60 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +37 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/README.md +31 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIHostingController.swift +46 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIHostingView.swift +391 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +44 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +51 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +172 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +128 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +452 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +148 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +40 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +43 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +42 -0
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +51 -0
- package/Sources/Private/EmbeddedLibraries/README.md +27 -0
- package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+BackingConfiguration.swift +4 -4
- package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+MemoryFile.swift +2 -2
- package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+Writing.swift +4 -4
- package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive.swift +8 -7
- package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Data+Compression.swift +5 -5
- package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/FileManager+ZIP.swift +4 -4
- package/Sources/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +6 -0
- package/Sources/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +3 -1
- package/Sources/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +18 -5
- package/Sources/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +31 -3
- package/Sources/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +33 -8
- package/Sources/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +8 -1
- package/Sources/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +13 -4
- package/Sources/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +2 -2
- package/Sources/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +1 -0
- package/Sources/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +4 -4
- package/Sources/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +1 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +3 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +2 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +2 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +1 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +2 -2
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +1 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +1 -1
- package/Sources/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +6 -2
- package/Sources/Private/Model/Assets/Asset.swift +8 -0
- package/Sources/Private/Model/Assets/AssetLibrary.swift +2 -2
- package/Sources/Private/Model/Assets/ImageAsset.swift +3 -3
- package/Sources/Private/Model/DotLottie/DotLottieAnimation.swift +16 -2
- package/Sources/Private/Model/DotLottie/DotLottieImageProvider.swift +20 -7
- package/Sources/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +26 -0
- package/Sources/Private/Model/Keyframes/KeyframeGroup.swift +8 -5
- package/Sources/Private/Model/LayerEffects/DropShadowEffect.swift +45 -0
- package/Sources/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +38 -0
- package/Sources/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
- package/Sources/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +38 -0
- package/Sources/Private/Model/LayerEffects/LayerEffect.swift +103 -0
- package/Sources/Private/Model/LayerStyles/DropShadowStyle.swift +72 -0
- package/Sources/Private/Model/LayerStyles/LayerStyle.swift +85 -0
- package/Sources/Private/Model/Layers/LayerModel.swift +27 -0
- package/Sources/Private/Model/Objects/Marker.swift +1 -1
- package/Sources/Private/Model/Objects/Transform.swift +1 -2
- package/Sources/Private/Model/ShapeItems/GradientFill.swift +1 -1
- package/Sources/Private/Model/ShapeItems/GradientStroke.swift +2 -2
- package/Sources/Private/Model/ShapeItems/Merge.swift +1 -1
- package/Sources/Private/Model/ShapeItems/ShapeItem.swift +31 -26
- package/Sources/Private/Model/ShapeItems/ShapeTransform.swift +0 -9
- package/Sources/Private/Model/ShapeItems/Star.swift +1 -1
- package/Sources/Private/Model/Text/Font.swift +2 -2
- package/Sources/Private/Model/Text/Glyph.swift +1 -1
- package/Sources/Private/RootAnimationLayer.swift +2 -2
- package/Sources/Private/Utility/Debugging/LayerDebugging.swift +3 -1
- package/Sources/Private/Utility/Extensions/AnimationKeypathExtension.swift +32 -2
- package/Sources/Private/Utility/Helpers/AnimationContext.swift +4 -2
- package/Sources/Private/Utility/Helpers/AnyEquatable.swift +24 -0
- package/Sources/Private/Utility/Helpers/Binding+Map.swift +18 -0
- package/Sources/Private/Utility/Helpers/View+ValueChanged.swift +20 -0
- package/Sources/Private/Utility/LottieAnimationSource.swift +41 -0
- package/Sources/Private/Utility/Primitives/BezierPath.swift +2 -2
- package/Sources/Private/Utility/Primitives/BezierPathRoundExtension.swift +2 -2
- package/Sources/Private/Utility/Primitives/VectorsExtensions.swift +1 -1
- package/Sources/Public/Animation/LottieAnimation.swift +21 -2
- package/Sources/Public/Animation/LottieAnimationLayer.swift +1464 -0
- package/Sources/Public/Animation/LottieAnimationView.swift +258 -735
- package/Sources/Public/Animation/LottiePlaybackMode.swift +117 -0
- package/Sources/Public/Animation/LottieView.swift +462 -0
- package/Sources/Public/AnimationCache/AnimationCacheProvider.swift +2 -1
- package/Sources/Public/AnimationCache/DefaultAnimationCache.swift +5 -6
- package/Sources/Public/Configuration/DecodingStrategy.swift +15 -0
- package/Sources/Public/Configuration/LottieConfiguration.swift +47 -0
- package/Sources/Public/Configuration/ReducedMotionOption.swift +114 -0
- package/Sources/Public/{LottieConfiguration.swift → Configuration/RenderingEngineOption.swift} +2 -57
- package/Sources/Public/{iOS → Controls}/AnimatedButton.swift +56 -13
- package/Sources/Public/{iOS → Controls}/AnimatedControl.swift +80 -8
- package/Sources/Public/{iOS → Controls}/AnimatedSwitch.swift +71 -31
- package/Sources/Public/Controls/LottieButton.swift +122 -0
- package/Sources/Public/Controls/LottieSwitch.swift +144 -0
- package/Sources/Public/Controls/LottieViewType.swift +79 -0
- package/Sources/Public/DotLottie/DotLottieConfiguration.swift +24 -0
- package/Sources/Public/DotLottie/DotLottieFile.swift +21 -6
- package/Sources/Public/DotLottie/DotLottieFileHelpers.swift +79 -0
- package/Sources/Public/DynamicProperties/AnimationKeypath.swift +11 -1
- package/Sources/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +14 -0
- package/Sources/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +13 -0
- package/Sources/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +22 -5
- package/Sources/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +14 -0
- package/Sources/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +13 -0
- package/Sources/Public/FontProvider/AnimationFontProvider.swift +8 -0
- package/Sources/Public/ImageProvider/AnimationImageProvider.swift +24 -0
- package/Sources/Public/Keyframes/Keyframe.swift +6 -0
- package/Sources/Public/Primitives/Vectors.swift +2 -2
- package/Sources/Public/TextProvider/AnimationTextProvider.swift +79 -6
- package/Sources/Public/iOS/AnimationSubview.swift +1 -1
- package/Sources/Public/iOS/BundleImageProvider.swift +16 -2
- package/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift +2 -2
- package/Sources/Public/iOS/FilepathImageProvider.swift +22 -3
- package/Sources/Public/iOS/LottieAnimationViewBase.swift +7 -1
- package/Sources/Public/macOS/BundleImageProvider.macOS.swift +15 -1
- package/Sources/Public/macOS/FilepathImageProvider.macOS.swift +21 -2
- package/lottie-ios.podspec +2 -1
- package/package.json +1 -1
- package/Sources/Private/Model/DotLottie/DotLottieConfiguration.swift +0 -15
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+Helpers.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+Progress.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+Reading.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+ReadingDeprecated.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+WritingDeprecated.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+ZIP64.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Data+CompressionDeprecated.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Data+Serialization.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Entry+Serialization.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Entry+ZIP64.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Entry.swift +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/README.md +0 -0
- /package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/URL+ZIP.swift +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
-
#if
|
|
9
|
+
#if canImport(UIKit)
|
|
10
10
|
import UIKit
|
|
11
11
|
|
|
12
12
|
/// Provides an image for a lottie animation from a provided Bundle.
|
|
@@ -17,13 +17,21 @@ public class FilepathImageProvider: AnimationImageProvider {
|
|
|
17
17
|
/// Initializes an image provider with a specific filepath.
|
|
18
18
|
///
|
|
19
19
|
/// - Parameter filepath: The absolute filepath containing the images.
|
|
20
|
+
/// - Parameter contentsGravity: The contents gravity to use when rendering the images.
|
|
20
21
|
///
|
|
21
|
-
public init(filepath: String) {
|
|
22
|
+
public init(filepath: String, contentsGravity: CALayerContentsGravity = .resize) {
|
|
22
23
|
self.filepath = URL(fileURLWithPath: filepath)
|
|
24
|
+
self.contentsGravity = contentsGravity
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
/// Initializes an image provider with a specific filepath.
|
|
28
|
+
///
|
|
29
|
+
/// - Parameter filepath: The absolute filepath containing the images.
|
|
30
|
+
/// - Parameter contentsGravity: The contents gravity to use when rendering the images.
|
|
31
|
+
///
|
|
32
|
+
public init(filepath: URL, contentsGravity: CALayerContentsGravity = .resize) {
|
|
26
33
|
self.filepath = filepath
|
|
34
|
+
self.contentsGravity = contentsGravity
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
// MARK: Public
|
|
@@ -52,8 +60,19 @@ public class FilepathImageProvider: AnimationImageProvider {
|
|
|
52
60
|
return nil
|
|
53
61
|
}
|
|
54
62
|
|
|
63
|
+
public func contentsGravity(for _: ImageAsset) -> CALayerContentsGravity {
|
|
64
|
+
contentsGravity
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
// MARK: Internal
|
|
56
68
|
|
|
57
69
|
let filepath: URL
|
|
70
|
+
let contentsGravity: CALayerContentsGravity
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
extension FilepathImageProvider: Equatable {
|
|
74
|
+
public static func ==(_ lhs: FilepathImageProvider, _ rhs: FilepathImageProvider) -> Bool {
|
|
75
|
+
lhs.filepath == rhs.filepath
|
|
76
|
+
}
|
|
58
77
|
}
|
|
59
78
|
#endif
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// Created by Brandon Withrow on 2/6/19.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
#if
|
|
8
|
+
#if canImport(UIKit)
|
|
9
9
|
import UIKit
|
|
10
10
|
|
|
11
11
|
/// The base view for `LottieAnimationView` on iOS, tvOS, watchOS, and macCatalyst.
|
|
@@ -38,7 +38,13 @@ open class LottieAnimationViewBase: UIView {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
var screenScale: CGFloat {
|
|
41
|
+
#if os(iOS) || os(tvOS)
|
|
41
42
|
UIScreen.main.scale
|
|
43
|
+
#else // if os(visionOS)
|
|
44
|
+
// We intentionally don't check `#if os(visionOS)`, because that emits
|
|
45
|
+
// a warning when building on Xcode 14 and earlier.
|
|
46
|
+
1.0
|
|
47
|
+
#endif
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
func layoutAnimation() {
|
|
@@ -20,10 +20,12 @@ public class BundleImageProvider: AnimationImageProvider {
|
|
|
20
20
|
///
|
|
21
21
|
/// - Parameter bundle: The bundle containing images for the provider.
|
|
22
22
|
/// - Parameter searchPath: The subpath is a path within the bundle to search for image assets.
|
|
23
|
+
/// - Parameter contentsGravity: The contents gravity to use when rendering the image.
|
|
23
24
|
///
|
|
24
|
-
public init(bundle: Bundle, searchPath: String
|
|
25
|
+
public init(bundle: Bundle, searchPath: String?, contentsGravity: CALayerContentsGravity = .resize) {
|
|
25
26
|
self.bundle = bundle
|
|
26
27
|
self.searchPath = searchPath
|
|
28
|
+
self.contentsGravity = contentsGravity
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
// MARK: Public
|
|
@@ -70,10 +72,22 @@ public class BundleImageProvider: AnimationImageProvider {
|
|
|
70
72
|
return image.lottie_CGImage
|
|
71
73
|
}
|
|
72
74
|
|
|
75
|
+
public func contentsGravity(for _: ImageAsset) -> CALayerContentsGravity {
|
|
76
|
+
contentsGravity
|
|
77
|
+
}
|
|
78
|
+
|
|
73
79
|
// MARK: Internal
|
|
74
80
|
|
|
75
81
|
let bundle: Bundle
|
|
76
82
|
let searchPath: String?
|
|
83
|
+
let contentsGravity: CALayerContentsGravity
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
extension BundleImageProvider: Equatable {
|
|
87
|
+
public static func ==(_ lhs: BundleImageProvider, _ rhs: BundleImageProvider) -> Bool {
|
|
88
|
+
lhs.bundle == rhs.bundle
|
|
89
|
+
&& lhs.searchPath == rhs.searchPath
|
|
90
|
+
}
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
#endif
|
|
@@ -16,13 +16,21 @@ public class FilepathImageProvider: AnimationImageProvider {
|
|
|
16
16
|
/// Initializes an image provider with a specific filepath.
|
|
17
17
|
///
|
|
18
18
|
/// - Parameter filepath: The absolute filepath containing the images.
|
|
19
|
+
/// - Parameter contentsGravity: The contents gravity to use when rendering the images.
|
|
19
20
|
///
|
|
20
|
-
public init(filepath: String) {
|
|
21
|
+
public init(filepath: String, contentsGravity: CALayerContentsGravity = .resize) {
|
|
21
22
|
self.filepath = URL(fileURLWithPath: filepath)
|
|
23
|
+
self.contentsGravity = contentsGravity
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
/// Initializes an image provider with a specific filepath.
|
|
27
|
+
///
|
|
28
|
+
/// - Parameter filepath: The absolute filepath containing the images.
|
|
29
|
+
/// - Parameter contentsGravity: The contents gravity to use when rendering the images.
|
|
30
|
+
///
|
|
31
|
+
public init(filepath: URL, contentsGravity: CALayerContentsGravity = .resize) {
|
|
25
32
|
self.filepath = filepath
|
|
33
|
+
self.contentsGravity = contentsGravity
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
// MARK: Public
|
|
@@ -51,9 +59,20 @@ public class FilepathImageProvider: AnimationImageProvider {
|
|
|
51
59
|
return nil
|
|
52
60
|
}
|
|
53
61
|
|
|
62
|
+
public func contentsGravity(for _: ImageAsset) -> CALayerContentsGravity {
|
|
63
|
+
contentsGravity
|
|
64
|
+
}
|
|
65
|
+
|
|
54
66
|
// MARK: Internal
|
|
55
67
|
|
|
56
68
|
let filepath: URL
|
|
69
|
+
let contentsGravity: CALayerContentsGravity
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
extension FilepathImageProvider: Equatable {
|
|
73
|
+
public static func ==(_ lhs: FilepathImageProvider, _ rhs: FilepathImageProvider) -> Bool {
|
|
74
|
+
lhs.filepath == rhs.filepath
|
|
75
|
+
}
|
|
57
76
|
}
|
|
58
77
|
|
|
59
78
|
extension NSImage {
|
package/lottie-ios.podspec
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
Pod::Spec.new do |s|
|
|
10
10
|
s.name = 'lottie-ios'
|
|
11
|
-
s.version = '4.
|
|
11
|
+
s.version = '4.3.0'
|
|
12
12
|
s.summary = 'A library to render native animations from bodymovin json'
|
|
13
13
|
|
|
14
14
|
s.description = <<-DESC
|
|
@@ -28,6 +28,7 @@ Lottie enables designers to create and ship beautiful animations without an engi
|
|
|
28
28
|
s.tvos.deployment_target = '11.0'
|
|
29
29
|
|
|
30
30
|
s.source_files = 'Sources/**/*'
|
|
31
|
+
s.exclude_files = 'Sources/**/*.md'
|
|
31
32
|
s.ios.exclude_files = 'Sources/Public/MacOS/**/*'
|
|
32
33
|
s.tvos.exclude_files = 'Sources/Public/MacOS/**/*'
|
|
33
34
|
s.osx.exclude_files = 'Sources/Public/iOS/**/*'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lottie-ios",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with bodymovin and renders the vector animations natively on mobile and through React Native!",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// DotLottieSettings.swift
|
|
3
|
-
// Lottie
|
|
4
|
-
//
|
|
5
|
-
// Created by Evandro Hoffmann on 19/10/22.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
|
|
10
|
-
struct DotLottieConfiguration {
|
|
11
|
-
var id: String
|
|
12
|
-
var imageProvider: AnimationImageProvider?
|
|
13
|
-
var loopMode: LottieLoopMode
|
|
14
|
-
var speed: Double
|
|
15
|
-
}
|
/package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+Helpers.swift
RENAMED
|
File without changes
|
/package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+Progress.swift
RENAMED
|
File without changes
|
/package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+Reading.swift
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Archive+ZIP64.swift
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/Sources/Private/{Model/DotLottie → EmbeddedLibraries}/ZipFoundation/Entry+ZIP64.swift
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|