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

Unified Diff: sky/framework/animation/animated_value.dart

Issue 1027633003: [Effen] Add AnimatedComponent base class (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: moar Created 5 years, 9 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
Index: sky/framework/animation/animated_value.dart
diff --git a/sky/framework/animation/animated_value.dart b/sky/framework/animation/animated_value.dart
index faf17b6a82b901a7bc9e3d45253a3cfa0cf36cf6..f8ae3526554dc33ca1f71d1bd52004bd56315ea7 100644
--- a/sky/framework/animation/animated_value.dart
+++ b/sky/framework/animation/animated_value.dart
@@ -13,7 +13,7 @@ class AnimatedValue {
double _value;
AnimatedValue(double initial) {
- value = initial;
+ _value = initial;
rafaelw 2015/03/20 05:36:00 Note: this prevents the initial value from being b
abarth-chromium 2015/03/20 05:41:49 Maybe add a comment explaining this subtle point?
rafaelw 2015/03/20 05:52:31 Done.
}
Stream<double> get onValueChanged => _controller.stream;
@@ -55,28 +55,3 @@ class AnimatedValue {
});
}
}
-
-class AnimatedValueListener {
- final Component _component;
- final AnimatedValue _value;
- StreamSubscription<double> _subscription;
-
- AnimatedValueListener(this._component, this._value);
-
- double get value => _value == null ? null : _value.value;
-
- void ensureListening() {
- if (_subscription != null || _value == null)
- return;
- _subscription = _value.onValueChanged.listen((_) {
- _component.scheduleBuild();
- });
- }
-
- void stopListening() {
- if (_subscription == null)
- return;
- _subscription.cancel();
- _subscription = null;
- }
-}
« no previous file with comments | « no previous file | sky/framework/components/animated_component.dart » ('j') | sky/framework/components/animated_component.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698