Skip to content

Commit 4c69bc1

Browse files
committed
Use safe area in example
1 parent 3cab311 commit 4c69bc1

2 files changed

Lines changed: 31 additions & 25 deletions

File tree

example/ios/Podfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PODS:
88
- hermes-engine (0.82.0):
99
- hermes-engine/Pre-built (= 0.82.0)
1010
- hermes-engine/Pre-built (0.82.0)
11-
- livekit-react-native (2.10.1):
11+
- livekit-react-native (2.11.0-beta.1):
1212
- boost
1313
- DoubleConversion
1414
- fast_float
@@ -1814,7 +1814,7 @@ PODS:
18141814
- React-RCTFBReactNativeSpec
18151815
- ReactCommon/turbomodule/core
18161816
- SocketRocket
1817-
- react-native-safe-area-context (5.6.1):
1817+
- react-native-safe-area-context (5.7.0):
18181818
- boost
18191819
- DoubleConversion
18201820
- fast_float
@@ -1832,8 +1832,8 @@ PODS:
18321832
- React-graphics
18331833
- React-ImageManager
18341834
- React-jsi
1835-
- react-native-safe-area-context/common (= 5.6.1)
1836-
- react-native-safe-area-context/fabric (= 5.6.1)
1835+
- react-native-safe-area-context/common (= 5.7.0)
1836+
- react-native-safe-area-context/fabric (= 5.7.0)
18371837
- React-NativeModulesApple
18381838
- React-RCTFabric
18391839
- React-renderercss
@@ -1844,7 +1844,7 @@ PODS:
18441844
- ReactCommon/turbomodule/core
18451845
- SocketRocket
18461846
- Yoga
1847-
- react-native-safe-area-context/common (5.6.1):
1847+
- react-native-safe-area-context/common (5.7.0):
18481848
- boost
18491849
- DoubleConversion
18501850
- fast_float
@@ -1872,7 +1872,7 @@ PODS:
18721872
- ReactCommon/turbomodule/core
18731873
- SocketRocket
18741874
- Yoga
1875-
- react-native-safe-area-context/fabric (5.6.1):
1875+
- react-native-safe-area-context/fabric (5.7.0):
18761876
- boost
18771877
- DoubleConversion
18781878
- fast_float
@@ -2790,9 +2790,9 @@ SPEC CHECKSUMS:
27902790
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
27912791
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
27922792
hermes-engine: 8642d8f14a548ab718ec112e9bebdfdd154138b5
2793-
livekit-react-native: d3bef98b710d5f0fb6ad1c7734c954ddde910150
2793+
livekit-react-native: a051e6aa4c21e1b2429d136a3d544ae0ccfa08a6
27942794
livekit-react-native-webrtc: 6fc2ff1df5af82d1adb25828ba14a90380a2073e
2795-
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
2795+
RCT-Folly: 59ec0ac1f2f39672a0c6e6cecdd39383b764646f
27962796
RCTDeprecation: f17e2ebc07876ca9ab8eb6e4b0a4e4647497ae3a
27972797
RCTRequired: e2c574c1b45231f7efb0834936bd609d75072b63
27982798
RCTTypeSafety: c693294e3993056955c3010eb1ebc574f1fcded6
@@ -2825,7 +2825,7 @@ SPEC CHECKSUMS:
28252825
React-logger: 500f2fa5697d224e63c33d913c8a4765319e19bf
28262826
React-Mapbuffer: 06d59c448da7e34eb05b3fb2189e12f6a30fec57
28272827
React-microtasksnativemodule: d1ee999dc9052e23f6488b730fa2d383a4ea40e5
2828-
react-native-safe-area-context: c6e2edd1c1da07bdce287fa9d9e60c5f7b514616
2828+
react-native-safe-area-context: befb5404eb8a16fdc07fa2bebab3568ecabcbb8a
28292829
React-NativeModulesApple: 46690a0fe94ec28fc6fc686ec797b911d251ded0
28302830
React-oscompat: 95875e81f5d4b3c7b2c888d5bd2c9d83450d8bdb
28312831
React-perflogger: 2e229bf33e42c094fd64516d89ec1187a2b79b5b

example/src/RoomPage.tsx

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type {
66

77
import {
88
StyleSheet,
9-
View,
109
FlatList,
1110
type ListRenderItem,
1211
findNodeHandle,
@@ -28,6 +27,11 @@ import {
2827
useRNE2EEManager,
2928
} from '@livekit/react-native';
3029
import { Platform } from 'react-native';
30+
import {
31+
SafeAreaProvider,
32+
SafeAreaView,
33+
initialWindowMetrics,
34+
} from 'react-native-safe-area-context';
3135
// @ts-ignore
3236
import {
3337
mediaDevices,
@@ -70,19 +74,21 @@ export const RoomPage = ({
7074
let e2eeOptions = e2ee ? { e2eeManager } : undefined;
7175

7276
return (
73-
<LiveKitRoom
74-
serverUrl={url}
75-
token={token}
76-
connect={true}
77-
options={{
78-
adaptiveStream: { pixelDensity: 'screen' },
79-
e2ee: e2eeOptions,
80-
}}
81-
audio={false}
82-
video={true}
83-
>
84-
<RoomView navigation={navigation} e2ee={e2ee} />
85-
</LiveKitRoom>
77+
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
78+
<LiveKitRoom
79+
serverUrl={url}
80+
token={token}
81+
connect={true}
82+
options={{
83+
adaptiveStream: { pixelDensity: 'screen' },
84+
e2ee: e2eeOptions,
85+
}}
86+
audio={false}
87+
video={true}
88+
>
89+
<RoomView navigation={navigation} e2ee={e2ee} />
90+
</LiveKitRoom>
91+
</SafeAreaProvider>
8692
);
8793
};
8894

@@ -176,7 +182,7 @@ const RoomView = ({ navigation, e2ee }: RoomViewProps) => {
176182
};
177183

178184
return (
179-
<View style={styles.container}>
185+
<SafeAreaView style={styles.container} edges={['top', 'bottom', 'left', 'right']}>
180186
{stageView}
181187
{otherParticipantsView}
182188
<RoomControls
@@ -241,7 +247,7 @@ const RoomView = ({ navigation, e2ee }: RoomViewProps) => {
241247
}}
242248
/>
243249
{screenCapturePickerView}
244-
</View>
250+
</SafeAreaView>
245251
);
246252
};
247253

0 commit comments

Comments
 (0)