Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refactor event dispatch logic on android to fix fabric crash (#1000
- Loading branch information
1 parent
b9ee943
commit ebb8006
Showing
5 changed files
with
76 additions
and
81 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
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
26 changes: 26 additions & 0 deletions
26
...ages/core/android/src/main/java/com/airbnb/android/react/lottie/OnAnimationFinishEvent.kt
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,26 @@ | ||
package com.airbnb.android.react.lottie | ||
|
||
import com.facebook.react.bridge.Arguments | ||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
|
||
class OnAnimationFinishEvent | ||
constructor(surfaceId: Int, viewId: Int, private val isCancelled: Boolean) : | ||
Event<OnAnimationFinishEvent>(surfaceId, viewId) { | ||
|
||
override fun getEventName(): String { | ||
return EVENT_NAME | ||
} | ||
|
||
override fun getCoalescingKey(): Short = 0 | ||
|
||
override fun getEventData(): WritableMap? { | ||
val event = Arguments.createMap() | ||
event.putBoolean("isCancelled", isCancelled) | ||
return event | ||
} | ||
|
||
companion object { | ||
const val EVENT_NAME = "topAnimationFinish" | ||
} | ||
} |
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
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