Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/m1ga/ti.animation
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Feb 9, 2023
2 parents 2f31ac8 + 35cfdba commit 2cd6725
Show file tree
Hide file tree
Showing 96 changed files with 28,812 additions and 374 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -8,7 +8,8 @@ Titanium module to support smooth and scalable animations using [Airbnb Lottie](

## Requirements

- Titanium SDK 9.0.0+
- Android: Titanium SDK 9.0.0+
- iOS: Titanium SDK 11.0.0+

## Library versions:

Expand All @@ -17,7 +18,7 @@ The Titanium modules use external libraries
|Library|Platform|Version|Build Date|
|---|---|---|---|
| [Airbnb Lottie](https://github.com/airbnb/lottie-android) | Android | 5.2.0 | 2022/05/31 |
| [Airbnb Lottie](https://github.com/airbnb/lottie-ios) | iOS | 3.4.3 | 2022/09/17 |
| [Airbnb Lottie](https://github.com/airbnb/lottie-ios) | iOS | 4.1.2 | 2023/01/26 |

## Create a View

Expand Down
8 changes: 4 additions & 4 deletions ios/Classes/TiAnimationAnimationView.swift
Expand Up @@ -12,9 +12,9 @@ import Lottie
@objc(TiAnimationAnimationView)
public class TiAnimationAnimationView : TiUIView {

var _animationView: AnimationView!
var _animationView: LottieAnimationView!

private func animationView() -> AnimationView {
private func animationView() -> LottieAnimationView {
if _animationView == nil {
let file = TiUtils.stringValue(proxy.value(forKey: "file"))
let jsonString = TiUtils.stringValue(proxy.value(forKey: "jsonString"))
Expand All @@ -29,12 +29,12 @@ public class TiAnimationAnimationView : TiUIView {
fatalError("Cannot find file!")
}

_animationView = AnimationView(animation: try! Animation(dictionary: dictionary))
_animationView = LottieAnimationView(animation: try! LottieAnimation(dictionary: dictionary))
// Case B: Handle JSON strings
} else if let jsonString = jsonString {
let data = jsonString.data(using: .utf8)
if let data = data, let jsonData = try? JSONSerialization.jsonObject(with: data) as? [String: Any] {
_animationView = AnimationView(animation: try! Animation(dictionary: jsonData))
_animationView = LottieAnimationView(animation: try! LottieAnimation(dictionary: jsonData))
}
}

Expand Down
4 changes: 1 addition & 3 deletions ios/Classes/TiAnimationModule.swift
Expand Up @@ -13,8 +13,6 @@ import Lottie
@objc(TiAnimationModule)
class TiAnimationModule: TiModule {

public let testProperty: String = "Hello World"

func moduleGUID() -> String {
return "a6f82400-49cf-4b2a-8d32-53a1600b1077"
}
Expand All @@ -25,7 +23,7 @@ class TiAnimationModule: TiModule {

@objc var newRenderingEngineEnabled: Any {
set {
LottieConfiguration.shared.renderingEngine = newValue as? Bool ?? false ? .coreAnimation : .mainThread
LottieConfiguration.shared.renderingEngine = newValue as? Bool ?? true ? .coreAnimation : .mainThread
}
get {
return LottieConfiguration.shared.renderingEngine == .coreAnimation
Expand Down
4 changes: 2 additions & 2 deletions ios/manifest
Expand Up @@ -2,13 +2,13 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 5.0.0
version: 6.0.0
apiversion: 2
architectures: arm64 x86_64
description: ti.animation
author: Hans Knöchel
license: Apache 2
mac: false
mac: false
copyright: Copyright (c) 2017-present by Hans Knöchel, Michael Gangolf

# these should not be edited
Expand Down
44 changes: 40 additions & 4 deletions ios/platform/Lottie.xcframework/Info.plist
Expand Up @@ -5,8 +5,46 @@
<key>AvailableLibraries</key>
<array>
<dict>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>Lottie.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>Lottie.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>Lottie.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
Expand All @@ -19,8 +57,6 @@
<string>ios</string>
</dict>
<dict>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
Expand Down

0 comments on commit 2cd6725

Please sign in to comment.