decord/alpha/source/components_native/common/SequencedLottieAnimationView.tsx

89 lines
3.1 KiB
TypeScript
Raw Normal View History

2026-10-05 08:00:40 +00:00
// Module ID: 13431
// Function ID: 13432
// Name: SequencedLottieAnimationView
2026-10-03 08:58:59 +00:00
// Dependencies: [109, 19, 17, 21, 5921, 2]
2026-07-23 10:11:24 +00:00
2026-10-05 08:00:40 +00:00
// Module 13431 (SequencedLottieAnimationView)
2026-10-03 08:58:59 +00:00
import react_native from "react-native" /* 17 */;
import Fragment from "Fragment" /* 21 */;
import LottieViewDefault from "LottieView" /* 5921 */;
import _objectWithoutProperties from "_objectWithoutProperties" /* 109 */;
2026-10-03 08:58:59 +00:00
import react from "react" /* 19 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
let closure_2 = ["source", "style"];
2026-10-03 08:58:59 +00:00
const View = react_native.View;
const jsx = Fragment.jsx;
const PureComponent = react.PureComponent;
2026-07-29 08:29:29 +00:00
class SequencedLottieAnimationView extends PureComponent {
constructor() {
2026-10-03 08:58:59 +00:00
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
2026-07-29 08:29:29 +00:00
applyArgumentsResult.animationRef = null;
applyArgumentsResult.currentScene = applyArgumentsResult.props.nextScene;
applyArgumentsResult.isUnmounted = false;
applyArgumentsResult.handleComplete = function handleComplete() {
const onSceneComplete = applyArgumentsResult.props.onSceneComplete;
if (null != onSceneComplete) {
onSceneComplete(applyArgumentsResult.currentScene);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
applyArgumentsResult.handleSetRef = function handleSetRef(animationRef) {
applyArgumentsResult.animationRef = animationRef;
2026-07-29 08:29:29 +00:00
};
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
componentDidMount() {
this.playScene(this.props.nextScene);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
componentDidUpdate() {
const self = this;
const nextScene = this.props.nextScene;
if (nextScene !== this.currentScene) {
self.playScene(nextScene);
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
playScene(nextScene) {
const self = this;
const sceneSegments = this.props.sceneSegments;
let tmp3 = null == this.animationRef;
if (!tmp3) {
tmp3 = nextScene !== self.currentScene && sceneSegments[nextScene].BEG === sceneSegments[this.currentScene].BEG && sceneSegments[nextScene].END === sceneSegments[this.currentScene].END;
}
if (!tmp3) {
const animationRef = self.animationRef;
animationRef.play(sceneSegments[nextScene].BEG, sceneSegments[nextScene].END);
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
self.currentScene = nextScene;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
render() {
let source;
let style;
const props = this.props;
({ source, style } = props);
let json;
const tmp = _objectWithoutProperties(props, closure_2);
if (typeof source === "object") {
if (!source.uri) {
const _JSON = JSON;
json = JSON.stringify(source);
}
}
let tmp4;
if (undefined !== json) {
tmp4 = { aspectRatio: source.w / source.h };
const obj = { aspectRatio: source.w / source.h };
}
const items = [tmp4, style];
const items1 = [tmp4, style];
LottieViewDefault;
const merged = Object.assign(tmp);
({ handleSetRef: obj3.ref, handleComplete: obj3.onAnimationFinish } = this);
return <View style={items}>{null}</View>;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
}
const prototype = SequencedLottieAnimationView.prototype;
2026-07-29 08:29:29 +00:00
SequencedLottieAnimationView.defaultProps = { autoPlay: true };
const result = size.fileFinishedImporting("components_native/common/SequencedLottieAnimationView.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default SequencedLottieAnimationView;