Skip to content

Commit 222da7e

Browse files
authored
[0.78-stable] Android targetSdk 35 update - remove SafeAreaView and use padding (#99)
1 parent b14e500 commit 222da7e

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

template/App.tsx

+18-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import React from 'react';
99
import type {PropsWithChildren} from 'react';
1010
import {
11-
SafeAreaView,
1211
ScrollView,
1312
StatusBar,
1413
StyleSheet,
@@ -62,19 +61,33 @@ function App(): React.JSX.Element {
6261
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
6362
};
6463

64+
/*
65+
* To keep the template simple and small we're adding padding to prevent view
66+
* from rendering under the System UI.
67+
* For bigger apps the reccomendation is to use `react-native-safe-area-context`:
68+
* https://github.com/AppAndFlow/react-native-safe-area-context
69+
*
70+
* You can read more about it here:
71+
* https://github.com/react-native-community/discussions-and-proposals/discussions/827
72+
*/
73+
const safePadding = '5%';
74+
6575
return (
66-
<SafeAreaView style={backgroundStyle}>
76+
<View style={backgroundStyle}>
6777
<StatusBar
6878
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
6979
backgroundColor={backgroundStyle.backgroundColor}
7080
/>
7181
<ScrollView
72-
contentInsetAdjustmentBehavior="automatic"
7382
style={backgroundStyle}>
74-
<Header />
83+
<View style={{paddingRight: safePadding}}>
84+
<Header/>
85+
</View>
7586
<View
7687
style={{
7788
backgroundColor: isDarkMode ? Colors.black : Colors.white,
89+
paddingHorizontal: safePadding,
90+
paddingBottom: safePadding,
7891
}}>
7992
<Section title="Step One">
8093
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
@@ -92,7 +105,7 @@ function App(): React.JSX.Element {
92105
<LearnMoreLinks />
93106
</View>
94107
</ScrollView>
95-
</SafeAreaView>
108+
</View>
96109
);
97110
}
98111

template/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
buildToolsVersion = "35.0.0"
44
minSdkVersion = 24
55
compileSdkVersion = 35
6-
targetSdkVersion = 34
6+
targetSdkVersion = 35
77
ndkVersion = "27.1.12297006"
88
kotlinVersion = "2.0.21"
99
}

0 commit comments

Comments
 (0)