-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathOnCaretRectEvent.kt
More file actions
36 lines (31 loc) · 1.06 KB
/
Copy pathOnCaretRectEvent.kt
File metadata and controls
36 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.swmansion.enriched.textinput.events
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.WritableMap
import com.facebook.react.uimanager.events.Event
class OnCaretRectEvent(
surfaceId: Int,
viewId: Int,
private val requestId: Int,
private val x: Double,
private val y: Double,
private val width: Double,
private val height: Double,
private val valid: Boolean,
private val experimentalSynchronousEvents: Boolean,
) : Event<OnCaretRectEvent>(surfaceId, viewId) {
override fun getEventName(): String = EVENT_NAME
override fun getEventData(): WritableMap {
val eventData: WritableMap = Arguments.createMap()
eventData.putInt("requestId", requestId)
eventData.putDouble("x", x)
eventData.putDouble("y", y)
eventData.putDouble("width", width)
eventData.putDouble("height", height)
eventData.putBoolean("valid", valid)
return eventData
}
override fun experimental_isSynchronous(): Boolean = experimentalSynchronousEvents
companion object {
const val EVENT_NAME: String = "onCaretRect"
}
}