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

This commit is contained in:
Alex Hart 2022-11-11 12:39:27 -04:00
parent 1ff16a2c18
commit 14549fd401

View file

@ -25,11 +25,23 @@ object SystemWindowInsetsSetter {
insets.bottom
)
} 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(
0,
ViewUtil.getStatusBarHeight(view),
top,
0,
ViewUtil.getNavigationBarHeight(view)
bottom
)
}
}