react-native-keyboard-controller 1.18.0 → 1.18.2
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/managers/KeyboardControllerViewManagerImpl.kt +1 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/background/KeyboardBackgroundViewGroup.kt +3 -4
- package/ios/protocols/TextInput.swift +11 -7
- package/ios/views/KeyboardBackgroundViewManager.mm +7 -0
- package/ios/views/OverKeyboardViewManager.mm +5 -5
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@ package com.reactnativekeyboardcontroller.views.background
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
4
|
import android.content.res.Configuration
|
|
5
5
|
import android.view.WindowInsets
|
|
6
|
-
import com.facebook.react.uimanager.BackgroundStyleApplicator
|
|
7
6
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
8
7
|
import com.facebook.react.views.view.ReactViewGroup
|
|
9
8
|
|
|
@@ -14,18 +13,18 @@ class KeyboardBackgroundViewGroup(
|
|
|
14
13
|
// view mounted
|
|
15
14
|
override fun onAttachedToWindow() {
|
|
16
15
|
super.onAttachedToWindow()
|
|
17
|
-
|
|
16
|
+
super.setBackgroundColor(reactContext.getInputMethodColor())
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
// theme changed
|
|
21
20
|
override fun onConfigurationChanged(newConfig: Configuration?) {
|
|
22
21
|
super.onConfigurationChanged(newConfig)
|
|
23
|
-
|
|
22
|
+
super.setBackgroundColor(reactContext.getInputMethodColor())
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
// keyboard changed
|
|
27
26
|
override fun onApplyWindowInsets(insets: WindowInsets?): WindowInsets {
|
|
28
|
-
|
|
27
|
+
super.setBackgroundColor(reactContext.getInputMethodColor())
|
|
29
28
|
return super.onApplyWindowInsets(insets)
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -39,13 +39,17 @@ extension TextInput {
|
|
|
39
39
|
case .light:
|
|
40
40
|
return "light"
|
|
41
41
|
case .default:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
if #available(iOS 12.0, *) {
|
|
43
|
+
switch traitCollection.userInterfaceStyle {
|
|
44
|
+
case .dark:
|
|
45
|
+
return "dark"
|
|
46
|
+
case .light, .unspecified:
|
|
47
|
+
return "light"
|
|
48
|
+
@unknown default:
|
|
49
|
+
return "light"
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
return "light" // Default fallback for iOS < 12
|
|
49
53
|
}
|
|
50
54
|
@unknown default:
|
|
51
55
|
return "light"
|
|
@@ -158,10 +158,9 @@ RCT_EXPORT_VIEW_PROPERTY(visible, BOOL)
|
|
|
158
158
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
159
159
|
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
160
160
|
{
|
|
161
|
-
const auto &oldViewProps = *std::static_pointer_cast<const OverKeyboardViewProps>(_props);
|
|
162
161
|
const auto &newViewProps = *std::static_pointer_cast<const OverKeyboardViewProps>(props);
|
|
163
162
|
|
|
164
|
-
if (newViewProps.visible !=
|
|
163
|
+
if (newViewProps.visible != _visible) {
|
|
165
164
|
if (newViewProps.visible) {
|
|
166
165
|
[self show];
|
|
167
166
|
} else {
|
|
@@ -207,13 +206,14 @@ RCT_EXPORT_VIEW_PROPERTY(visible, BOOL)
|
|
|
207
206
|
if (_visible) {
|
|
208
207
|
return;
|
|
209
208
|
}
|
|
209
|
+
|
|
210
|
+
UIWindow *topWindow = [UIWindow topWindow];
|
|
210
211
|
_visible = true;
|
|
211
|
-
_contentView.frame =
|
|
212
|
+
_contentView.frame = topWindow.bounds;
|
|
212
213
|
_contentView.autoresizingMask =
|
|
213
214
|
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
214
|
-
[_touchHandler attachToView:_contentView];
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
[_touchHandler attachToView:_contentView];
|
|
217
217
|
[topWindow addSubview:_contentView];
|
|
218
218
|
}
|
|
219
219
|
|
package/package.json
CHANGED