Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt +2 −9 Original line number Diff line number Diff line Loading @@ -712,9 +712,7 @@ private class SwipeTransition( val hasReachedTargetScene = (targetScene == toScene && progress >= 1f) || (targetScene == fromScene && progress <= 0f) val skipAnimation = hasReachedTargetScene && currentOverscrollSpec?.transformationSpec?.transformations?.isEmpty() == true val skipAnimation = hasReachedTargetScene && !canOverscroll() return startOffsetAnimation { val animatable = Animatable(dragOffset, OffsetVisibilityThreshold) Loading Loading @@ -767,12 +765,7 @@ private class SwipeTransition( // Immediately stop this transition if we are bouncing on a // scene that does not bounce. val overscrollSpec = currentOverscrollSpec if ( overscrollSpec != null && overscrollSpec.transformationSpec.transformations .isEmpty() ) { if (!canOverscroll()) { snapToScene(targetScene) } } Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt +6 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,12 @@ sealed interface TransitionState { } } /** Returns if the [progress] value of this transition can go beyond range `[0; 1]` */ fun canOverscroll(): Boolean { val overscrollSpec = currentOverscrollSpec ?: return true return overscrollSpec.transformationSpec.transformations.isNotEmpty() } /** * An animatable that animates from 1f to 0f. This will be used to nicely animate the sudden * jump of values when this transitions interrupts another one. Loading Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt +2 −9 Original line number Diff line number Diff line Loading @@ -712,9 +712,7 @@ private class SwipeTransition( val hasReachedTargetScene = (targetScene == toScene && progress >= 1f) || (targetScene == fromScene && progress <= 0f) val skipAnimation = hasReachedTargetScene && currentOverscrollSpec?.transformationSpec?.transformations?.isEmpty() == true val skipAnimation = hasReachedTargetScene && !canOverscroll() return startOffsetAnimation { val animatable = Animatable(dragOffset, OffsetVisibilityThreshold) Loading Loading @@ -767,12 +765,7 @@ private class SwipeTransition( // Immediately stop this transition if we are bouncing on a // scene that does not bounce. val overscrollSpec = currentOverscrollSpec if ( overscrollSpec != null && overscrollSpec.transformationSpec.transformations .isEmpty() ) { if (!canOverscroll()) { snapToScene(targetScene) } } Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt +6 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,12 @@ sealed interface TransitionState { } } /** Returns if the [progress] value of this transition can go beyond range `[0; 1]` */ fun canOverscroll(): Boolean { val overscrollSpec = currentOverscrollSpec ?: return true return overscrollSpec.transformationSpec.transformations.isNotEmpty() } /** * An animatable that animates from 1f to 0f. This will be used to nicely animate the sudden * jump of values when this transitions interrupts another one. Loading