From 61f68f57222cb54602b02990c3b95f14b6a2d69b Mon Sep 17 00:00:00 2001 From: Zach Plata Date: Thu, 25 May 2023 15:31:45 -0500 Subject: [PATCH] fix: bump runtimes, pause specific entity on pause API for android --- android/build.gradle | 4 ++-- .../java/com/rivereactnative/RiveReactNativeView.kt | 8 +++++++- example/android/app/build.gradle | 2 +- example/ios/Podfile.lock | 10 +++++----- rive-react-native.podspec | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 3da555e..76c1e67 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -134,7 +134,7 @@ dependencies { implementation 'androidx.core:core-ktx:1.10.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1' - implementation 'app.rive:rive-android:4.5.0' - implementation "androidx.startup:startup-runtime:1.1.0" + implementation 'app.rive:rive-android:5.0.0' + implementation "androidx.startup:startup-runtime:1.1.1" implementation 'com.android.volley:volley:1.2.0' } diff --git a/android/src/main/java/com/rivereactnative/RiveReactNativeView.kt b/android/src/main/java/com/rivereactnative/RiveReactNativeView.kt index 53779aa..01d9415 100644 --- a/android/src/main/java/com/rivereactnative/RiveReactNativeView.kt +++ b/android/src/main/java/com/rivereactnative/RiveReactNativeView.kt @@ -162,7 +162,13 @@ class RiveReactNativeView(private val context: ThemedReactContext) : FrameLayout fun pause() { try { - riveAnimationView.pause() + if (riveAnimationView.playingAnimations.isNotEmpty()) { + riveAnimationView.pause(riveAnimationView.playingAnimations.first().name) + } else if (riveAnimationView.playingStateMachines.isNotEmpty()) { + riveAnimationView.pause(riveAnimationView.playingStateMachines.first().name, true) + } else { + riveAnimationView.pause() + } } catch (ex: RiveException) { handleRiveException(ex) } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index de18b19..139d199 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -183,7 +183,7 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules - implementation "androidx.startup:startup-runtime:1.0.0" + implementation "androidx.startup:startup-runtime:1.1.1" implementation ("androidx.appcompat:appcompat:1.3.1") { version { strictly '1.3.1' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index c05d953..15cad7f 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -339,10 +339,10 @@ PODS: - React-jsi (= 0.66.4) - React-logger (= 0.66.4) - React-perflogger (= 0.66.4) - - rive-react-native (4.0.4): + - rive-react-native (4.0.5): - React-Core - - RiveRuntime (= 3.1.12) - - RiveRuntime (3.1.12) + - RiveRuntime (= 4.0.1) + - RiveRuntime (4.0.1) - RNCMaskedView (0.2.9): - React-Core - RNCPicker (1.16.8): @@ -560,8 +560,8 @@ SPEC CHECKSUMS: React-RCTVibration: e3ffca672dd3772536cb844274094b0e2c31b187 React-runtimeexecutor: dec32ee6f2e2a26e13e58152271535fadff5455a ReactCommon: 57b69f6383eafcbd7da625bfa6003810332313c4 - rive-react-native: 9fbbd982e2187c66481ebb93e7bbd7413b7b81f3 - RiveRuntime: 53017e8ac69c7bf3d711c26f914a933e48a7f86b + rive-react-native: 50dd196583349567c0930f15e9e83bc3dfea0634 + RiveRuntime: 761e3dc31aa4043f3ab00c2ae781be80dc457543 RNCMaskedView: 949696f25ec596bfc697fc88e6f95cf0c79669b6 RNCPicker: 0991c56da7815c0cf946d6f63cf920b25296e5f6 RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 diff --git a/rive-react-native.podspec b/rive-react-native.podspec index 21277fe..062881e 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", "3.1.12" + s.dependency "RiveRuntime", "4.0.1" end