-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathRNGoogleMapsPlusPackage.kt
More file actions
35 lines (29 loc) · 1.06 KB
/
RNGoogleMapsPlusPackage.kt
File metadata and controls
35 lines (29 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
package com.rngooglemapsplus
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.rngooglemapsplus.RNGoogleMapsPlusPackage.AppContextHolder.context
import com.rngooglemapsplus.views.HybridRNGoogleMapsPlusViewManager
class RNGoogleMapsPlusPackage : BaseReactPackage() {
override fun getModule(
name: String,
reactContext: ReactApplicationContext,
): NativeModule? = null
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider = ReactModuleInfoProvider { HashMap() }
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
context = reactContext
return listOf(
HybridRNGoogleMapsPlusViewManager(),
)
}
object AppContextHolder {
lateinit var context: ReactApplicationContext
}
companion object {
init {
RNGoogleMapsPlusOnLoad.initializeNative()
}
}
}