-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debug: rn-hole-view fix long conversion
- Loading branch information
1 parent
b0e55f2
commit 6248a4f
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) { |