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

Unified Diff: sky/sdk/lib/widgets/drawer.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/widgets/dismissable.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/drawer.dart
diff --git a/sky/sdk/lib/widgets/drawer.dart b/sky/sdk/lib/widgets/drawer.dart
index 7a9534965c9e80d39fec806e79ab38f84e1af33f..933f942f585e1985f45faa0b5817dfe07aba4c8d 100644
--- a/sky/sdk/lib/widgets/drawer.dart
+++ b/sky/sdk/lib/widgets/drawer.dart
@@ -30,7 +30,7 @@ import 'package:vector_math/vector_math.dart';
// The right nav can vary depending on content.
const double _kWidth = 304.0;
-const double _kMinFlingVelocity = 0.4;
+const double _kMinFlingVelocity = 1.2;
const Duration _kBaseSettleDuration = const Duration(milliseconds: 246);
// TODO(mpcomplete): The curve must be linear if we want the drawer to track
// the user's finger. Odeon remedies this by attaching spring forces to the
@@ -176,8 +176,8 @@ class Drawer extends AnimatedComponent {
}
void handleFlingStart(event) {
- double velocityX = event.velocityX / 1000;
+ double velocityX = event.velocityX / _kWidth;
if (velocityX.abs() >= _kMinFlingVelocity)
- _performance.fling(velocity: velocityX / _kWidth);
+ _performance.fling(velocity: velocityX);
}
}
« no previous file with comments | « sky/sdk/lib/widgets/dismissable.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698