get Navigation Bar Stable Insets
Returns the navigation bar stable insets.
내비게이션 바의 stable insets를 반환합니다.
What are insets / Insets란:
Insets represent the space occupied by system UI elements from each screen edge. For example, if navigation bar at the bottom is 100px tall, bottom inset is 100. DisplayInfoBarInsets(top, bottom, left, right) provides insets for all four directions.
Insets는 각 화면 가장자리로부터 시스템 UI 요소가 차지하는 공간을 나타냅니다. 예를 들어 하단 내비게이션 바가 100px 높이면, bottom inset은 100입니다. DisplayInfoBarInsets(top, bottom, left, right)는 네 방향 모두의 insets를 제공합니다.
API version differences / API 버전별 차이:
API 30+ (R): Uses
WindowInsets.Type.navigationBars()to get all directional insets (top, bottom, left, right). Returns actual inset values for the direction where navigation bar appears.API 28-29: Uses
rootWindowInsets.stableInset*properties. Setstopto 0 explicitly to avoid confusion with status bar area, and usesbottom,left,rightfor navigation bar position.API 30+ (R):
WindowInsets.Type.navigationBars()를 사용하여 모든 방향의 insets(top, bottom, left, right)를 가져옵니다. 내비게이션 바가 나타나는 방향에 대한 실제 inset 값을 반환합니다.API 28-29:
rootWindowInsets.stableInset*속성을 사용합니다. 상태 바 영역과의 혼동을 피하기 위해top을 명시적으로 0으로 설정하고, 내비게이션 바 위치에 대해bottom,left,right를 사용합니다.
Return
DisplayInfoBarInsets(top, bottom, left, right) or null if unavailable.
- (0, 0, 0, 0): Gesture mode, hardware keys, or the app window doesn't reach that area (e.g., bottom split window).
- null: WindowInsets not yet received (called too early) or measurement unavailable.
DisplayInfoBarInsets(top, bottom, left, right) 또는 사용 불가능한 경우 null을 반환합니다.
- (0, 0, 0, 0): 제스처 모드, 하드웨어 키, 또는 앱 윈도우가 해당 영역에 닿지 않는 경우 (예: 분할 하단창).
- null: WindowInsets 미수신(너무 이른 호출) 또는 측정 불가입니다.
Parameters
Activity instance required for API 28-29 to access window.decorView.rootWindowInsets for app window-based insets. For API 30+, this parameter is ignored as currentWindowMetrics.windowInsets is used instead. Pass null if Activity is unavailable (returns null for API 28-29, valid insets for API 30+).
API 28-29에서 앱 윈도우 기준 insets를 얻기 위해 window.decorView.rootWindowInsets 접근에 필요한 Activity 인스턴스입니다. API 30+에서는 currentWindowMetrics.windowInsets를 사용하므로 이 파라미터는 무시됩니다. Activity를 사용할 수 없는 경우 null을 전달하면 API 28-29에서는 null을 반환하고, API 30+에서는 정상적인 insets를 반환합니다.