Safe area
Vehicles can have various shapes of displays (for example circle displays, displays with a rounded corner) so the app should be able to fit its content properly.
Navigation SDK UX Framework allows developers to set the margins around UI elements defining so-called "Safe Area" - it's a rectangular area the whole UI fits in (excluding the map, the map should take the whole available space).
To redefine these margins you need to call the DashPresenter.setSafeAreaPaddings function:
val presenter = DashPresenter(this)
presenter.setSafeAreaPaddings(300, 100, 200, 0)
setContent {
DashScreen(presenter = presenter)
}
Real-time updates are also supported:
presenter.setSafeAreaPaddings(300, 100, 200, 400)
The function can be called quite often to achieve animation effect.
この{Type}は役に立ちましたか?