Skip to content

Commit bb6e584

Browse files
committed
Add comment
1 parent eb03f83 commit bb6e584

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

android/src/main/java/com/swmansion/rnscreens/bottomsheet/SheetDelegate.kt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,18 +267,22 @@ class SheetDelegate(
267267
isKeyboardVisible = false
268268
}
269269

270+
// We're taking the metrics of the rootView, not screen to support nested navigators
270271
val availableHeight = screen.rootView.height
271272

272-
val metrics = getSheetMetrics(
273-
screen = screen,
274-
availableHeight = availableHeight,
275-
sheetHeight = screen.height
276-
)
277-
278-
val newTopInset = if (screen.isOverflowingStatusBar(prevInsets.top, metrics) && !isImeVisible)
279-
prevInsets.top - (metrics.availableHeight - metrics.maxSheetHeight)
280-
else
281-
0
273+
val metrics =
274+
getSheetMetrics(
275+
screen = screen,
276+
availableHeight = availableHeight,
277+
sheetHeight = screen.height,
278+
)
279+
280+
val newTopInset =
281+
if (screen.isOverflowingStatusBar(prevInsets.top, metrics) && !isImeVisible) {
282+
prevInsets.top - (metrics.availableHeight - metrics.maxSheetHeight)
283+
} else {
284+
0
285+
}
282286

283287
val newBottomInset = if (!isImeVisible) prevInsets.bottom else 0
284288

0 commit comments

Comments
 (0)