From ba2fb3cf3132c987482d5ed17d789d8dabde5ab6 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Mon, 6 Jul 2015 16:46:02 -0400 Subject: [PATCH] Fix regressions with Drawer animations that I introduced. - The drawer mask was too dark. - The drawer didn't track the user's finger when dragging. R=ianh@google.com Review URL: https://codereview.chromium.org/1220973005. --- sdk/lib/widgets/drawer.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/lib/widgets/drawer.dart b/sdk/lib/widgets/drawer.dart index 8ff37b6da..ca4f9de14 100644 --- a/sdk/lib/widgets/drawer.dart +++ b/sdk/lib/widgets/drawer.dart @@ -27,7 +27,10 @@ import 'theme.dart'; const double _kWidth = 304.0; const double _kMinFlingVelocity = 0.4; const int _kBaseSettleDurationMS = 246; -const Curve _kAnimationCurve = parabolicRise; +// 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 +// initial timeline when animating (so it doesn't look linear). +const Curve _kAnimationCurve = linear; typedef void DrawerStatusChangeHandler (bool showing); @@ -117,7 +120,7 @@ class Drawer extends AnimatedComponent { // like fades, slides, rotates, pinch, etc. Widget build() { // TODO(mpcomplete): animate as a fade-in. - double scaler = controller.performance.progress + 1.0; + double scaler = controller.performance.progress; Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); var mask = new Listener( -- GitLab