diff --git a/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaUtils.java b/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaUtils.java index 6c903dd7..e7ee8e2a 100644 --- a/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaUtils.java +++ b/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaUtils.java @@ -19,7 +19,11 @@ return new EdgeInsets( insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), - insets.getSystemWindowInsetBottom(), + // System insets are more reliable to account for notches but the + // system inset for bottom includes the soft keyboard which we don't + // want to be consistent with iOS. In practice it should always be + // correct since there cannot be a notch on this edge. + insets.getStableInsetBottom(), insets.getSystemWindowInsetLeft()); } else { Rect visibleRect = new Rect(); diff --git a/example/src/HooksExample.tsx b/example/src/HooksExample.tsx index 5ed6248a..3fdd8599 100644 --- a/example/src/HooksExample.tsx +++ b/example/src/HooksExample.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { View, Text, StatusBar, ScrollView } from 'react-native'; +import { View, Text, StatusBar, ScrollView, TextInput } from 'react-native'; import { SafeAreaProvider, @@ -63,6 +63,9 @@ function SimpleExampleScreen() { }} > + + +