Skip to content

Commit ea5d853

Browse files
committed
fix: lint and android version
1 parent faa47c1 commit ea5d853

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

android/src/main/java/com/rive/RiveReactNativeView.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,15 @@ class RiveReactNativeView(context: ThemedReactContext) : FrameLayout(context) {
190190

191191
fun reset() = riveAnimationView?.reset()
192192

193+
fun _playIfNeeded() {
194+
if (riveAnimationView?.isPlaying == false) {
195+
riveAnimationView?.post {
196+
riveAnimationView?.play()
197+
}
198+
}
199+
}
200+
201+
193202
fun addEventListener(onEvent: (event: RNEvent) -> Unit) {
194203
val eventListener = object : RiveFileController.RiveEventListener {
195204
override fun notifyEvent(event: RiveEvent) {

example/src/pages/SharedValueListenerExample.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ import {
1818
GestureHandlerRootView,
1919
} from 'react-native-gesture-handler';
2020
import { useCallback, useEffect, useMemo } from 'react';
21-
import { NitroModules, type BoxedHybridObject } from 'react-native-nitro-modules';
21+
import {
22+
NitroModules,
23+
type BoxedHybridObject,
24+
} from 'react-native-nitro-modules';
2225
import {
2326
Fit,
2427
RiveView,
2528
useRiveFile,
2629
type RiveFile,
2730
type RiveViewRef,
2831
type ViewModelInstance,
29-
type ViewModelNumberProperty,
3032
} from '@rive-app/react-native';
3133

3234
export default function SharedValueListenerExample() {

0 commit comments

Comments
 (0)