mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 11:41:08 +00:00
28 lines
854 B
Kotlin
28 lines
854 B
Kotlin
package com.reactnativecommunity.webview.events
|
|||
|
|
|
||
|
|
import com.facebook.react.bridge.WritableMap
|
||
|
|
import com.facebook.react.uimanager.events.Event
|
||
|
|
import com.facebook.react.uimanager.events.RCTEventEmitter
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Event emitted when shouldOverrideUrlLoading is called
|
||
|
|
*/
|
||
|
|
class TopShouldStartLoadWithRequestEvent(viewId: Int, private val mData: WritableMap) : Event<TopShouldStartLoadWithRequestEvent>(viewId) {
|
||
|
|
companion object {
|
||
|
|
const val EVENT_NAME = "topShouldStartLoadWithRequest"
|
||
|
|
}
|
||
|
|
|
||
|
|
init {
|
||
|
|
mData.putString("navigationType", "other")
|
||
|
|
}
|
||
|
|
|
||
|
|
override fun getEventName(): String = EVENT_NAME
|
||
|
|
|
||
|
|
override fun canCoalesce(): Boolean = false
|
||
|
|
|
||
|
|
override fun getCoalescingKey(): Short = 0
|
||
|
|
|
||
|
|
override fun dispatch(rctEventEmitter: RCTEventEmitter) =
|
||
|
|
rctEventEmitter.receiveEvent(viewTag, EVENT_NAME, mData)
|
||
|
|
}
|