From 8604f2f8006847f38d80a4abd5854eefd58563bb Mon Sep 17 00:00:00 2001 From: Alan Lee Date: Thu, 9 Jan 2025 14:12:06 -0800 Subject: [PATCH 1/4] Just use hacky padding for both iOS and Android. Remove use of SafeAreaView and ScrollView.contentInsetAdjustmentBehavior prop. --- template/App.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/template/App.tsx b/template/App.tsx index 125fe1b..b7d248d 100644 --- a/template/App.tsx +++ b/template/App.tsx @@ -8,7 +8,6 @@ import React from 'react'; import type {PropsWithChildren} from 'react'; import { - SafeAreaView, ScrollView, StatusBar, StyleSheet, @@ -62,19 +61,25 @@ function App(): React.JSX.Element { backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, }; + // Note: adding hacky padding to avoid importing rn-safe-area-context library but should not be done in production + const hackyPadding = '5%'; + return ( - + -
+ +
+
Edit App.tsx to change this @@ -92,7 +97,7 @@ function App(): React.JSX.Element { - + ); } From f8f6969f82b76a64aa2c6472e31a392ea02ce5dc Mon Sep 17 00:00:00 2001 From: Alan Lee Date: Thu, 9 Jan 2025 14:12:39 -0800 Subject: [PATCH 2/4] update Android targetSdkVersion to 35 --- template/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/android/build.gradle b/template/android/build.gradle index a62d6da..9766946 100644 --- a/template/android/build.gradle +++ b/template/android/build.gradle @@ -3,7 +3,7 @@ buildscript { buildToolsVersion = "35.0.0" minSdkVersion = 24 compileSdkVersion = 35 - targetSdkVersion = 34 + targetSdkVersion = 35 ndkVersion = "27.1.12297006" kotlinVersion = "2.0.21" } From c8e219356f8ada48a83ddc39661a04e9a82c6088 Mon Sep 17 00:00:00 2001 From: Alan Lee <42583872+alanleedev@users.noreply.github.com> Date: Tue, 14 Jan 2025 07:42:45 -0800 Subject: [PATCH 3/4] Update template/App.tsx rename padding variable and add additional context on its use Co-authored-by: Nicola Corti --- template/App.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/template/App.tsx b/template/App.tsx index b7d248d..11851fa 100644 --- a/template/App.tsx +++ b/template/App.tsx @@ -61,8 +61,16 @@ function App(): React.JSX.Element { backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, }; - // Note: adding hacky padding to avoid importing rn-safe-area-context library but should not be done in production - const hackyPadding = '5%'; + /* + * To keep the template simple and small we're adding padding to prevent view + * from rendering under the System UI. + * For bigger apps the reccomendation is to use `react-native-safe-area-context`: + * https://github.com/AppAndFlow/react-native-safe-area-context + * + * You can read more about it here: + * https://github.com/react-native-community/discussions-and-proposals/discussions/827 + */ + const safePadding = '5%'; return ( From 9300cb5abe40b3da9fe58373d035172eb40b7487 Mon Sep 17 00:00:00 2001 From: Alan Lee Date: Tue, 14 Jan 2025 07:54:15 -0800 Subject: [PATCH 4/4] hackyPadding -> safePadding --- template/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/template/App.tsx b/template/App.tsx index 11851fa..b693003 100644 --- a/template/App.tsx +++ b/template/App.tsx @@ -62,7 +62,7 @@ function App(): React.JSX.Element { }; /* - * To keep the template simple and small we're adding padding to prevent view + * To keep the template simple and small we're adding padding to prevent view * from rendering under the System UI. * For bigger apps the reccomendation is to use `react-native-safe-area-context`: * https://github.com/AppAndFlow/react-native-safe-area-context @@ -80,14 +80,14 @@ function App(): React.JSX.Element { /> - +
Edit App.tsx to change this