Skip to content

Commit 71f558c

Browse files
committed
Fixing insets for non API 29 devices
1 parent a926095 commit 71f558c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

OneSignalSDK/onesignal/src/main/java/com/onesignal/OSViewUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ static int[] getCutoutAndStatusBarInsets(@NonNull Activity activity) {
8383
float leftInset = 0;
8484
float topInset = (frame.top - contentView.getTop()) / Resources.getSystem().getDisplayMetrics().density;
8585
float bottomInset = (contentView.getBottom() - frame.bottom) / Resources.getSystem().getDisplayMetrics().density;
86-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
86+
// API 29 is the only version where the IAM bleeds under cutouts in immersize mode
87+
// All other versions will not need left and right insets.
88+
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q) {
8789
DisplayCutout cutout = activity.getWindowManager().getDefaultDisplay().getCutout();
8890
if (cutout != null) {
8991
rightInset = cutout.getSafeInsetRight() / Resources.getSystem().getDisplayMetrics().density;

0 commit comments

Comments
 (0)