Fix issue where SystemWindwInsetsSetter didn't respect type on older API levels.

main
Alex Hart 2022-11-11 12:39:27 -04:00
rodzic 1ff16a2c18
commit 14549fd401
1 zmienionych plików z 14 dodań i 2 usunięć

Wyświetl plik

@ -25,11 +25,23 @@ object SystemWindowInsetsSetter {
insets.bottom insets.bottom
) )
} else { } else {
val top = if (insetType and WindowInsetsCompat.Type.statusBars() != 0) {
ViewUtil.getStatusBarHeight(view)
} else {
0
}
val bottom = if (insetType and WindowInsetsCompat.Type.navigationBars() != 0) {
ViewUtil.getNavigationBarHeight(view)
} else {
0
}
view.setPadding( view.setPadding(
0, 0,
ViewUtil.getStatusBarHeight(view), top,
0, 0,
ViewUtil.getNavigationBarHeight(view) bottom
) )
} }
} }