-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Android] Move to EventDispatcher instead of RCTEventEmitter
- Loading branch information
Showing
2 changed files
with
35 additions
and
12 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
android/src/main/java/com/reactnativemenu/MenuOnPressActionEvent.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,21 @@ | ||
package com.reactnativemenu | ||
|
||
import com.facebook.react.bridge.Arguments | ||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
|
||
class MenuOnPressActionEvent( | ||
surfaceId: Int, | ||
viewTag: Int, | ||
private val event: String?, | ||
private val target: Int | ||
) : Event<MenuOnPressActionEvent>(surfaceId, viewTag) { | ||
|
||
override fun getEventName(): String = "onPressAction" | ||
override fun getEventData(): WritableMap = Arguments.createMap().apply { | ||
if (event != null) { | ||
putString("event", event) | ||
} | ||
putString("target", target.toString()) | ||
} | ||
} |
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