Skip to content

Commit

Permalink
debug: rn-hole-view fix long conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Sep 15, 2024
1 parent b0e55f2 commit 6248a4f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions patches/RNHoleViewManagerImpl.kt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- /tmp/tmp-status-mobile-c0ccae303/tmp.AWxigEDTpA/RNHoleViewManagerImpl.kt 2024-09-15 14:11:00.914934000 +0530
+++ ./node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleViewManagerImpl.kt 2024-09-15 14:12:52.483706014 +0530
@@ -16,19 +16,22 @@
import kotlin.math.roundToInt

class RNHoleViewManagerImpl(reactContext: ReactApplicationContext) {
-
+
val reactContext: ReactApplicationContext = reactContext

companion object {
public const val NAME = "RNHoleView"
public const val ON_ANIMATION_FINISHED = "onAnimationFinished"
+ const val ANIMATION_DURATION_DEFAULT = 1000L
}

public fun setAnimation(view: RNHoleView, animation: ReadableMap?) {
if (animation != null) {
var duration = RNHoleView.ANIMATION_DURATION_DEFAULT
if (animation.hasKey("duration")) {
- duration = animation.getDouble("duration").toLong()
+ // just use the default value as a temporary fix to this error
+ // Error: Exception in HostFunction: Loss of precision during arithmetic conversion: (long) 352.7272727
+ duration = ANIMATION_DURATION_DEFAULT
}
var timingFunction: RNHoleView.EAnimationTimingFunction? = null
if (animation.hasKey("timingFunction")) {

0 comments on commit 6248a4f

Please sign in to comment.