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

Side by Side Diff: sky/sdk/lib/animation/animation_performance.dart

Issue 1232473003: Delete AnimationValue (Closed) Base URL: git@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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/animation/animated_value.dart ('k') | sky/sdk/lib/animation/generators.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'timeline.dart'; 5 import 'timeline.dart';
6 import 'curves.dart'; 6 import 'curves.dart';
7 7
8 // TODO(mpcomplete): merge this stuff with AnimatedValue somehow. We shouldn't
9 // have 2 different ways to animate values.
10 abstract class AnimatedVariable { 8 abstract class AnimatedVariable {
11 void setFraction(double t); 9 void setFraction(double t);
12 } 10 }
13 11
14 class AnimatedType<T extends dynamic> extends AnimatedVariable { 12 class AnimatedType<T extends dynamic> extends AnimatedVariable {
15 AnimatedType(this.begin, {this.end, this.curve: linear}) { 13 AnimatedType(this.begin, {this.end, this.curve: linear}) {
16 value = begin; 14 value = begin;
17 } 15 }
18 16
19 T value; 17 T value;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 timeline.stop(); 111 timeline.stop();
114 if (remainingDistance != 0.0) 112 if (remainingDistance != 0.0)
115 timeline.animateTo(target, duration: remainingDistance * duration.inMillis econds); 113 timeline.animateTo(target, duration: remainingDistance * duration.inMillis econds);
116 } 114 }
117 115
118 void _tick(double t) { 116 void _tick(double t) {
119 variable.setFraction(t); 117 variable.setFraction(t);
120 _notifyListeners(); 118 _notifyListeners();
121 } 119 }
122 } 120 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/animation/animated_value.dart ('k') | sky/sdk/lib/animation/generators.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698