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

Unified Diff: sky/framework/elements/animation/controller.dart

Issue 1132063007: Rationalize Dart mojo and sky package structure (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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/framework/editing/keyboard.dart ('k') | sky/framework/elements/animation/timer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/elements/animation/controller.dart
diff --git a/sky/framework/elements/animation/controller.dart b/sky/framework/elements/animation/controller.dart
deleted file mode 100644
index 7e21923e9d33f749c27e5cf022bf2bd6c0518f02..0000000000000000000000000000000000000000
--- a/sky/framework/elements/animation/controller.dart
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import "../../animation/curves.dart";
-import "timer.dart";
-
-class AnimationController extends AnimationDelegate {
- final AnimationDelegate _delegate;
- AnimationTimer _timer;
- double _begin = 0.0;
- double _end = 0.0;
- Curve _curve;
- bool _isAnimating = false;
-
- AnimationController(this._delegate) {
- _timer = new AnimationTimer(this);
- }
-
- bool get isAnimating => _isAnimating;
-
- void start({double begin: 0.0, double end: 0.0, Curve curve: linear,
- double duration: 0.0}) {
- _begin = begin;
- _end = end;
- _curve = curve;
- _isAnimating = true;
- _timer.start(duration);
- }
-
- void stop() {
- _isAnimating = false;
- _timer.stop();
- }
-
- double _positionForTime(double t) {
- // Explicitly finish animations at |_end| in case the curve isn't an
- // exact numerical transform.
- if (t == 1)
- return _end;
- double curvedTime = _curve.transform(t);
- return _begin + (_end - _begin) * curvedTime;
- }
-
- void updateAnimation(double t) {
- _delegate.updateAnimation(_positionForTime(t));
- }
-}
« no previous file with comments | « sky/framework/editing/keyboard.dart ('k') | sky/framework/elements/animation/timer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698