Skip to content

Commit

Permalink
chore(release): publish packages
Browse files Browse the repository at this point in the history
  • Loading branch information
kaptnkoala committed Aug 30, 2024
1 parent 90b07e1 commit 840826e
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.4

- **FEAT**: Provide animation state changes as stream to lottie controller

## 0.1.3

- **FEAT**: Update lottie ios dependency to 4.4.3. ([ff28c637](https://github.com/lotum/lottie_native/commit/ff28c63772b4b720538f8b37adf4374de76ae959))
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :ios, '11.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
14 changes: 7 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- Flutter (1.0.0)
- lottie-ios (4.3.4)
- lottie-ios (4.4.3)
- lottie_native (0.0.1):
- Flutter
- lottie-ios (~> 4.3.4)
- lottie-ios (~> 4.4.3)

DEPENDENCIES:
- Flutter (from `Flutter`)
Expand All @@ -20,10 +20,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/lottie_native/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
lottie-ios: 3d98679b41fa6fd6aff2352b3953dbd3df8a397e
lottie_native: e880defad595321983cebac72516c1a10b6df719
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
lottie-ios: fcb5e73e17ba4c983140b7d21095c834b3087418
lottie_native: d7625e69e3104fa40a333ab2ed9ae77409b2777e

PODFILE CHECKSUM: 985e5b058f26709dc81f9ae74ea2b2775bdbcefe
PODFILE CHECKSUM: d2243213672c3c48aae53c36642ba411a6be7309

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
4 changes: 4 additions & 0 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -370,6 +371,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -499,6 +501,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -530,6 +533,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
29 changes: 22 additions & 7 deletions ios/Classes/LottieView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class LottieView: NSObject, FlutterPlatformView, FlutterStreamHandler {
channel.setMethodCallHandler(methodCall)

let eventChannel = FlutterEventChannel(
name: "de.lotum/lottie_native_stream_state_\(viewId)",
name: "de.lotum/lottie_native_state_\(viewId)",
binaryMessenger: registrar.messenger()
)
eventChannel.setStreamHandler(self)
Expand Down Expand Up @@ -57,7 +57,7 @@ public class LottieView: NSObject, FlutterPlatformView, FlutterStreamHandler {
closure: { animation in
self.animationView.animation = animation
if autoPlay && animation != nil {
self.animationView.play(completion: self.animationFinished)
self.playAnimation()
}
},
animationCache: nil
Expand All @@ -71,18 +71,31 @@ public class LottieView: NSObject, FlutterPlatformView, FlutterStreamHandler {
}

if autoPlay {
animationView.play(completion: animationFinished)
playAnimation()
}
}

animationView.animationLoaded = { animationView, animation in
self.updateState(state: "loaded")
}
}

public func view() -> UIView {
return animationView
}

private func playAnimation() {
animationView.play(completion: animationFinished)
updateState(state: "started")
}

public func animationFinished(finished: Bool) {
private func animationFinished(finished: Bool) {
updateState(state: finished ? "finished" : "cancelled")
}

private func updateState(state: String) {
if let eventSink = eventSink {
eventSink(finished ? "finished" : "cancelled")
eventSink(state)
}
}

Expand All @@ -92,11 +105,11 @@ public class LottieView: NSObject, FlutterPlatformView, FlutterStreamHandler {
switch call.method {
case "play":
animationView.currentProgress = 0
animationView.play(completion: animationFinished)
playAnimation()
result(nil)
break
case "resume":
animationView.play(completion: animationFinished)
playAnimation()
result(nil)
break
case "playWithProgress":
Expand All @@ -109,6 +122,7 @@ public class LottieView: NSObject, FlutterPlatformView, FlutterStreamHandler {
completion: animationFinished)
}
result(nil)
updateState(state: "started")
break
case "playWithFrames":
let toFrame = props["toFrame"] as! NSNumber
Expand All @@ -125,6 +139,7 @@ public class LottieView: NSObject, FlutterPlatformView, FlutterStreamHandler {
)
}
result(nil)
updateState(state: "started")
break
case "stop":
animationView.stop()
Expand Down
2 changes: 1 addition & 1 deletion ios/lottie_native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.dependency 'Flutter'
s.dependency 'lottie-ios', '~> 4.4.3'

s.platform = :ios, '11.0'
s.platform = :ios, '13.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
end
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: lottie_native
description: Render lottie animations, using the native platform libraries.
version: 0.1.3
version: 0.1.4
repository: https://github.com/programmierbar/lottie_native
issue_tracker: https://github.com/programmierbar/lottie_native/issues

Expand Down

0 comments on commit 840826e

Please sign in to comment.