-
-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathKeyboardControllerModule.kt
More file actions
65 lines (53 loc) · 1.51 KB
/
KeyboardControllerModule.kt
File metadata and controls
65 lines (53 loc) · 1.51 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.reactnativekeyboardcontroller
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.reactnativekeyboardcontroller.modules.KeyboardControllerModuleImpl
class KeyboardControllerModule(
mReactContext: ReactApplicationContext,
) : ReactContextBaseJavaModule(mReactContext) {
private val module = KeyboardControllerModuleImpl(mReactContext)
override fun getName(): String = KeyboardControllerModuleImpl.NAME
override fun getConstants(): MutableMap<String, Any> = module.getConstants()
@ReactMethod
fun setInputMode(mode: Int) {
module.setInputMode(mode)
}
@ReactMethod
fun setDefaultMode() {
module.setDefaultMode()
}
@ReactMethod
fun preload() {
module.preload()
}
@ReactMethod
fun dismiss(
keepFocus: Boolean,
animated: Boolean,
) {
module.dismiss(keepFocus, animated)
}
@ReactMethod
fun setFocusTo(direction: String) {
module.setFocusTo(direction)
}
@ReactMethod
fun viewPositionInWindow(
viewTag: Double,
promise: Promise,
) {
module.viewPositionInWindow(viewTag, promise)
}
@Suppress("detekt:UnusedParameter")
@ReactMethod
fun addListener(eventName: String?) {
// Required for RN built-in Event Emitter Calls
}
@Suppress("detekt:UnusedParameter")
@ReactMethod
fun removeListeners(count: Int?) {
// Required for RN built-in Event Emitter Calls
}
}