Для хорошего безграничного дизайна IM в настоящее время реализует вставки.override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
ViewCompat.setOnApplyWindowInsetsListener(binding.root) {v, windowInsets ->
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
map?.setPadding(insets.left, 0, insets.right, insets.bottom)
pendingInsets = insets
windowInsets
}
< /code>
Теперь я пытаюсь сделать то же самое для моей поддержки.
< /code>
xml загружается при привязке. Я могу установить накладку Edgetoege вверху, как это: < /p>
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
requireActivity().enableEdgeToEdge()
// Handle Edge to Edge insets
ViewCompat.setOnApplyWindowInsetsListener(binding.root) {v, windowInsets ->
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
binding.layoutOtherInfo.updatePadding(bottom = insets.bottom, left = insets.left, right = insets.right)
// next line is important
binding.navigationFragment.setPadding(insets.left, insets.top, insets.right, 0)
windowInsets
}
// [...]
}
< /code>
Это приводит к цветной панели.
Что я пытаюсь архивировать, так это то, что карта отображается под строкой состояния и что «информация Nextstep» будет показана ниже.
, как я говорил ранее с простой картой, это возможно с SetPadding () есть что -то похожее на поддержку. taken from the Android Emulator:

This is what I want to archive, taken from the official google maps app (also from Emulator):
Подробнее здесь: https://stackoverflow.com/questions/797 ... from-googl
Мобильная версия