react-native-keyboard-controller 1.21.8 → 1.21.9

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.
@@ -94,7 +94,7 @@ class EdgeToEdgeReactViewGroup(
94
94
  this.deactivate()
95
95
  }
96
96
 
97
- override fun onConfigurationChanged(newConfig: Configuration?) {
97
+ override fun onConfigurationChanged(newConfig: Configuration) {
98
98
  this.reApplyWindowInsets()
99
99
  }
100
100
  // endregion
@@ -17,7 +17,7 @@ class KeyboardBackgroundViewGroup(
17
17
  }
18
18
 
19
19
  // theme changed
20
- override fun onConfigurationChanged(newConfig: Configuration?) {
20
+ override fun onConfigurationChanged(newConfig: Configuration) {
21
21
  super.onConfigurationChanged(newConfig)
22
22
  super.setBackgroundColor(reactContext.getInputMethodColor())
23
23
  }
@@ -1,17 +1,23 @@
1
1
  package com.reactnativekeyboardcontroller.views.overlay
2
2
 
3
3
  import android.view.MotionEvent
4
+ import android.view.View
4
5
  import android.view.ViewGroup
5
6
  import com.facebook.react.uimanager.JSPointerDispatcher
6
7
  import com.facebook.react.uimanager.events.EventDispatcher
7
8
  import java.lang.reflect.Method
8
9
 
9
10
  /**
10
- * Compat layer for `JSPointerDispatcher` interface for RN < 0.72
11
+ * Compat layer for `JSPointerDispatcher` interface for RN < 0.72.
12
+ *
13
+ * Uses composition instead of inheritance because `JSPointerDispatcher`
14
+ * became a final Kotlin class in RN 0.87+.
11
15
  */
12
16
  class JSPointerDispatcherCompat(
13
17
  viewGroup: ViewGroup,
14
- ) : JSPointerDispatcher(viewGroup) {
18
+ ) {
19
+ private val delegate = JSPointerDispatcher(viewGroup)
20
+
15
21
  private val handleMotionEventMethod: Method? by lazy {
16
22
  try {
17
23
  // Try to get the 3-parameter method (for RN >= 0.72)
@@ -42,13 +48,25 @@ class JSPointerDispatcherCompat(
42
48
  ) {
43
49
  handleMotionEventMethod?.let { method ->
44
50
  if (method.parameterCount == RN_72_PARAMS_COUNT) {
45
- method.invoke(this, event, eventDispatcher, isCapture)
51
+ method.invoke(delegate, event, eventDispatcher, isCapture)
46
52
  } else {
47
- method.invoke(this, event, eventDispatcher)
53
+ method.invoke(delegate, event, eventDispatcher)
48
54
  }
49
55
  }
50
56
  }
51
57
 
58
+ fun onChildStartedNativeGesture(
59
+ childView: View?,
60
+ ev: MotionEvent,
61
+ eventDispatcher: EventDispatcher,
62
+ ) {
63
+ delegate.onChildStartedNativeGesture(childView, ev, eventDispatcher)
64
+ }
65
+
66
+ fun onChildEndedNativeGesture() {
67
+ delegate.onChildEndedNativeGesture()
68
+ }
69
+
52
70
  companion object {
53
71
  private const val HANDLE_MOTION_EVENT = "handleMotionEvent"
54
72
  private const val RN_72_PARAMS_COUNT = 3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-keyboard-controller",
3
- "version": "1.21.8",
3
+ "version": "1.21.9",
4
4
  "description": "Keyboard manager which works in identical way on both iOS and Android",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",