@kobe-brants/react-native-keep-awake 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,11 +4,12 @@ import android.app.Activity
|
|
|
4
4
|
import android.view.WindowManager
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
6
|
import com.facebook.react.bridge.ReactMethod
|
|
7
|
+
import com.facebook.react.bridge.NativeModule
|
|
7
8
|
import com.facebook.react.module.annotations.ReactModule
|
|
8
9
|
|
|
9
10
|
@ReactModule(name = KeepAwakeModule.NAME)
|
|
10
11
|
class KeepAwakeModule(reactContext: ReactApplicationContext) :
|
|
11
|
-
NativeKeepAwakeSpec(reactContext) {
|
|
12
|
+
NativeKeepAwakeSpec(reactContext), NativeModule {
|
|
12
13
|
|
|
13
14
|
override fun getName(): String {
|
|
14
15
|
return NAME
|
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
package com.keepawake
|
|
2
2
|
|
|
3
|
-
import com.facebook.react.
|
|
3
|
+
import com.facebook.react.ReactPackage
|
|
4
4
|
import com.facebook.react.bridge.NativeModule
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.
|
|
7
|
-
import
|
|
8
|
-
import java.util.HashMap
|
|
6
|
+
import com.facebook.react.uimanager.ViewManager
|
|
7
|
+
import java.util.Collections
|
|
9
8
|
|
|
10
|
-
class KeepAwakePackage :
|
|
9
|
+
class KeepAwakePackage : ReactPackage {
|
|
11
10
|
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
12
11
|
return listOf(KeepAwakeModule(reactContext))
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
override fun
|
|
16
|
-
return
|
|
17
|
-
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
18
|
-
moduleInfos[KeepAwakeModule.NAME] = ReactModuleInfo(
|
|
19
|
-
KeepAwakeModule.NAME,
|
|
20
|
-
KeepAwakeModule.NAME,
|
|
21
|
-
false, // canOverrideExistingModule
|
|
22
|
-
false, // needsEagerInit
|
|
23
|
-
false, // isCxxModule
|
|
24
|
-
true // isTurboModule
|
|
25
|
-
)
|
|
26
|
-
moduleInfos
|
|
27
|
-
}
|
|
14
|
+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
15
|
+
return emptyList()
|
|
28
16
|
}
|
|
29
17
|
}
|