@react-native-ohos/lottie-react-native 7.2.3-rc.4 → 7.3.0-rc.1
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/LICENSE +200 -200
- package/README.OpenSource +10 -10
- package/README.md +12 -12
- package/harmony/lottie/.idea/lottie.iml +8 -0
- package/harmony/lottie/.idea/modules.xml +8 -0
- package/harmony/lottie/.idea/vcs.xml +6 -0
- package/harmony/lottie/BuildProfile.ets +20 -20
- package/harmony/lottie/build-profile.json5 +8 -8
- package/harmony/lottie/hvigorfile.ts +5 -5
- package/harmony/lottie/index.ets +5 -5
- package/harmony/lottie/oh-package.json5 +14 -14
- package/harmony/lottie/src/main/cpp/CMakeLists.txt +9 -9
- package/harmony/lottie/src/main/cpp/LottieAnimationViewPackage.h +12 -12
- package/harmony/lottie/src/main/cpp/generated/RNOH/generated/BaseLottieReactNativePackage.h +68 -68
- package/harmony/lottie/src/main/cpp/generated/RNOH/generated/components/LottieAnimationViewJSIBinder.h +43 -43
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/ComponentDescriptors.h +22 -22
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/EventEmitters.cpp +44 -44
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/EventEmitters.h +39 -39
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/Props.cpp +41 -41
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/Props.h +42 -42
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/ShadowNodes.cpp +19 -19
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/ShadowNodes.h +34 -34
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/States.cpp +18 -18
- package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/States.h +35 -35
- package/harmony/lottie/src/main/ets/LottieAnimationTools.ets +20 -20
- package/harmony/lottie/src/main/ets/LottieAnimationView.ets +408 -408
- package/harmony/lottie/src/main/ets/LottieAnimationViewPackage.ts +16 -16
- package/harmony/lottie/src/main/ets/LottieCompositionCache.ets +29 -29
- package/harmony/lottie/src/main/ets/common/TextUtils.ets +17 -17
- package/harmony/lottie/src/main/ets/generated/components/LottieAnimationView.ts +181 -181
- package/harmony/lottie/src/main/ets/generated/components/ts.ts +5 -5
- package/harmony/lottie/src/main/ets/generated/index.ets +5 -5
- package/harmony/lottie/src/main/ets/generated/ts.ts +6 -6
- package/harmony/lottie/src/main/ets/generated/turboModules/ts.ts +5 -5
- package/harmony/lottie/src/main/module.json5 +9 -9
- package/harmony/lottie/src/main/resources/base/element/string.json +8 -8
- package/harmony/lottie/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/lottie/src/main/resources/zh_CN/element/string.json +8 -8
- package/harmony/lottie/ts.ts +4 -4
- package/harmony/lottie.har +0 -0
- package/lib/commonjs/LottieAnimationViewNativeComponent.js.map +1 -1
- package/lib/commonjs/codegenUtils.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/LottieAnimationViewNativeComponent.js.map +1 -1
- package/lib/module/codegenUtils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/package.json +131 -131
- package/src/LottieAnimationViewNativeComponent.ts +77 -77
- package/src/codegenUtils.ts +8 -8
- package/src/index.tsx +7 -7
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
-
// Use of this source code is governed by a Apache-2.0 license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
#pragma once
|
|
6
|
-
|
|
7
|
-
#include "generated/RNOH/generated/BaseLottieReactNativePackage.h"
|
|
8
|
-
namespace rnoh {
|
|
9
|
-
class LottieAnimationViewPackage : public BaseLottieReactNativePackage {
|
|
10
|
-
using Super = BaseLottieReactNativePackage;
|
|
11
|
-
using Super::Super;
|
|
12
|
-
};
|
|
1
|
+
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a Apache-2.0 license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include "generated/RNOH/generated/BaseLottieReactNativePackage.h"
|
|
8
|
+
namespace rnoh {
|
|
9
|
+
class LottieAnimationViewPackage : public BaseLottieReactNativePackage {
|
|
10
|
+
using Super = BaseLottieReactNativePackage;
|
|
11
|
+
using Super::Super;
|
|
12
|
+
};
|
|
13
13
|
} // namespace rnoh
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
#pragma once
|
|
6
|
-
|
|
7
|
-
#include <react/renderer/components/lottie_react_native/ComponentDescriptors.h>
|
|
8
|
-
#include "RNOH/Package.h"
|
|
9
|
-
#include "RNOH/ArkTSTurboModule.h"
|
|
10
|
-
#include "RNOH/generated/components/LottieAnimationViewJSIBinder.h"
|
|
11
|
-
|
|
12
|
-
namespace rnoh {
|
|
13
|
-
|
|
14
|
-
class BaseLottieReactNativePackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
15
|
-
public:
|
|
16
|
-
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
|
17
|
-
return nullptr;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
class BaseLottieReactNativePackageEventEmitRequestHandler : public EventEmitRequestHandler {
|
|
22
|
-
public:
|
|
23
|
-
void handleEvent(Context const &ctx) override {
|
|
24
|
-
auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
|
|
25
|
-
if (eventEmitter == nullptr) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
std::vector<std::string> supportedEventNames = {
|
|
30
|
-
"animationFinish",
|
|
31
|
-
"animationFailure",
|
|
32
|
-
"animationLoaded",
|
|
33
|
-
};
|
|
34
|
-
if (std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
|
|
35
|
-
eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class BaseLottieReactNativePackage : public Package {
|
|
42
|
-
public:
|
|
43
|
-
BaseLottieReactNativePackage(Package::Context ctx) : Package(ctx){};
|
|
44
|
-
|
|
45
|
-
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
|
|
46
|
-
return std::make_unique<BaseLottieReactNativePackageTurboModuleFactoryDelegate>();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
|
|
50
|
-
return {
|
|
51
|
-
facebook::react::concreteComponentDescriptorProvider<facebook::react::LottieAnimationViewComponentDescriptor>(),
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
ComponentJSIBinderByString createComponentJSIBinderByName() override {
|
|
56
|
-
return {
|
|
57
|
-
{"LottieAnimationView", std::make_shared<LottieAnimationViewJSIBinder>()},
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
EventEmitRequestHandlers createEventEmitRequestHandlers() override {
|
|
62
|
-
return {
|
|
63
|
-
std::make_shared<BaseLottieReactNativePackageEventEmitRequestHandler>(),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
} // namespace rnoh
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include <react/renderer/components/lottie_react_native/ComponentDescriptors.h>
|
|
8
|
+
#include "RNOH/Package.h"
|
|
9
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
10
|
+
#include "RNOH/generated/components/LottieAnimationViewJSIBinder.h"
|
|
11
|
+
|
|
12
|
+
namespace rnoh {
|
|
13
|
+
|
|
14
|
+
class BaseLottieReactNativePackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
15
|
+
public:
|
|
16
|
+
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
|
17
|
+
return nullptr;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
class BaseLottieReactNativePackageEventEmitRequestHandler : public EventEmitRequestHandler {
|
|
22
|
+
public:
|
|
23
|
+
void handleEvent(Context const &ctx) override {
|
|
24
|
+
auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
|
|
25
|
+
if (eventEmitter == nullptr) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
std::vector<std::string> supportedEventNames = {
|
|
30
|
+
"animationFinish",
|
|
31
|
+
"animationFailure",
|
|
32
|
+
"animationLoaded",
|
|
33
|
+
};
|
|
34
|
+
if (std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
|
|
35
|
+
eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class BaseLottieReactNativePackage : public Package {
|
|
42
|
+
public:
|
|
43
|
+
BaseLottieReactNativePackage(Package::Context ctx) : Package(ctx){};
|
|
44
|
+
|
|
45
|
+
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
|
|
46
|
+
return std::make_unique<BaseLottieReactNativePackageTurboModuleFactoryDelegate>();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
|
|
50
|
+
return {
|
|
51
|
+
facebook::react::concreteComponentDescriptorProvider<facebook::react::LottieAnimationViewComponentDescriptor>(),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ComponentJSIBinderByString createComponentJSIBinderByName() override {
|
|
56
|
+
return {
|
|
57
|
+
{"LottieAnimationView", std::make_shared<LottieAnimationViewJSIBinder>()},
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
EventEmitRequestHandlers createEventEmitRequestHandlers() override {
|
|
62
|
+
return {
|
|
63
|
+
std::make_shared<BaseLottieReactNativePackageEventEmitRequestHandler>(),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
} // namespace rnoh
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
#pragma once
|
|
6
|
-
#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
|
|
7
|
-
|
|
8
|
-
namespace rnoh {
|
|
9
|
-
class LottieAnimationViewJSIBinder : public ViewComponentJSIBinder {
|
|
10
|
-
protected:
|
|
11
|
-
facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
|
|
12
|
-
auto object = ViewComponentJSIBinder::createNativeProps(rt);
|
|
13
|
-
object.setProperty(rt, "resizeMode", true);
|
|
14
|
-
object.setProperty(rt, "renderMode", true);
|
|
15
|
-
object.setProperty(rt, "sourceName", true);
|
|
16
|
-
object.setProperty(rt, "sourceJson", true);
|
|
17
|
-
object.setProperty(rt, "sourceURL", true);
|
|
18
|
-
object.setProperty(rt, "imageAssetsFolder", true);
|
|
19
|
-
object.setProperty(rt, "progress", true);
|
|
20
|
-
object.setProperty(rt, "speed", true);
|
|
21
|
-
object.setProperty(rt, "loop", true);
|
|
22
|
-
object.setProperty(rt, "autoPlay", true);
|
|
23
|
-
object.setProperty(rt, "enableMergePathsAndroidForKitKatAndAbove", true);
|
|
24
|
-
object.setProperty(rt, "hardwareAccelerationAndroid", true);
|
|
25
|
-
object.setProperty(rt, "cacheComposition", true);
|
|
26
|
-
object.setProperty(rt, "colorFilters", true);
|
|
27
|
-
return object;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override {
|
|
31
|
-
facebook::jsi::Object events(rt);
|
|
32
|
-
return events;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
|
|
36
|
-
facebook::jsi::Object events(rt);
|
|
37
|
-
events.setProperty(rt, "topAnimationFinish", createDirectEvent(rt, "onAnimationFinish"));
|
|
38
|
-
events.setProperty(rt, "topAnimationFailure", createDirectEvent(rt, "onAnimationFailure"));
|
|
39
|
-
events.setProperty(rt, "topAnimationLoaded", createDirectEvent(rt, "onAnimationLoaded"));
|
|
40
|
-
return events;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
} // namespace rnoh
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
|
|
7
|
+
|
|
8
|
+
namespace rnoh {
|
|
9
|
+
class LottieAnimationViewJSIBinder : public ViewComponentJSIBinder {
|
|
10
|
+
protected:
|
|
11
|
+
facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
|
|
12
|
+
auto object = ViewComponentJSIBinder::createNativeProps(rt);
|
|
13
|
+
object.setProperty(rt, "resizeMode", true);
|
|
14
|
+
object.setProperty(rt, "renderMode", true);
|
|
15
|
+
object.setProperty(rt, "sourceName", true);
|
|
16
|
+
object.setProperty(rt, "sourceJson", true);
|
|
17
|
+
object.setProperty(rt, "sourceURL", true);
|
|
18
|
+
object.setProperty(rt, "imageAssetsFolder", true);
|
|
19
|
+
object.setProperty(rt, "progress", true);
|
|
20
|
+
object.setProperty(rt, "speed", true);
|
|
21
|
+
object.setProperty(rt, "loop", true);
|
|
22
|
+
object.setProperty(rt, "autoPlay", true);
|
|
23
|
+
object.setProperty(rt, "enableMergePathsAndroidForKitKatAndAbove", true);
|
|
24
|
+
object.setProperty(rt, "hardwareAccelerationAndroid", true);
|
|
25
|
+
object.setProperty(rt, "cacheComposition", true);
|
|
26
|
+
object.setProperty(rt, "colorFilters", true);
|
|
27
|
+
return object;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override {
|
|
31
|
+
facebook::jsi::Object events(rt);
|
|
32
|
+
return events;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
|
|
36
|
+
facebook::jsi::Object events(rt);
|
|
37
|
+
events.setProperty(rt, "topAnimationFinish", createDirectEvent(rt, "onAnimationFinish"));
|
|
38
|
+
events.setProperty(rt, "topAnimationFailure", createDirectEvent(rt, "onAnimationFailure"));
|
|
39
|
+
events.setProperty(rt, "topAnimationLoaded", createDirectEvent(rt, "onAnimationLoaded"));
|
|
40
|
+
return events;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
} // namespace rnoh
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <react/renderer/components/lottie_react_native/ShadowNodes.h>
|
|
14
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
-
|
|
16
|
-
namespace facebook {
|
|
17
|
-
namespace react {
|
|
18
|
-
|
|
19
|
-
using LottieAnimationViewComponentDescriptor = ConcreteComponentDescriptor<LottieAnimationViewShadowNode>;
|
|
20
|
-
|
|
21
|
-
} // namespace react
|
|
22
|
-
} // namespace facebook
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/lottie_react_native/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
|
|
16
|
+
namespace facebook {
|
|
17
|
+
namespace react {
|
|
18
|
+
|
|
19
|
+
using LottieAnimationViewComponentDescriptor = ConcreteComponentDescriptor<LottieAnimationViewShadowNode>;
|
|
20
|
+
|
|
21
|
+
} // namespace react
|
|
22
|
+
} // namespace facebook
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/lottie_react_native/EventEmitters.h>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
namespace facebook {
|
|
15
|
-
namespace react {
|
|
16
|
-
|
|
17
|
-
void LottieAnimationViewEventEmitter::onAnimationFinish(OnAnimationFinish $event) const {
|
|
18
|
-
dispatchEvent("animationFinish", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
19
|
-
auto $payload = jsi::Object(runtime);
|
|
20
|
-
$payload.setProperty(runtime, "isCancelled", $event.isCancelled);
|
|
21
|
-
return $payload;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
void LottieAnimationViewEventEmitter::onAnimationFailure(OnAnimationFailure $event) const {
|
|
27
|
-
dispatchEvent("animationFailure", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
28
|
-
auto $payload = jsi::Object(runtime);
|
|
29
|
-
$payload.setProperty(runtime, "error", $event.error);
|
|
30
|
-
return $payload;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
void LottieAnimationViewEventEmitter::onAnimationLoaded(OnAnimationLoaded $event) const {
|
|
36
|
-
dispatchEvent("animationLoaded", [](jsi::Runtime &runtime) {
|
|
37
|
-
auto $payload = jsi::Object(runtime);
|
|
38
|
-
|
|
39
|
-
return $payload;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
} // namespace react
|
|
44
|
-
} // namespace facebook
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/lottie_react_native/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook {
|
|
15
|
+
namespace react {
|
|
16
|
+
|
|
17
|
+
void LottieAnimationViewEventEmitter::onAnimationFinish(OnAnimationFinish $event) const {
|
|
18
|
+
dispatchEvent("animationFinish", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
19
|
+
auto $payload = jsi::Object(runtime);
|
|
20
|
+
$payload.setProperty(runtime, "isCancelled", $event.isCancelled);
|
|
21
|
+
return $payload;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
void LottieAnimationViewEventEmitter::onAnimationFailure(OnAnimationFailure $event) const {
|
|
27
|
+
dispatchEvent("animationFailure", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
28
|
+
auto $payload = jsi::Object(runtime);
|
|
29
|
+
$payload.setProperty(runtime, "error", $event.error);
|
|
30
|
+
return $payload;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
void LottieAnimationViewEventEmitter::onAnimationLoaded(OnAnimationLoaded $event) const {
|
|
36
|
+
dispatchEvent("animationLoaded", [](jsi::Runtime &runtime) {
|
|
37
|
+
auto $payload = jsi::Object(runtime);
|
|
38
|
+
|
|
39
|
+
return $payload;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
} // namespace react
|
|
44
|
+
} // namespace facebook
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
namespace facebook {
|
|
16
|
-
namespace react {
|
|
17
|
-
class LottieAnimationViewEventEmitter : public ViewEventEmitter {
|
|
18
|
-
public:
|
|
19
|
-
using ViewEventEmitter::ViewEventEmitter;
|
|
20
|
-
|
|
21
|
-
struct OnAnimationFinish {
|
|
22
|
-
bool isCancelled;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
struct OnAnimationFailure {
|
|
26
|
-
std::string error;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
struct OnAnimationLoaded {
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
void onAnimationFinish(OnAnimationFinish value) const;
|
|
33
|
-
|
|
34
|
-
void onAnimationFailure(OnAnimationFailure value) const;
|
|
35
|
-
|
|
36
|
-
void onAnimationLoaded(OnAnimationLoaded value) const;
|
|
37
|
-
};
|
|
38
|
-
} // namespace react
|
|
39
|
-
} // namespace facebook
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace facebook {
|
|
16
|
+
namespace react {
|
|
17
|
+
class LottieAnimationViewEventEmitter : public ViewEventEmitter {
|
|
18
|
+
public:
|
|
19
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
20
|
+
|
|
21
|
+
struct OnAnimationFinish {
|
|
22
|
+
bool isCancelled;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
struct OnAnimationFailure {
|
|
26
|
+
std::string error;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
struct OnAnimationLoaded {
|
|
30
|
+
|
|
31
|
+
};
|
|
32
|
+
void onAnimationFinish(OnAnimationFinish value) const;
|
|
33
|
+
|
|
34
|
+
void onAnimationFailure(OnAnimationFailure value) const;
|
|
35
|
+
|
|
36
|
+
void onAnimationLoaded(OnAnimationLoaded value) const;
|
|
37
|
+
};
|
|
38
|
+
} // namespace react
|
|
39
|
+
} // namespace facebook
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/lottie_react_native/Props.h>
|
|
12
|
-
#include <folly/dynamic.h>
|
|
13
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
-
#include <react/renderer/core/propsConversions.h>
|
|
15
|
-
|
|
16
|
-
namespace facebook {
|
|
17
|
-
namespace react {
|
|
18
|
-
|
|
19
|
-
LottieAnimationViewProps::LottieAnimationViewProps(
|
|
20
|
-
const PropsParserContext &context,
|
|
21
|
-
const LottieAnimationViewProps &sourceProps,
|
|
22
|
-
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
23
|
-
|
|
24
|
-
resizeMode(convertRawProp(context, rawProps, "resizeMode", sourceProps.resizeMode, {})),
|
|
25
|
-
renderMode(convertRawProp(context, rawProps, "renderMode", sourceProps.renderMode, {})),
|
|
26
|
-
sourceName(convertRawProp(context, rawProps, "sourceName", sourceProps.sourceName, {})),
|
|
27
|
-
sourceJson(convertRawProp(context, rawProps, "sourceJson", sourceProps.sourceJson, {})),
|
|
28
|
-
sourceURL(convertRawProp(context, rawProps, "sourceURL", sourceProps.sourceURL, {})),
|
|
29
|
-
imageAssetsFolder(convertRawProp(context, rawProps, "imageAssetsFolder", sourceProps.imageAssetsFolder, {})),
|
|
30
|
-
progress(convertRawProp(context, rawProps, "progress", sourceProps.progress, {0.0})),
|
|
31
|
-
speed(convertRawProp(context, rawProps, "speed", sourceProps.speed, {0.0})),
|
|
32
|
-
loop(convertRawProp(context, rawProps, "loop", sourceProps.loop, {false})),
|
|
33
|
-
autoPlay(convertRawProp(context, rawProps, "autoPlay", sourceProps.autoPlay, {false})),
|
|
34
|
-
enableMergePathsAndroidForKitKatAndAbove(convertRawProp(context, rawProps, "enableMergePathsAndroidForKitKatAndAbove", sourceProps.enableMergePathsAndroidForKitKatAndAbove, {false})),
|
|
35
|
-
hardwareAccelerationAndroid(convertRawProp(context, rawProps, "hardwareAccelerationAndroid", sourceProps.hardwareAccelerationAndroid, {false})),
|
|
36
|
-
cacheComposition(convertRawProp(context, rawProps, "cacheComposition", sourceProps.cacheComposition, {false})),
|
|
37
|
-
colorFilters(convertRawProp(context, rawProps, "colorFilters", sourceProps.colorFilters, {}))
|
|
38
|
-
{}
|
|
39
|
-
|
|
40
|
-
} // namespace react
|
|
41
|
-
} // namespace facebook
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/lottie_react_native/Props.h>
|
|
12
|
+
#include <folly/dynamic.h>
|
|
13
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
+
#include <react/renderer/core/propsConversions.h>
|
|
15
|
+
|
|
16
|
+
namespace facebook {
|
|
17
|
+
namespace react {
|
|
18
|
+
|
|
19
|
+
LottieAnimationViewProps::LottieAnimationViewProps(
|
|
20
|
+
const PropsParserContext &context,
|
|
21
|
+
const LottieAnimationViewProps &sourceProps,
|
|
22
|
+
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
23
|
+
|
|
24
|
+
resizeMode(convertRawProp(context, rawProps, "resizeMode", sourceProps.resizeMode, {})),
|
|
25
|
+
renderMode(convertRawProp(context, rawProps, "renderMode", sourceProps.renderMode, {})),
|
|
26
|
+
sourceName(convertRawProp(context, rawProps, "sourceName", sourceProps.sourceName, {})),
|
|
27
|
+
sourceJson(convertRawProp(context, rawProps, "sourceJson", sourceProps.sourceJson, {})),
|
|
28
|
+
sourceURL(convertRawProp(context, rawProps, "sourceURL", sourceProps.sourceURL, {})),
|
|
29
|
+
imageAssetsFolder(convertRawProp(context, rawProps, "imageAssetsFolder", sourceProps.imageAssetsFolder, {})),
|
|
30
|
+
progress(convertRawProp(context, rawProps, "progress", sourceProps.progress, {0.0})),
|
|
31
|
+
speed(convertRawProp(context, rawProps, "speed", sourceProps.speed, {0.0})),
|
|
32
|
+
loop(convertRawProp(context, rawProps, "loop", sourceProps.loop, {false})),
|
|
33
|
+
autoPlay(convertRawProp(context, rawProps, "autoPlay", sourceProps.autoPlay, {false})),
|
|
34
|
+
enableMergePathsAndroidForKitKatAndAbove(convertRawProp(context, rawProps, "enableMergePathsAndroidForKitKatAndAbove", sourceProps.enableMergePathsAndroidForKitKatAndAbove, {false})),
|
|
35
|
+
hardwareAccelerationAndroid(convertRawProp(context, rawProps, "hardwareAccelerationAndroid", sourceProps.hardwareAccelerationAndroid, {false})),
|
|
36
|
+
cacheComposition(convertRawProp(context, rawProps, "cacheComposition", sourceProps.cacheComposition, {false})),
|
|
37
|
+
colorFilters(convertRawProp(context, rawProps, "colorFilters", sourceProps.colorFilters, {}))
|
|
38
|
+
{}
|
|
39
|
+
|
|
40
|
+
} // namespace react
|
|
41
|
+
} // namespace facebook
|
package/harmony/lottie/src/main/cpp/generated/react/renderer/components/lottie_react_native/Props.h
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GeneratePropsH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewProps.h>
|
|
13
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook {
|
|
16
|
-
namespace react {
|
|
17
|
-
|
|
18
|
-
class LottieAnimationViewProps final : public ViewProps {
|
|
19
|
-
public:
|
|
20
|
-
LottieAnimationViewProps() = default;
|
|
21
|
-
LottieAnimationViewProps(const PropsParserContext& context, const LottieAnimationViewProps &sourceProps, const RawProps &rawProps);
|
|
22
|
-
|
|
23
|
-
#pragma mark - Props
|
|
24
|
-
|
|
25
|
-
std::string resizeMode{};
|
|
26
|
-
std::string renderMode{};
|
|
27
|
-
std::string sourceName{};
|
|
28
|
-
std::string sourceJson{};
|
|
29
|
-
std::string sourceURL{};
|
|
30
|
-
std::string imageAssetsFolder{};
|
|
31
|
-
Float progress{0.0};
|
|
32
|
-
double speed{0.0};
|
|
33
|
-
bool loop{false};
|
|
34
|
-
bool autoPlay{false};
|
|
35
|
-
bool enableMergePathsAndroidForKitKatAndAbove{false};
|
|
36
|
-
bool hardwareAccelerationAndroid{false};
|
|
37
|
-
bool cacheComposition{false};
|
|
38
|
-
folly::dynamic colorFilters{};
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
} // namespace react
|
|
42
|
-
} // namespace facebook
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
13
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook {
|
|
16
|
+
namespace react {
|
|
17
|
+
|
|
18
|
+
class LottieAnimationViewProps final : public ViewProps {
|
|
19
|
+
public:
|
|
20
|
+
LottieAnimationViewProps() = default;
|
|
21
|
+
LottieAnimationViewProps(const PropsParserContext& context, const LottieAnimationViewProps &sourceProps, const RawProps &rawProps);
|
|
22
|
+
|
|
23
|
+
#pragma mark - Props
|
|
24
|
+
|
|
25
|
+
std::string resizeMode{};
|
|
26
|
+
std::string renderMode{};
|
|
27
|
+
std::string sourceName{};
|
|
28
|
+
std::string sourceJson{};
|
|
29
|
+
std::string sourceURL{};
|
|
30
|
+
std::string imageAssetsFolder{};
|
|
31
|
+
Float progress{0.0};
|
|
32
|
+
double speed{0.0};
|
|
33
|
+
bool loop{false};
|
|
34
|
+
bool autoPlay{false};
|
|
35
|
+
bool enableMergePathsAndroidForKitKatAndAbove{false};
|
|
36
|
+
bool hardwareAccelerationAndroid{false};
|
|
37
|
+
bool cacheComposition{false};
|
|
38
|
+
folly::dynamic colorFilters{};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace react
|
|
42
|
+
} // namespace facebook
|