|
|
@ -167,7 +167,10 @@ fun AdaptiveSheet(
|
|
|
|
.offset {
|
|
|
|
.offset {
|
|
|
|
IntOffset(
|
|
|
|
IntOffset(
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
anchoredDraggableState.offset.takeIf { it.isFinite() }?.roundToInt() ?: 0,
|
|
|
|
anchoredDraggableState.offset
|
|
|
|
|
|
|
|
.takeIf { it.isFinite() }
|
|
|
|
|
|
|
|
?.roundToInt()
|
|
|
|
|
|
|
|
?: 0,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.anchoredDraggable(
|
|
|
|
.anchoredDraggable(
|
|
|
@ -238,8 +241,13 @@ private fun <T> AnchoredDraggableState<T>.preUpPostDownNestedScrollConnection()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override suspend fun onPostFling(consumed: Velocity, available: Velocity): Velocity {
|
|
|
|
override suspend fun onPostFling(consumed: Velocity, available: Velocity): Velocity {
|
|
|
|
settle(velocity = available.toFloat())
|
|
|
|
val toFling = available.toFloat()
|
|
|
|
return available
|
|
|
|
return if (toFling > 0) {
|
|
|
|
|
|
|
|
settle(toFling)
|
|
|
|
|
|
|
|
available
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Velocity.Zero
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun Float.toOffset(): Offset = Offset(0f, this)
|
|
|
|
private fun Float.toOffset(): Offset = Offset(0f, this)
|
|
|
|