Updated on 2026-08-14
This commit is contained in:
parent
e22641bb3f
commit
a3a6f43047
1 changed files with 11 additions and 4 deletions
|
|
@ -19,10 +19,17 @@ class NavBarInsetsFragmentLifecycleCallback : FragmentLifecycleCallbacks() {
|
|||
) {
|
||||
if (v is ComposeView) return
|
||||
ViewCompat.setOnApplyWindowInsetsListener(v) { view, windowInsets ->
|
||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
||||
view.updatePadding(
|
||||
bottom = insets.bottom,
|
||||
)
|
||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.statusBars())
|
||||
if (view.fitsSystemWindows) {
|
||||
view.updatePadding(
|
||||
top = insets.top,
|
||||
bottom = insets.bottom,
|
||||
)
|
||||
} else {
|
||||
view.updatePadding(
|
||||
bottom = insets.bottom,
|
||||
)
|
||||
}
|
||||
windowInsets
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue