Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
I used this before.
@OptIn(ExperimentalMaterialApi::class)
val BottomSheetScaffoldState.currentFraction: Float
get() {
val fraction = bottomSheetState.progress.fraction
val targetValue = bottomSheetState.targetValue
val currentValue = bottomSheetState.currentValue
return when {
currentValue == Collapsed && targetValue == Collapsed -> 0f
currentValue == Expanded && targetValue == Expanded -> 1f
currentValue == Collapsed && targetValue == Expanded -> fraction
else -> 1f - fraction
}
}
from
But the fraction
and targetValue
are not available in newer material lib version.
So I changed to the solution provided by #1, and observed the same behavior.
The requirement is simple: to have a value between 0 (collapsed) <-> 1 (expanded).
It'll be good if the lib provides this value then we don't have to calculate by self.
Description
The DrawModifier API needs improving: