react-native-keyboard-controller 1.13.0 → 1.13.1
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.
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt +18 -11
- package/lib/commonjs/event-handler.d.js +6 -0
- package/lib/commonjs/event-handler.d.js.map +1 -0
- package/lib/module/event-handler.d.js +2 -0
- package/lib/module/event-handler.d.js.map +1 -0
- package/lib/module/event-handler.js +3 -2
- package/lib/module/event-handler.js.map +1 -1
- package/package.json +1 -1
- package/lib/typescript/event-handler.d.ts +0 -3
- /package/src/{event-handler.ts → event-handler.d.ts} +0 -0
package/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.reactnativekeyboardcontroller.views
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
|
+
import android.content.res.Configuration
|
|
4
5
|
import android.os.Handler
|
|
5
6
|
import android.os.Looper
|
|
6
7
|
import android.util.Log
|
|
@@ -68,6 +69,10 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R
|
|
|
68
69
|
|
|
69
70
|
this.removeKeyboardCallbacks()
|
|
70
71
|
}
|
|
72
|
+
|
|
73
|
+
override fun onConfigurationChanged(newConfig: Configuration?) {
|
|
74
|
+
this.reApplyWindowInsets()
|
|
75
|
+
}
|
|
71
76
|
// endregion
|
|
72
77
|
|
|
73
78
|
// region State manager helpers
|
|
@@ -83,25 +88,23 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R
|
|
|
83
88
|
|
|
84
89
|
val shouldApplyZeroPaddingTop = !active || this.isStatusBarTranslucent
|
|
85
90
|
val shouldApplyZeroPaddingBottom = !active || this.isNavigationBarTranslucent
|
|
91
|
+
val navBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
|
92
|
+
val systemBarInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
93
|
+
|
|
86
94
|
params.setMargins(
|
|
87
|
-
|
|
95
|
+
navBarInsets.left,
|
|
88
96
|
if (shouldApplyZeroPaddingTop) {
|
|
89
97
|
0
|
|
90
98
|
} else {
|
|
91
|
-
|
|
92
|
-
insets?.getInsets(WindowInsetsCompat.Type.systemBars())?.top
|
|
93
|
-
?: 0
|
|
94
|
-
)
|
|
99
|
+
systemBarInsets.top
|
|
95
100
|
},
|
|
96
|
-
|
|
101
|
+
navBarInsets.right,
|
|
97
102
|
if (shouldApplyZeroPaddingBottom) {
|
|
98
103
|
0
|
|
99
104
|
} else {
|
|
100
|
-
|
|
101
|
-
?: 0
|
|
105
|
+
navBarInsets.bottom
|
|
102
106
|
},
|
|
103
107
|
)
|
|
104
|
-
|
|
105
108
|
content?.layoutParams = params
|
|
106
109
|
|
|
107
110
|
val defaultInsets = ViewCompat.onApplyWindowInsets(v, insets)
|
|
@@ -164,6 +167,11 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R
|
|
|
164
167
|
// for more details
|
|
165
168
|
Handler(Looper.getMainLooper()).post { view.removeSelf() }
|
|
166
169
|
}
|
|
170
|
+
|
|
171
|
+
private fun reApplyWindowInsets() {
|
|
172
|
+
this.setupWindowInsets()
|
|
173
|
+
this.requestApplyInsetsWhenAttached()
|
|
174
|
+
}
|
|
167
175
|
// endregion
|
|
168
176
|
|
|
169
177
|
// region State managers
|
|
@@ -206,8 +214,7 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R
|
|
|
206
214
|
fun forceStatusBarTranslucent(isStatusBarTranslucent: Boolean) {
|
|
207
215
|
if (active && this.isStatusBarTranslucent != isStatusBarTranslucent) {
|
|
208
216
|
this.isStatusBarTranslucent = isStatusBarTranslucent
|
|
209
|
-
this.
|
|
210
|
-
this.requestApplyInsetsWhenAttached()
|
|
217
|
+
this.reApplyWindowInsets()
|
|
211
218
|
}
|
|
212
219
|
}
|
|
213
220
|
// endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["event-handler.d.ts"],"sourcesContent":["declare function registerEventHandler(\n handler: (event: never) => void,\n eventName: string,\n viewTag: number,\n): number;\ndeclare function unregisterEventHandler(id: number): void;\n\nexport { registerEventHandler, unregisterEventHandler };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["event-handler.d.ts"],"sourcesContent":["declare function registerEventHandler(\n handler: (event: never) => void,\n eventName: string,\n viewTag: number,\n): number;\ndeclare function unregisterEventHandler(id: number): void;\n\nexport { registerEventHandler, unregisterEventHandler };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["event-handler.
|
|
1
|
+
{"version":3,"names":["REACore","require","e1","e2","console","warn","registerEventHandler","unregisterEventHandler"],"sources":["event-handler.js"],"sourcesContent":["let REACore = null;\n\ntry {\n REACore = require(\"react-native-reanimated/src/core\");\n} catch (e1) {\n try {\n REACore = require(\"react-native-reanimated/src/reanimated2/core\");\n } catch (e2) {\n console.warn(\"Failed to load REACore from both paths\");\n }\n}\nconst registerEventHandler = REACore.registerEventHandler;\nconst unregisterEventHandler = REACore.unregisterEventHandler;\n\nexport { registerEventHandler, unregisterEventHandler };\n"],"mappings":"AAAA,IAAIA,OAAO,GAAG,IAAI;AAElB,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,kCAAkC,CAAC;AACvD,CAAC,CAAC,OAAOC,EAAE,EAAE;EACX,IAAI;IACFF,OAAO,GAAGC,OAAO,CAAC,8CAA8C,CAAC;EACnE,CAAC,CAAC,OAAOE,EAAE,EAAE;IACXC,OAAO,CAACC,IAAI,CAAC,wCAAwC,CAAC;EACxD;AACF;AACA,MAAMC,oBAAoB,GAAGN,OAAO,CAACM,oBAAoB;AACzD,MAAMC,sBAAsB,GAAGP,OAAO,CAACO,sBAAsB;AAE7D,SAASD,oBAAoB,EAAEC,sBAAsB","ignoreList":[]}
|
package/package.json
CHANGED
|
File without changes
|