Skip to content

Commit

Permalink
Add some more debug-logging and use v5 in TE example
Browse files Browse the repository at this point in the history
  • Loading branch information
kkafar committed Aug 1, 2023
1 parent ed877e0 commit ae8d39e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
11 changes: 6 additions & 5 deletions TestsExample/src/Test1775.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import * as React from 'react';

import { View, Button } from 'react-native';

import { createNativeStackNavigator } from '@react-navigation/native-stack';
// import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createNativeStackNavigator } from 'react-native-screens/native-stack';
import { NavigationContainer, ParamListBase } from '@react-navigation/native';
import { NativeStackNavigationProp } from 'react-native-screens/native-stack';

Expand All @@ -19,16 +20,16 @@ function App() {
<Stack.Screen
name="HomeScreen"
component={HomeScreen}
options={{ orientation: 'portrait' }}
options={{ screenOrientation: 'portrait' }}
/>

<Stack.Screen
name="Landscape"
component={LandscapeScreen}
options={{
orientation: 'landscape_right',
animation: 'slide_from_right',
presentation: 'fullScreenModal',
screenOrientation: 'landscape_right',
stackAnimation: 'slide_from_bottom',
stackPresentation: 'fullScreenModal',
}}
/>
</Stack.Navigator>
Expand Down
8 changes: 8 additions & 0 deletions ios/RNSScreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,9 @@ - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask
- (void)didSetProps:(NSArray<NSString *> *)changedProps
{
[super didSetProps:changedProps];
if ([changedProps containsObject:@"stackPresentation"]) {
NSLog(@"RNSScreen %p has set stackPresentation to: %ld", self.controller, self.stackPresentation);
}
#if !TARGET_OS_TV
[self updatePresentationStyle];
#endif // !TARGET_OS_TV
Expand Down Expand Up @@ -1071,6 +1074,11 @@ - (UIViewController *)findChildVCForConfigAndTrait:(RNSWindowTrait)trait includi
if (modalScreen.screenView.stackPresentation == RNSScreenStackPresentationFullScreenModal) {
NSLog(@"RNSScreen %p presented another screen with full screen stack presentation", self);
return self;
} else {
NSLog(
@"RNSScreen %p presented another screen with stack presentation OTHER than full screen: %ld",
self,
modalScreen.screenView.stackPresentation);
}
// we don't want to allow controlling of status bar appearance when we present non-fullScreen modal
// and it is not possible if `modalPresentationCapturesStatusBarAppearance` is not set to YES, so even
Expand Down
5 changes: 3 additions & 2 deletions ios/UIViewController+RNScreens.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ - (UIInterfaceOrientationMask)reactNativeScreensSupportedInterfaceOrientations
if (childVC != nil) {
UIInterfaceOrientationMask mask = childVC.supportedInterfaceOrientations;
NSLog(
@"UIVC + RNS: found child VC for supported interface orientations: %@, with orientation mask %ld",
@"UIVC + RNS %p found child VC for supported interface orientations: %@, with orientation mask %ld",
self,
childVC,
mask);
return mask;
} else {
NSLog(@"UIVC + RNS: did NOT found child VC for supported interface orientations");
NSLog(@"UIVC + RNS %p did NOT found child VC for supported interface orientations", self);
return [self reactNativeScreensSupportedInterfaceOrientations];
}

Expand Down

0 comments on commit ae8d39e

Please sign in to comment.