Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lottie-react-native/lottie-react-…
Browse files Browse the repository at this point in the history
…native into next
  • Loading branch information
matinzd committed Feb 4, 2024
2 parents ffb22dd + 42fe205 commit 148d966
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 26 deletions.
12 changes: 2 additions & 10 deletions apps/fabric/ios/example.xcodeproj/project.pbxproj
Expand Up @@ -923,11 +923,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DRN_FABRIC_ENABLED",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down Expand Up @@ -1003,11 +999,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DRN_FABRIC_ENABLED",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
Expand Up @@ -21,6 +21,6 @@ constructor(surfaceId: Int, viewId: Int, private val error: Throwable) :
}

companion object {
const val EVENT_NAME = "topAnimationFailureEvent"
const val EVENT_NAME = "topAnimationFailure"
}
}
Expand Up @@ -16,6 +16,6 @@ class OnAnimationLoadedEvent constructor(surfaceId: Int, viewId: Int) :
}

companion object {
const val EVENT_NAME = "topAnimationLoadedEvent"
const val EVENT_NAME = "topAnimationLoaded"
}
}
4 changes: 2 additions & 2 deletions packages/core/src/LottieView/index.tsx
Expand Up @@ -111,8 +111,8 @@ export class LottieView extends React.PureComponent<Props, {}> {
const speed =
duration && sources.sourceJson && (source as any).fr
? Math.round(
(((source as any).op / (source as any).fr) * 1000) / duration,
)
(((source as any).op / (source as any).fr) * 1000) / duration,
)
: this.props.speed;

const colorFilters = this.props.colorFilters?.map((colorFilter) => ({
Expand Down
19 changes: 7 additions & 12 deletions packages/core/src/specs/LottieAnimationViewNativeComponent.ts
Expand Up @@ -4,11 +4,9 @@ import type {
Double,
Float,
} from 'react-native/Libraries/Types/CodegenTypes';
import codegenNativeComponent, {
NativeComponentType,
} from 'react-native/Libraries/Utilities/codegenNativeComponent';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
import type { ProcessedColorValue, ViewProps } from 'react-native';
import type { ProcessedColorValue, ViewProps, HostComponent } from 'react-native';

export type OnAnimationFinishEvent = Readonly<{
isCancelled: boolean;
Expand Down Expand Up @@ -57,20 +55,17 @@ export interface NativeProps extends ViewProps {
textFiltersAndroid?: ReadonlyArray<TextFilterAndroidStruct>;
textFiltersIOS?: ReadonlyArray<TextFilterIOSStruct>;
onAnimationFinish?: BubblingEventHandler<
OnAnimationFinishEvent,
'onAnimationFinish'
OnAnimationFinishEvent
>;
onAnimationFailure?: BubblingEventHandler<
AnimationFailureEvent,
'onAnimationFailure'
AnimationFailureEvent
>;
onAnimationLoaded?: BubblingEventHandler<
AnimationLoadedEvent,
'onAnimationLoaded'
AnimationLoadedEvent
>;
}

type LottieViewNativeComponentType = NativeComponentType<NativeProps>;
type LottieViewNativeComponentType = HostComponent<NativeProps>;

interface NativeCommands {
play: (
Expand All @@ -87,4 +82,4 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
supportedCommands: ['play', 'reset', 'pause', 'resume'],
});

export default codegenNativeComponent<NativeProps>('LottieAnimationView');
export default codegenNativeComponent<NativeProps>('LottieAnimationView') as HostComponent<NativeProps>;

0 comments on commit 148d966

Please sign in to comment.