Updated on 2026-08-14
This commit is contained in:
parent
7dcf5f1e1e
commit
333bee7ef3
2 changed files with 9 additions and 5 deletions
|
|
@ -18,19 +18,22 @@ class NavBarInsetsFragmentLifecycleCallback : FragmentLifecycleCallbacks() {
|
|||
savedInstanceState: Bundle?,
|
||||
) {
|
||||
if (v is ComposeView) return
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(v) { view, windowInsets ->
|
||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.statusBars())
|
||||
val statusBarInsets = windowInsets.getInsets(WindowInsetsCompat.Type.statusBars())
|
||||
val navigationBarInsets = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
||||
|
||||
if (view.fitsSystemWindows) {
|
||||
view.updatePadding(
|
||||
top = insets.top,
|
||||
bottom = insets.bottom,
|
||||
top = statusBarInsets.top,
|
||||
bottom = navigationBarInsets.bottom,
|
||||
)
|
||||
} else {
|
||||
view.updatePadding(
|
||||
bottom = insets.bottom,
|
||||
bottom = navigationBarInsets.bottom,
|
||||
)
|
||||
}
|
||||
windowInsets
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroundWhite"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue