Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: sky/sdk/lib/widgets/dismissable.dart

Issue 1233653003: Add support for "flinging" the animation timeline with a spring force. So far, (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: . Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/animation/timeline.dart ('k') | sky/sdk/lib/widgets/drawer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/dismissable.dart
diff --git a/sky/sdk/lib/widgets/dismissable.dart b/sky/sdk/lib/widgets/dismissable.dart
index 829b7e3e978dd62a733a559efaba94fd29c00d6f..0c4363e335435b760ae799657f68a68a629a70bb 100644
--- a/sky/sdk/lib/widgets/dismissable.dart
+++ b/sky/sdk/lib/widgets/dismissable.dart
@@ -127,12 +127,9 @@ class Dismissable extends AnimatedComponent {
if (_isHorizontalFlingGesture(event)) {
_dragUnderway = false;
- double distance = 1.0 - _performance.progress;
- if (distance > 0.0) {
- double duration = _kCardDismissFadeout.inSeconds * distance / event.velocityX.abs();
- _dragX = event.velocityX.sign;
- _performance.timeline.animateTo(1.0, duration: duration);
- }
+ _dragX = event.velocityX.sign;
+ _position.end = _activeCardDragEndPoint;
+ _performance.fling(velocity: event.velocityX.abs() / _width);
}
}
« no previous file with comments | « sky/sdk/lib/animation/timeline.dart ('k') | sky/sdk/lib/widgets/drawer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698