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

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

Issue 1001373002: Organize sky/framework/animation (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « sky/framework/animation/generators.dart ('k') | sky/framework/animation/scroll_curve.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/animation/scroll_behavior.dart
diff --git a/sky/framework/animation/scroll_curve.dart b/sky/framework/animation/scroll_behavior.dart
similarity index 79%
rename from sky/framework/animation/scroll_curve.dart
rename to sky/framework/animation/scroll_behavior.dart
index bee8ee9fa7aca47dfd2b3363861b9a3f88f511ed..433909cb2c21d189b8632a901305dec97370cc3a 100644
--- a/sky/framework/animation/scroll_curve.dart
+++ b/sky/framework/animation/scroll_behavior.dart
@@ -4,24 +4,24 @@
import 'dart:math' as math;
import 'mechanics.dart';
-import 'simulation.dart';
+import 'generators.dart';
const double _kSlope = 0.01;
-abstract class ScrollCurve {
+abstract class ScrollBehavior {
Simulation release(Particle particle) => null;
// Returns the new scroll offset.
- double apply(double scrollOffset, double scrollDelta);
+ double applyCurve(double scrollOffset, double scrollDelta);
}
-class BoundedScrollCurve extends ScrollCurve {
+class BoundedScrollBehavior extends ScrollBehavior {
double minOffset;
double maxOffset;
- BoundedScrollCurve({this.minOffset: 0.0, this.maxOffset});
+ BoundedScrollBehavior({this.minOffset: 0.0, this.maxOffset});
- double apply(double scrollOffset, double scrollDelta) {
+ double applyCurve(double scrollOffset, double scrollDelta) {
double newScrollOffset = scrollOffset + scrollDelta;
if (minOffset != null)
newScrollOffset = math.max(minOffset, newScrollOffset);
@@ -31,7 +31,7 @@ class BoundedScrollCurve extends ScrollCurve {
}
}
-class OverscrollCurve extends ScrollCurve {
+class OverscrollBehavior extends ScrollBehavior {
Simulation release(Particle particle) {
if (particle.position >= 0.0)
return null;
@@ -44,7 +44,7 @@ class OverscrollCurve extends ScrollCurve {
terminationCondition: () => particle.position == 0.0);
}
- double apply(double scrollOffset, double scrollDelta) {
+ double applyCurve(double scrollOffset, double scrollDelta) {
double newScrollOffset = scrollOffset + scrollDelta;
if (newScrollOffset < 0.0) {
// If we're overscrolling, we want move the scroll offset 2x slower than
« no previous file with comments | « sky/framework/animation/generators.dart ('k') | sky/framework/animation/scroll_curve.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698