Fix issue where SystemWindwInsetsSetter didn't respect type on older API levels.
This commit is contained in:
parent
1ff16a2c18
commit
14549fd401
1 changed files with 14 additions and 2 deletions
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue