Try to fix common issue with the top app bar (#6187)
The exception is: > Size(720 x -83) is out of range. Each dimension must be between 0 and 16777215. So forcing the height to at least 0 should fix it (although it might cause UI glitches?)
This commit is contained in:
parent
d430f308c1
commit
b8865d550d
1 changed files with 1 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ fun TopAppBarScrollBehaviorLayout(
|
|||
val contentHeight = placeable.height.toFloat()
|
||||
scrollBehavior.state.heightOffsetLimit = -contentHeight
|
||||
val heightOffset = scrollBehavior.state.heightOffset
|
||||
val layoutHeight = (contentHeight + heightOffset).toInt()
|
||||
val layoutHeight = (contentHeight + heightOffset).toInt().coerceAtLeast(0)
|
||||
layout(placeable.width, layoutHeight) {
|
||||
placeable.place(0, heightOffset.toInt())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue