react-native-screens 3.35.0 → 3.37.0
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/README.md +4 -1
- package/android/build.gradle +10 -9
- package/android/src/fabric/java/com/swmansion/rnscreens/NativeProxy.kt +15 -2
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt +4 -2
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +30 -6
- package/android/src/main/java/com/swmansion/rnscreens/ScreensShadowNode.kt +4 -1
- package/android/src/main/java/com/swmansion/rnscreens/utils/ScreenDummyLayoutHelper.kt +6 -3
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerDelegate.java +3 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerInterface.java +2 -1
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +3 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +2 -1
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +3 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +2 -1
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderSubviewManagerDelegate.java +3 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderSubviewManagerInterface.java +2 -1
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerDelegate.java +3 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerInterface.java +2 -1
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerDelegate.java +4 -3
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerInterface.java +2 -1
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +1 -1
- package/cpp/RNSScreenRemovalListener.cpp +4 -2
- package/ios/RNSEnums.h +1 -1
- package/ios/RNSFullWindowOverlay.mm +4 -0
- package/ios/RNSScreen.mm +6 -1
- package/ios/RNSScreenContainer.mm +5 -0
- package/ios/RNSScreenStack.mm +8 -1
- package/ios/RNSScreenStackHeaderConfig.h +9 -6
- package/ios/RNSScreenStackHeaderConfig.mm +31 -21
- package/ios/RNSScreenStackHeaderSubview.mm +4 -0
- package/ios/utils/RNSDefines.h +25 -0
- package/lib/commonjs/components/ScreenStack.js +2 -2
- package/lib/commonjs/components/ScreenStack.js.map +1 -1
- package/lib/commonjs/components/SearchBar.js +2 -2
- package/lib/commonjs/components/SearchBar.js.map +1 -1
- package/lib/commonjs/gesture-handler/GestureDetectorProvider.js +2 -2
- package/lib/commonjs/gesture-handler/GestureDetectorProvider.js.map +1 -1
- package/lib/commonjs/gesture-handler/ScreenGestureDetector.js +12 -0
- package/lib/commonjs/gesture-handler/ScreenGestureDetector.js.map +1 -1
- package/lib/commonjs/gesture-handler/defaults.js +7 -1
- package/lib/commonjs/gesture-handler/defaults.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js +10 -8
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +8 -6
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +2 -2
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreen.js +2 -2
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +2 -2
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/module/components/ScreenStack.js +1 -1
- package/lib/module/components/ScreenStack.js.map +1 -1
- package/lib/module/components/SearchBar.js +1 -1
- package/lib/module/components/SearchBar.js.map +1 -1
- package/lib/module/gesture-handler/GestureDetectorProvider.js +1 -1
- package/lib/module/gesture-handler/GestureDetectorProvider.js.map +1 -1
- package/lib/module/gesture-handler/ScreenGestureDetector.js +12 -0
- package/lib/module/gesture-handler/ScreenGestureDetector.js.map +1 -1
- package/lib/module/gesture-handler/defaults.js +7 -1
- package/lib/module/gesture-handler/defaults.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js +3 -1
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +3 -1
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +1 -2
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreen.js +1 -2
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/typescript/components/Screen.d.ts +1 -1
- package/lib/typescript/components/Screen.d.ts.map +1 -1
- package/lib/typescript/components/Screen.web.d.ts +1 -1
- package/lib/typescript/components/Screen.web.d.ts.map +1 -1
- package/lib/typescript/components/ScreenContainer.d.ts +1 -1
- package/lib/typescript/components/ScreenContainer.d.ts.map +1 -1
- package/lib/typescript/components/ScreenStack.d.ts +1 -1
- package/lib/typescript/components/ScreenStack.d.ts.map +1 -1
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts +1 -1
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -1
- package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts +1 -1
- package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts.map +1 -1
- package/lib/typescript/components/SearchBar.d.ts +1 -1
- package/lib/typescript/components/SearchBar.d.ts.map +1 -1
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +1 -1
- package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts.map +1 -1
- package/lib/typescript/gesture-handler/defaults.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +1 -1
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +1 -1
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts.map +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts.map +1 -1
- package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts.map +1 -1
- package/package.json +36 -26
- package/src/components/Screen.tsx +1 -1
- package/src/components/Screen.web.tsx +1 -1
- package/src/components/ScreenContainer.tsx +1 -1
- package/src/components/ScreenStack.tsx +2 -1
- package/src/components/ScreenStackHeaderConfig.tsx +1 -1
- package/src/components/ScreenStackHeaderConfig.web.tsx +1 -1
- package/src/components/SearchBar.tsx +2 -5
- package/src/gesture-handler/GestureDetectorProvider.tsx +1 -1
- package/src/gesture-handler/ScreenGestureDetector.tsx +14 -2
- package/src/gesture-handler/defaults.ts +7 -0
- package/src/native-stack/types.tsx +1 -1
- package/src/native-stack/utils/getDefaultHeaderHeight.tsx +1 -1
- package/src/native-stack/views/HeaderConfig.tsx +7 -5
- package/src/native-stack/views/NativeStackView.tsx +4 -7
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +2 -2
- package/src/reanimated/ReanimatedScreen.tsx +2 -1
- package/src/reanimated/ReanimatedScreenProvider.tsx +2 -1
package/README.md
CHANGED
|
@@ -108,7 +108,9 @@ Screens are already integrated with the React Native's most popular navigation l
|
|
|
108
108
|
|
|
109
109
|
| library version | react-native version |
|
|
110
110
|
| --------------- | -------------------- |
|
|
111
|
-
| 3.
|
|
111
|
+
| 3.37.0+ | 0.76.0+ |
|
|
112
|
+
| 3.36.0+ | 0.73.0+ |
|
|
113
|
+
| 3.33.0+ | 0.72.0+ |
|
|
112
114
|
| 3.32.0+ | 0.71.0+ |
|
|
113
115
|
| 3.30.0+ | 0.68.0+ |
|
|
114
116
|
| 3.14.0+ | 0.64.0+ |
|
|
@@ -123,6 +125,7 @@ Here's a table with summary of supported `react-native` versions when Fabric is
|
|
|
123
125
|
|
|
124
126
|
| library version | react-native version |
|
|
125
127
|
| --------------- | -------------------- |
|
|
128
|
+
| 3.36.0+ | 0.77.0+ |
|
|
126
129
|
| 3.33.0+ | 0.75.0+ |
|
|
127
130
|
| 3.32.0+ | 0.74.0+ |
|
|
128
131
|
| 3.28.0+ | 0.73.0+ |
|
package/android/build.gradle
CHANGED
|
@@ -16,7 +16,7 @@ buildscript {
|
|
|
16
16
|
mavenCentral()
|
|
17
17
|
}
|
|
18
18
|
dependencies {
|
|
19
|
-
classpath('com.android.tools.build:gradle:
|
|
19
|
+
classpath('com.android.tools.build:gradle:8.2.1')
|
|
20
20
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', rnsDefaultKotlinVersion)}"
|
|
21
21
|
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
|
|
22
22
|
}
|
|
@@ -59,13 +59,7 @@ def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled()
|
|
|
59
59
|
|
|
60
60
|
android {
|
|
61
61
|
compileSdkVersion safeExtGet('compileSdkVersion', rnsDefaultCompileSdkVersion)
|
|
62
|
-
|
|
63
|
-
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
|
|
64
|
-
namespace "com.swmansion.rnscreens"
|
|
65
|
-
buildFeatures {
|
|
66
|
-
buildConfig true
|
|
67
|
-
}
|
|
68
|
-
}
|
|
62
|
+
namespace "com.swmansion.rnscreens"
|
|
69
63
|
|
|
70
64
|
// Used to override the NDK path/version on internal CI or by allowing
|
|
71
65
|
// users to customize the NDK path/version from their root project (e.g. for M1 support)
|
|
@@ -94,6 +88,7 @@ android {
|
|
|
94
88
|
}
|
|
95
89
|
buildFeatures {
|
|
96
90
|
prefab true
|
|
91
|
+
buildConfig true
|
|
97
92
|
}
|
|
98
93
|
externalNativeBuild {
|
|
99
94
|
cmake {
|
|
@@ -119,7 +114,13 @@ android {
|
|
|
119
114
|
"**/libc++_shared.so",
|
|
120
115
|
"**/libreact_render*.so",
|
|
121
116
|
"**/libreactnativejni.so",
|
|
122
|
-
"**/libreact_performance_timeline.so"
|
|
117
|
+
"**/libreact_performance_timeline.so",
|
|
118
|
+
// In 0.76 multiple react-native's libraries were merged and these are the main new artifacts we're using.
|
|
119
|
+
// Some of above lib* names could be removed after we remove support for 0.76.
|
|
120
|
+
// https://github.com/facebook/react-native/pull/43909
|
|
121
|
+
// https://github.com/facebook/react-native/pull/46059
|
|
122
|
+
"**/libfbjni.so",
|
|
123
|
+
"**/libreactnative.so"
|
|
123
124
|
]
|
|
124
125
|
}
|
|
125
126
|
sourceSets.main {
|
|
@@ -41,13 +41,26 @@ class NativeProxy {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
// Called from native
|
|
44
45
|
@DoNotStrip
|
|
45
46
|
public fun notifyScreenRemoved(screenTag: Int) {
|
|
46
|
-
|
|
47
|
+
// Since RN 0.78 the screenTag we receive as argument here might not belong to a screen
|
|
48
|
+
// owned by native stack, but e.g. to one parented by plain ScreenContainer, for which we
|
|
49
|
+
// currently do not want to start exiting transitions. Therefore is it left to caller to
|
|
50
|
+
// ensure that NativeProxy.viewsMap is filled only with screens belonging to screen stacks.
|
|
51
|
+
|
|
52
|
+
val weakScreeRef = viewsMap[screenTag]
|
|
53
|
+
|
|
54
|
+
// `screenTag` belongs to not observed screen or screen with such tag no longer exists.
|
|
55
|
+
if (weakScreeRef == null) {
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
val screen = weakScreeRef.get()
|
|
47
60
|
if (screen is Screen) {
|
|
48
61
|
screen.startRemovalTransition()
|
|
49
62
|
} else {
|
|
50
|
-
Log.w("[RNScreens]", "
|
|
63
|
+
Log.w("[RNScreens]", "Reference stored in NativeProxy for tag $screenTag no longer points to valid object.")
|
|
51
64
|
}
|
|
52
65
|
}
|
|
53
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
package com.swmansion.rnscreens
|
|
2
2
|
|
|
3
|
-
import com.facebook.react.
|
|
3
|
+
import com.facebook.react.BaseReactPackage
|
|
4
4
|
import com.facebook.react.bridge.NativeModule
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
6
|
import com.facebook.react.module.annotations.ReactModuleList
|
|
@@ -9,12 +9,14 @@ import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
|
9
9
|
import com.facebook.react.uimanager.ViewManager
|
|
10
10
|
import com.swmansion.rnscreens.utils.ScreenDummyLayoutHelper
|
|
11
11
|
|
|
12
|
+
// Fool autolinking for older versions that do not support BaseReactPackage.
|
|
13
|
+
// public class RNScreensPackage implements TurboReactPackage {
|
|
12
14
|
@ReactModuleList(
|
|
13
15
|
nativeModules = [
|
|
14
16
|
ScreensModule::class,
|
|
15
17
|
],
|
|
16
18
|
)
|
|
17
|
-
class RNScreensPackage :
|
|
19
|
+
class RNScreensPackage : BaseReactPackage() {
|
|
18
20
|
// We just retain it here. This object helps us tackle jumping content when using native header.
|
|
19
21
|
// See: https://github.com/software-mansion/react-native-screens/pull/2169
|
|
20
22
|
private var screenDummyLayoutHelper: ScreenDummyLayoutHelper? = null
|
|
@@ -160,9 +160,21 @@ class ScreenStack(
|
|
|
160
160
|
R.anim.rns_no_animation_medium,
|
|
161
161
|
)
|
|
162
162
|
StackAnimation.FADE_FROM_BOTTOM -> it.setCustomAnimations(R.anim.rns_fade_from_bottom, R.anim.rns_no_animation_350)
|
|
163
|
-
StackAnimation.IOS ->
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
StackAnimation.IOS ->
|
|
164
|
+
it.setCustomAnimations(
|
|
165
|
+
R.anim.rns_ios_from_right_foreground_open,
|
|
166
|
+
R.anim.rns_ios_from_right_background_open,
|
|
167
|
+
)
|
|
168
|
+
StackAnimation.IOS_FROM_RIGHT ->
|
|
169
|
+
it.setCustomAnimations(
|
|
170
|
+
R.anim.rns_ios_from_right_foreground_open,
|
|
171
|
+
R.anim.rns_ios_from_right_background_open,
|
|
172
|
+
)
|
|
173
|
+
StackAnimation.IOS_FROM_LEFT ->
|
|
174
|
+
it.setCustomAnimations(
|
|
175
|
+
R.anim.rns_ios_from_left_foreground_open,
|
|
176
|
+
R.anim.rns_ios_from_left_background_open,
|
|
177
|
+
)
|
|
166
178
|
}
|
|
167
179
|
} else {
|
|
168
180
|
when (stackAnimation) {
|
|
@@ -185,9 +197,21 @@ class ScreenStack(
|
|
|
185
197
|
R.anim.rns_slide_out_to_bottom,
|
|
186
198
|
)
|
|
187
199
|
StackAnimation.FADE_FROM_BOTTOM -> it.setCustomAnimations(R.anim.rns_no_animation_250, R.anim.rns_fade_to_bottom)
|
|
188
|
-
StackAnimation.IOS ->
|
|
189
|
-
|
|
190
|
-
|
|
200
|
+
StackAnimation.IOS ->
|
|
201
|
+
it.setCustomAnimations(
|
|
202
|
+
R.anim.rns_ios_from_right_foreground_close,
|
|
203
|
+
R.anim.rns_ios_from_right_background_close,
|
|
204
|
+
)
|
|
205
|
+
StackAnimation.IOS_FROM_RIGHT ->
|
|
206
|
+
it.setCustomAnimations(
|
|
207
|
+
R.anim.rns_ios_from_right_background_close,
|
|
208
|
+
R.anim.rns_ios_from_right_foreground_close,
|
|
209
|
+
)
|
|
210
|
+
StackAnimation.IOS_FROM_LEFT ->
|
|
211
|
+
it.setCustomAnimations(
|
|
212
|
+
R.anim.rns_ios_from_left_background_close,
|
|
213
|
+
R.anim.rns_ios_from_left_foreground_close,
|
|
214
|
+
)
|
|
191
215
|
}
|
|
192
216
|
}
|
|
193
217
|
}
|
|
@@ -11,7 +11,10 @@ internal class ScreensShadowNode(
|
|
|
11
11
|
) : LayoutShadowNode() {
|
|
12
12
|
override fun onBeforeLayout(nativeViewHierarchyOptimizer: NativeViewHierarchyOptimizer) {
|
|
13
13
|
super.onBeforeLayout(nativeViewHierarchyOptimizer)
|
|
14
|
-
(context.getNativeModule(UIManagerModule::class.java))?.addUIBlock { nativeViewHierarchyManager: NativeViewHierarchyManager ->
|
|
14
|
+
(context.getNativeModule(UIManagerModule::class.java))?.addUIBlock { nativeViewHierarchyManager: NativeViewHierarchyManager? ->
|
|
15
|
+
if (nativeViewHierarchyManager == null) {
|
|
16
|
+
return@addUIBlock
|
|
17
|
+
}
|
|
15
18
|
val view = nativeViewHierarchyManager.resolveView(reactTag)
|
|
16
19
|
if (view is ScreenContainer) {
|
|
17
20
|
view.performUpdates()
|
|
@@ -82,7 +82,9 @@ internal class ScreenDummyLayoutHelper(
|
|
|
82
82
|
// We need to use activity here, as react context does not have theme attributes required by
|
|
83
83
|
// AppBarLayout attached leading to crash.
|
|
84
84
|
val contextWithTheme =
|
|
85
|
-
requireNotNull(reactContext.currentActivity) {
|
|
85
|
+
requireNotNull(reactContext.currentActivity) {
|
|
86
|
+
"[RNScreens] Attempt to use context detached from activity. This could happen only due to race-condition."
|
|
87
|
+
}
|
|
86
88
|
|
|
87
89
|
synchronized(this) {
|
|
88
90
|
// The layout could have been initialised when this thread waited for access to critical section.
|
|
@@ -166,7 +168,7 @@ internal class ScreenDummyLayoutHelper(
|
|
|
166
168
|
// is still null at this execution point. We don't wanna crash in such case, thus returning zeroed height.
|
|
167
169
|
Log.e(
|
|
168
170
|
TAG,
|
|
169
|
-
"[RNScreens] Failed to late-init layout while computing header height. This is most likely a race-condition-bug in react-native-screens, please file an issue at https://github.com/software-mansion/react-native-screens/issues"
|
|
171
|
+
"[RNScreens] Failed to late-init layout while computing header height. This is most likely a race-condition-bug in react-native-screens, please file an issue at https://github.com/software-mansion/react-native-screens/issues",
|
|
170
172
|
)
|
|
171
173
|
return 0.0f
|
|
172
174
|
}
|
|
@@ -214,7 +216,8 @@ internal class ScreenDummyLayoutHelper(
|
|
|
214
216
|
private fun requireReactContext(lazyMessage: (() -> Any)? = null): ReactApplicationContext =
|
|
215
217
|
requireNotNull(
|
|
216
218
|
reactContextRef.get(),
|
|
217
|
-
lazyMessage ?: { "[RNScreens] Attempt to require missing react context" }
|
|
219
|
+
lazyMessage ?: { "[RNScreens] Attempt to require missing react context" },
|
|
220
|
+
)
|
|
218
221
|
|
|
219
222
|
private fun requireActivity(): Activity =
|
|
220
223
|
requireNotNull(requireReactContext().currentActivity) {
|
|
@@ -11,10 +11,11 @@ package com.facebook.react.viewmanagers;
|
|
|
11
11
|
|
|
12
12
|
import android.view.View;
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
14
15
|
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
15
|
-
import com.facebook.react.uimanager.
|
|
16
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
16
17
|
|
|
17
|
-
public class RNSScreenContainerManagerDelegate<T extends View, U extends
|
|
18
|
+
public class RNSScreenContainerManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNSScreenContainerManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
18
19
|
public RNSScreenContainerManagerDelegate(U viewManager) {
|
|
19
20
|
super(viewManager);
|
|
20
21
|
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java
CHANGED
|
@@ -13,10 +13,11 @@ import android.view.View;
|
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
14
|
import com.facebook.react.bridge.ColorPropConverter;
|
|
15
15
|
import com.facebook.react.bridge.ReadableMap;
|
|
16
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
16
17
|
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
17
|
-
import com.facebook.react.uimanager.
|
|
18
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
18
19
|
|
|
19
|
-
public class RNSScreenManagerDelegate<T extends View, U extends
|
|
20
|
+
public class RNSScreenManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNSScreenManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
20
21
|
public RNSScreenManagerDelegate(U viewManager) {
|
|
21
22
|
super(viewManager);
|
|
22
23
|
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java
CHANGED
|
@@ -13,7 +13,8 @@ import android.view.View;
|
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
14
|
import com.facebook.react.bridge.ReadableMap;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
public interface RNSScreenManagerInterface<T extends View> {
|
|
17
18
|
void setSheetAllowedDetents(T view, @Nullable String value);
|
|
18
19
|
void setSheetLargestUndimmedDetent(T view, @Nullable String value);
|
|
19
20
|
void setSheetGrabberVisible(T view, boolean value);
|
|
@@ -12,10 +12,11 @@ package com.facebook.react.viewmanagers;
|
|
|
12
12
|
import android.view.View;
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
14
|
import com.facebook.react.bridge.ColorPropConverter;
|
|
15
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
15
16
|
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
16
|
-
import com.facebook.react.uimanager.
|
|
17
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
17
18
|
|
|
18
|
-
public class RNSScreenStackHeaderConfigManagerDelegate<T extends View, U extends
|
|
19
|
+
public class RNSScreenStackHeaderConfigManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNSScreenStackHeaderConfigManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
19
20
|
public RNSScreenStackHeaderConfigManagerDelegate(U viewManager) {
|
|
20
21
|
super(viewManager);
|
|
21
22
|
}
|
|
@@ -12,7 +12,8 @@ package com.facebook.react.viewmanagers;
|
|
|
12
12
|
import android.view.View;
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
public interface RNSScreenStackHeaderConfigManagerInterface<T extends View> {
|
|
16
17
|
void setBackgroundColor(T view, @Nullable Integer value);
|
|
17
18
|
void setBackTitle(T view, @Nullable String value);
|
|
18
19
|
void setBackTitleFontFamily(T view, @Nullable String value);
|
|
@@ -11,10 +11,11 @@ package com.facebook.react.viewmanagers;
|
|
|
11
11
|
|
|
12
12
|
import android.view.View;
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
14
15
|
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
15
|
-
import com.facebook.react.uimanager.
|
|
16
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
16
17
|
|
|
17
|
-
public class RNSScreenStackHeaderSubviewManagerDelegate<T extends View, U extends
|
|
18
|
+
public class RNSScreenStackHeaderSubviewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNSScreenStackHeaderSubviewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
18
19
|
public RNSScreenStackHeaderSubviewManagerDelegate(U viewManager) {
|
|
19
20
|
super(viewManager);
|
|
20
21
|
}
|
|
@@ -12,6 +12,7 @@ package com.facebook.react.viewmanagers;
|
|
|
12
12
|
import android.view.View;
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
public interface RNSScreenStackHeaderSubviewManagerInterface<T extends View> {
|
|
16
17
|
void setType(T view, @Nullable String value);
|
|
17
18
|
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerDelegate.java
CHANGED
|
@@ -11,10 +11,11 @@ package com.facebook.react.viewmanagers;
|
|
|
11
11
|
|
|
12
12
|
import android.view.View;
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
14
15
|
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
15
|
-
import com.facebook.react.uimanager.
|
|
16
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
16
17
|
|
|
17
|
-
public class RNSScreenStackManagerDelegate<T extends View, U extends
|
|
18
|
+
public class RNSScreenStackManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNSScreenStackManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
18
19
|
public RNSScreenStackManagerDelegate(U viewManager) {
|
|
19
20
|
super(viewManager);
|
|
20
21
|
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerDelegate.java
CHANGED
|
@@ -13,10 +13,11 @@ import android.view.View;
|
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
14
|
import com.facebook.react.bridge.ColorPropConverter;
|
|
15
15
|
import com.facebook.react.bridge.ReadableArray;
|
|
16
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
16
17
|
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
17
|
-
import com.facebook.react.uimanager.
|
|
18
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
18
19
|
|
|
19
|
-
public class RNSSearchBarManagerDelegate<T extends View, U extends
|
|
20
|
+
public class RNSSearchBarManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNSSearchBarManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
20
21
|
public RNSSearchBarManagerDelegate(U viewManager) {
|
|
21
22
|
super(viewManager);
|
|
22
23
|
}
|
|
@@ -74,7 +75,7 @@ public class RNSSearchBarManagerDelegate<T extends View, U extends BaseViewManag
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
@Override
|
|
77
|
-
public void receiveCommand(T view, String commandName, ReadableArray args) {
|
|
78
|
+
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
|
|
78
79
|
switch (commandName) {
|
|
79
80
|
case "blur":
|
|
80
81
|
mViewManager.blur(view);
|
package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerInterface.java
CHANGED
|
@@ -12,7 +12,8 @@ package com.facebook.react.viewmanagers;
|
|
|
12
12
|
import android.view.View;
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
public interface RNSSearchBarManagerInterface<T extends View> {
|
|
16
17
|
void setHideWhenScrolling(T view, boolean value);
|
|
17
18
|
void setAutoCapitalize(T view, @Nullable String value);
|
|
18
19
|
void setPlaceholder(T view, @Nullable String value);
|
|
@@ -26,10 +26,10 @@ findHeaderConfigChild(const YogaLayoutableShadowNode &screenShadowNode) {
|
|
|
26
26
|
return {};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
#ifdef ANDROID
|
|
29
30
|
static constexpr const char *kScreenDummyLayoutHelperClass =
|
|
30
31
|
"com/swmansion/rnscreens/utils/ScreenDummyLayoutHelper";
|
|
31
32
|
|
|
32
|
-
#ifdef ANDROID
|
|
33
33
|
std::optional<float> findHeaderHeight(
|
|
34
34
|
const int fontSize,
|
|
35
35
|
const bool isTitleEmpty) {
|
|
@@ -10,8 +10,10 @@ std::optional<MountingTransaction> RNSScreenRemovalListener::pullTransaction(
|
|
|
10
10
|
for (const ShadowViewMutation &mutation : mutations) {
|
|
11
11
|
if (mutation.type == ShadowViewMutation::Type::Remove &&
|
|
12
12
|
mutation.oldChildShadowView.componentName != nullptr &&
|
|
13
|
-
strcmp(mutation.
|
|
14
|
-
|
|
13
|
+
strcmp(mutation.oldChildShadowView.componentName, "RNSScreen") == 0) {
|
|
14
|
+
// We call the listener function even if this screen has not been owned
|
|
15
|
+
// by RNSScreenStack as since RN 0.78 we do not have enough information
|
|
16
|
+
// here. This final filter is applied later in NativeProxy.
|
|
15
17
|
listenerFunction_(mutation.oldChildShadowView.tag);
|
|
16
18
|
}
|
|
17
19
|
}
|
package/ios/RNSEnums.h
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#import <UIKit/UIKit.h>
|
|
2
2
|
|
|
3
|
+
#import "RNSDefines.h"
|
|
3
4
|
#import "RNSFullWindowOverlay.h"
|
|
4
5
|
|
|
5
6
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -198,6 +199,8 @@
|
|
|
198
199
|
[childComponentView removeFromSuperview];
|
|
199
200
|
}
|
|
200
201
|
|
|
202
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
203
|
+
// We do not set frame for ouselves, but rather for the container.
|
|
201
204
|
- (void)updateLayoutMetrics:(react::LayoutMetrics const &)layoutMetrics
|
|
202
205
|
oldLayoutMetrics:(react::LayoutMetrics const &)oldLayoutMetrics
|
|
203
206
|
{
|
|
@@ -205,6 +208,7 @@
|
|
|
205
208
|
_reactFrame = frame;
|
|
206
209
|
[_container setFrame:frame];
|
|
207
210
|
}
|
|
211
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
208
212
|
|
|
209
213
|
#else
|
|
210
214
|
#pragma mark - Paper specific
|
package/ios/RNSScreen.mm
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
#import "RNSScreenStack.h"
|
|
26
26
|
#import "RNSScreenStackHeaderConfig.h"
|
|
27
27
|
|
|
28
|
+
#import "RNSDefines.h"
|
|
28
29
|
#import "UIView+RNSUtility.h"
|
|
29
30
|
|
|
30
31
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -109,10 +110,12 @@ namespace react = facebook::react;
|
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
113
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
112
114
|
- (NSArray<UIView *> *)reactSubviews
|
|
113
115
|
{
|
|
114
116
|
return _reactSubviews;
|
|
115
117
|
}
|
|
118
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
116
119
|
#endif
|
|
117
120
|
|
|
118
121
|
- (void)updateBounds
|
|
@@ -291,10 +294,12 @@ namespace react = facebook::react;
|
|
|
291
294
|
}
|
|
292
295
|
#endif
|
|
293
296
|
|
|
297
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
294
298
|
- (UIView *)reactSuperview
|
|
295
299
|
{
|
|
296
300
|
return _reactSuperview;
|
|
297
301
|
}
|
|
302
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
298
303
|
|
|
299
304
|
- (void)addSubview:(UIView *)view
|
|
300
305
|
{
|
|
@@ -1619,7 +1624,7 @@ RCT_ENUM_CONVERTER(
|
|
|
1619
1624
|
@"medium" : @(RNSScreenDetentTypeMedium),
|
|
1620
1625
|
@"all" : @(RNSScreenDetentTypeAll),
|
|
1621
1626
|
}),
|
|
1622
|
-
|
|
1627
|
+
RNSScreenDetentTypeLarge,
|
|
1623
1628
|
integerValue)
|
|
1624
1629
|
|
|
1625
1630
|
+ (UIInterfaceOrientationMask)UIInterfaceOrientationMask:(id)json
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#import "RNSScreenContainer.h"
|
|
2
|
+
#import "RNSDefines.h"
|
|
2
3
|
#import "RNSScreen.h"
|
|
3
4
|
|
|
4
5
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -89,6 +90,9 @@ namespace react = facebook::react;
|
|
|
89
90
|
[self updateContainer];
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
94
|
+
// We do not call super as we do not want to update UIKit model. It will
|
|
95
|
+
// be updated after we receive all mutations.
|
|
92
96
|
- (void)insertReactSubview:(RNSScreenView *)subview atIndex:(NSInteger)atIndex
|
|
93
97
|
{
|
|
94
98
|
subview.reactSuperview = self;
|
|
@@ -106,6 +110,7 @@ namespace react = facebook::react;
|
|
|
106
110
|
{
|
|
107
111
|
return _reactSubviews;
|
|
108
112
|
}
|
|
113
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
109
114
|
|
|
110
115
|
- (UIViewController *)reactViewController
|
|
111
116
|
{
|
package/ios/RNSScreenStack.mm
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#import "RCTTouchHandler+RNSUtility.h"
|
|
21
21
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
22
22
|
|
|
23
|
+
#import "RNSDefines.h"
|
|
23
24
|
#import "RNSScreen.h"
|
|
24
25
|
#import "RNSScreenStack.h"
|
|
25
26
|
#import "RNSScreenStackAnimator.h"
|
|
@@ -257,10 +258,12 @@ namespace react = facebook::react;
|
|
|
257
258
|
}
|
|
258
259
|
}
|
|
259
260
|
|
|
261
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
260
262
|
- (NSArray<UIView *> *)reactSubviews
|
|
261
263
|
{
|
|
262
264
|
return _reactSubviews;
|
|
263
265
|
}
|
|
266
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
264
267
|
|
|
265
268
|
- (void)didMoveToWindow
|
|
266
269
|
{
|
|
@@ -1048,6 +1051,9 @@ namespace react = facebook::react;
|
|
|
1048
1051
|
|
|
1049
1052
|
#endif // !TARGET_OS_TV
|
|
1050
1053
|
|
|
1054
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
1055
|
+
// We hijack the udpates as we don't want to update UIKit model yet.
|
|
1056
|
+
// This is done after all mutations are processed.
|
|
1051
1057
|
- (void)insertReactSubview:(RNSScreenView *)subview atIndex:(NSInteger)atIndex
|
|
1052
1058
|
{
|
|
1053
1059
|
if (![subview isKindOfClass:[RNSScreenView class]]) {
|
|
@@ -1063,6 +1069,7 @@ namespace react = facebook::react;
|
|
|
1063
1069
|
subview.reactSuperview = nil;
|
|
1064
1070
|
[_reactSubviews removeObject:subview];
|
|
1065
1071
|
}
|
|
1072
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
1066
1073
|
|
|
1067
1074
|
- (void)didUpdateReactSubviews
|
|
1068
1075
|
{
|
|
@@ -1186,7 +1193,7 @@ namespace react = facebook::react;
|
|
|
1186
1193
|
withSurfaceTelemetry:(const facebook::react::SurfaceTelemetry &)surfaceTelemetry
|
|
1187
1194
|
{
|
|
1188
1195
|
for (const auto &mutation : transaction.getMutations()) {
|
|
1189
|
-
if (mutation
|
|
1196
|
+
if (MUTATION_PARENT_TAG(mutation) == self.tag &&
|
|
1190
1197
|
(mutation.type == react::ShadowViewMutation::Type::Insert ||
|
|
1191
1198
|
mutation.type == react::ShadowViewMutation::Type::Remove)) {
|
|
1192
1199
|
// we need to wait until children have their layout set. At this point they don't have the layout
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
@interface NSString (RNSStringUtil)
|
|
13
13
|
|
|
14
|
-
+ (BOOL)RNSisBlank:(NSString *)string;
|
|
14
|
+
+ (BOOL)RNSisBlank:(nullable NSString *)string;
|
|
15
15
|
|
|
16
16
|
@end
|
|
17
17
|
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
@property (nonatomic) BOOL hide;
|
|
31
31
|
#endif
|
|
32
32
|
|
|
33
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
34
|
+
|
|
33
35
|
@property (nonatomic, retain) NSString *title;
|
|
34
36
|
@property (nonatomic, retain) NSString *titleFontFamily;
|
|
35
37
|
@property (nonatomic, retain) NSNumber *titleFontSize;
|
|
@@ -57,9 +59,11 @@
|
|
|
57
59
|
@property (nonatomic) UINavigationItemBackButtonDisplayMode backButtonDisplayMode;
|
|
58
60
|
@property (nonatomic) RNSBlurEffectStyle blurEffect;
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
NS_ASSUME_NONNULL_END
|
|
63
|
+
|
|
64
|
+
+ (void)willShowViewController:(nonnull UIViewController *)vc
|
|
61
65
|
animated:(BOOL)animated
|
|
62
|
-
withConfig:(RNSScreenStackHeaderConfig *)config;
|
|
66
|
+
withConfig:(nonnull RNSScreenStackHeaderConfig *)config;
|
|
63
67
|
|
|
64
68
|
@end
|
|
65
69
|
|
|
@@ -69,8 +73,7 @@
|
|
|
69
73
|
|
|
70
74
|
@interface RCTConvert (RNSScreenStackHeader)
|
|
71
75
|
|
|
72
|
-
+ (
|
|
73
|
-
+ (
|
|
74
|
-
+ (UINavigationItemBackButtonDisplayMode)UINavigationItemBackButtonDisplayMode:(id)json;
|
|
76
|
+
+ (UISemanticContentAttribute)UISemanticContentAttribute:(nonnull id)json;
|
|
77
|
+
+ (UINavigationItemBackButtonDisplayMode)UINavigationItemBackButtonDisplayMode:(nonnull id)json;
|
|
75
78
|
|
|
76
79
|
@end
|