diff --git a/android/build.gradle b/android/build.gradle index a68f0b4..35c0dda 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -135,7 +135,7 @@ dependencies { implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1' - implementation 'app.rive:rive-android:8.7.0' + implementation 'app.rive:rive-android:9.2.2' implementation "androidx.startup:startup-runtime:1.1.1" implementation 'com.android.volley:volley:1.2.0' } diff --git a/android/gradle.properties b/android/gradle.properties index a9b5584..22f2d07 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,4 @@ -RiveReactNative_kotlinVersion=1.8.10 +RiveReactNative_kotlinVersion=1.9.22 RiveReactNative_compileSdkVersion=34 RiveReactNative_buildToolsVersion=30.0.3 RiveReactNative_targetSdkVersion=34 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index fc10b60..a363877 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/src/main/java/com/rivereactnative/RiveReactNativeView.kt b/android/src/main/java/com/rivereactnative/RiveReactNativeView.kt index e3e0f2f..911f608 100644 --- a/android/src/main/java/com/rivereactnative/RiveReactNativeView.kt +++ b/android/src/main/java/com/rivereactnative/RiveReactNativeView.kt @@ -5,7 +5,7 @@ import androidx.annotation.CallSuper import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleObserver import androidx.lifecycle.LifecycleOwner -import app.rive.runtime.kotlin.PointerEvents +import app.rive.runtime.kotlin.renderers.PointerEvents import app.rive.runtime.kotlin.RiveAnimationView import app.rive.runtime.kotlin.controllers.RiveFileController import app.rive.runtime.kotlin.core.* @@ -158,7 +158,7 @@ class RiveReactNativeView(private val context: ThemedReactContext) : FrameLayout override fun onDetachedFromWindow() { if (willDispose) { - riveAnimationView?.dispose(); + riveAnimationView.dispose(); } super.onDetachedFromWindow() @@ -301,16 +301,16 @@ class RiveReactNativeView(private val context: ThemedReactContext) : FrameLayout } fun touchBegan(x: Float, y: Float) { - riveAnimationView.artboardRenderer?.pointerEvent(PointerEvents.POINTER_DOWN, x, y) + riveAnimationView.controller.pointerEvent(PointerEvents.POINTER_DOWN, x, y) } fun touchEnded(x: Float, y: Float) { - riveAnimationView.artboardRenderer?.pointerEvent(PointerEvents.POINTER_UP, x, y) + riveAnimationView.controller.pointerEvent(PointerEvents.POINTER_UP, x, y) } fun setTextRunValue(textRunName: String, textValue: String) { try { - riveAnimationView.artboardRenderer?.activeArtboard?.textRun(textRunName)?.text = textValue; + riveAnimationView.controller.activeArtboard?.textRun(textRunName)?.text = textValue; } catch (ex: RiveException) { handleRiveException(ex) } @@ -459,13 +459,11 @@ class RiveReactNativeView(private val context: ThemedReactContext) : FrameLayout fun setAnimationName(animationName: String) { this.animationName = animationName - riveAnimationView.artboardRenderer?.animationName = animationName shouldBeReloaded = true } fun setStateMachineName(stateMachineName: String) { this.stateMachineName = stateMachineName - riveAnimationView.artboardRenderer?.stateMachineName = stateMachineName shouldBeReloaded = true } diff --git a/android/src/main/java/com/rivereactnative/RiveReactNativeViewManager.kt b/android/src/main/java/com/rivereactnative/RiveReactNativeViewManager.kt index c730240..30766c7 100644 --- a/android/src/main/java/com/rivereactnative/RiveReactNativeViewManager.kt +++ b/android/src/main/java/com/rivereactnative/RiveReactNativeViewManager.kt @@ -23,9 +23,9 @@ class RiveReactNativeViewManager : SimpleViewManager() { "play" -> { args?.let { - val animationName = it.getString(0)!! - val loopMode = it.getString(1)!! - val direction = it.getString(2)!! + val animationName = it.getString(0) + val loopMode = it.getString(1) + val direction = it.getString(2) val isStateMachine = it.getBoolean(3) view.run { val rnLoopMode = RNLoopMode.mapToRNLoopMode(loopMode) @@ -43,8 +43,8 @@ class RiveReactNativeViewManager : SimpleViewManager() { "fireState" -> { args?.let { - val stateMachineName = it.getString(0)!! - val inputName = it.getString(1)!! + val stateMachineName = it.getString(0) + val inputName = it.getString(1) view.run { fireState(stateMachineName, inputName) } @@ -52,8 +52,8 @@ class RiveReactNativeViewManager : SimpleViewManager() { } "setBooleanState" -> { args?.let { - val stateMachineName = it.getString(0)!! - val inputName = it.getString(1)!! + val stateMachineName = it.getString(0) + val inputName = it.getString(1) val value = it.getBoolean(2) view.run { setBooleanState(stateMachineName, inputName, value) @@ -62,8 +62,8 @@ class RiveReactNativeViewManager : SimpleViewManager() { } "setNumberState" -> { args?.let { - val stateMachineName = it.getString(0)!! - val inputName = it.getString(1)!! + val stateMachineName = it.getString(0) + val inputName = it.getString(1) val value = it.getDouble(2) view.run { setNumberState(stateMachineName, inputName, value.toFloat()) diff --git a/example/package.json b/example/package.json index 6536acf..c137332 100644 --- a/example/package.json +++ b/example/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@react-native-masked-view/masked-view": "^0.2.8", - "@react-native-picker/picker": "^1.16.0", + "@react-native-picker/picker": "^2.4.0", "@react-navigation/native": "6.x", "@react-navigation/stack": "6.x", "react": "18.2.0", diff --git a/ios/utility.swift b/ios/utility.swift index 7b0aa59..d941984 100644 --- a/ios/utility.swift +++ b/ios/utility.swift @@ -26,7 +26,7 @@ func importRiveFile(from url: URL) throws -> RiveFile { } let pointer = rawPointer.bindMemory(to: UInt8.self, capacity: bytes.count) - let riveFile = try RiveFile(bytes:pointer, byteLength: UInt64(bytes.count)) + let riveFile = try RiveFile(bytes:pointer, byteLength: UInt64(bytes.count), loadCdn: true) return riveFile } } diff --git a/package.json b/package.json index 4c8d91e..d2c58f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rive-react-native", - "version": "6.2.3", + "version": "6.3.0", "description": "Rive React Native", "main": "lib/commonjs/index", "module": "lib/module/index", @@ -50,8 +50,8 @@ "@commitlint/config-conventional": "^11.0.0", "@react-native-community/eslint-config": "^2.0.0", "@react-native/metro-config": "^0.72.11", - "@tsconfig/react-native": "^3.0.0", "@release-it/conventional-changelog": "^2.0.0", + "@tsconfig/react-native": "^3.0.0", "@types/jest": "^26.0.0", "@types/react": "^18.0.24", "@types/react-native": "0.72.2", diff --git a/rive-react-native.podspec b/rive-react-native.podspec index 32c308d..26b2cce 100644 --- a/rive-react-native.podspec +++ b/rive-react-native.podspec @@ -16,5 +16,5 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm,swift}" s.dependency "React-Core" - s.dependency "RiveRuntime", "5.5.1" + s.dependency "RiveRuntime", "5.10.0" end