Код: Выделить всё
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
return ComposeView(requireContext()).apply {
setContent {
val compatWindowInsets = WindowInsetsCompat.toWindowInsetsCompat(view?.rootWindowInsets!!, view)
val systemInsetTypesMask = WindowInsetsCompat.Type.navigationBars()
val viewSystemInsets = compatWindowInsets.getInsets(systemInsetTypesMask)
println("---> View: ${viewSystemInsets.bottom}")
val composeSystemInsets = WindowInsets.navigationBars
println("---> Compose: ${composeSystemInsets.getBottom(LocalDensity.current)}")
...
}
}
}
Код: Выделить всё
---> View: 126
---> Compose: 126
Код: Выделить всё
---> View: 126
---> Compose: 0
Подробнее здесь: https://stackoverflow.com/questions/776 ... oid-api-30
Мобильная версия