Fixed
Status Update
Comments
co...@google.com <co...@google.com>
co...@google.com <co...@google.com>
na...@google.com <na...@google.com> #2
BTW, the source code for this is fairly straightforward. I just added the source into the sample for now, but it would be nicer if we had the function.
From source:
/**
* Gets the current navigation back stack entry as a [MutableState]. When the given navController
* changes the back stack due to a [NavController.navigate] or [NavController.popBackStack] this
* will trigger a recompose and return the top entry on the back stack.
*
* @return a mutable state of the current back stack entry
*/
@Composable
public fun NavController.currentBackStackEntryAsState(): State<NavBackStackEntry?> {
return currentBackStackEntryFlow.collectAsState(null)
}
Description
Snapshot: 12284019
It looks like velocity is not used in pane expansion so, regardless of how fast you fling, it will animate to the nearest anchor the moment the pointer up happens. It would be nice to take into account the velocity for both the animation and deciding the anchor to move to.
Attached is an example with anchors at 0, 25%, 50%, 75%, and 100%. It shows that you can carefully drag to either end and it works as expected but flings just stop abruptly at the nearest point.