Skip to content

Commit 1cbdabc

Browse files
committed
Fixes after rebase
1 parent bcc5240 commit 1cbdabc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ class SheetDelegate(
132132
contentWrapper.isLaidOutOrHasCachedLayout()
133133
}
134134
}
135-
false -> (screen.sheetDetents.last() * containerHeight).toInt()
135+
false -> (screen.sheetDetents.highest() * containerHeight).toInt()
136136
}
137137

138138
// For 3 detents, we need to add the top inset back here because we are calculating the offset
139139
// from the absolute top of the view, but our calculated max height (containerHeight)
140140
// has been reduced by this inset.
141141
val expandedOffsetFromTop =
142-
when (screen.sheetDetents.count()) {
143-
3 -> ((1 - screen.sheetDetents[2]) * containerHeight).toInt() + lastTopInset
142+
when (screen.sheetDetents.count) {
143+
3 -> screen.sheetDetents.expandedOffsetFromTop(containerHeight, lastTopInset)
144144
else -> null
145145
}
146146

0 commit comments

Comments
 (0)