-
-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy pathKeyboardTransitionEvent.kt
More file actions
32 lines (27 loc) · 918 Bytes
/
KeyboardTransitionEvent.kt
File metadata and controls
32 lines (27 loc) · 918 Bytes
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
package com.reactnativekeyboardcontroller.events
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.WritableMap
import com.facebook.react.uimanager.events.Event
data class KeyboardTransitionEventData(
val event: String,
val height: Double,
val progress: Double,
val duration: Int,
val target: Int,
)
@Suppress("detekt:LongParameterList")
class KeyboardTransitionEvent(
surfaceId: Int,
viewId: Int,
private val data: KeyboardTransitionEventData,
) : Event<KeyboardTransitionEvent>(surfaceId, viewId) {
override fun getEventName() = data.event
// All events for a given view can be coalesced?
override fun getCoalescingKey(): Short = 0
override fun getEventData(): WritableMap? = Arguments.createMap().apply {
putDouble("progress", data.progress)
putDouble("height", data.height)
putInt("duration", data.duration)
putInt("target", data.target)
}
}