-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathRivePackage.kt
More file actions
29 lines (25 loc) · 966 Bytes
/
RivePackage.kt
File metadata and controls
29 lines (25 loc) · 966 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
package com.rive
import com.facebook.react.BaseReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.module.model.ReactModuleInfoProvider
import com.facebook.react.uimanager.ViewManager
import com.margelo.nitro.rive.riveOnLoad
class RivePackage : BaseReactPackage() {
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<in Nothing, in Nothing>> {
val viewManagers: MutableList<ViewManager<*, *>> = ArrayList()
viewManagers.add(RiveViewManager())
return viewManagers
}
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
return null
}
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
return ReactModuleInfoProvider { HashMap() }
}
companion object {
init {
riveOnLoad.initializeNative()
}
}
}