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

Unified Diff: sky/framework/components/scrollable.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/components/ink_splash.dart ('k') | sky/framework/elements/animation/controller.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/scrollable.dart
diff --git a/sky/framework/components/scrollable.dart b/sky/framework/components/scrollable.dart
index e8169e5632c3996c952753684333c5c50c27bf21..0acc92b2749c46ef886f17718e44d026dbd98b89 100644
--- a/sky/framework/components/scrollable.dart
+++ b/sky/framework/components/scrollable.dart
@@ -4,15 +4,14 @@
import '../animation/curves.dart';
import '../animation/fling_curve.dart';
-import '../animation/generator.dart';
-import '../animation/scroll_curve.dart';
+import '../animation/generators.dart';
+import '../animation/scroll_behavior.dart';
import '../animation/mechanics.dart';
-import '../animation/simulation.dart';
import '../fn.dart';
import 'dart:sky' as sky;
abstract class Scrollable extends Component {
- ScrollCurve scrollCurve;
+ ScrollBehavior scrollBehavior;
double get scrollOffset => _scrollOffset;
double _scrollOffset = 0.0;
@@ -20,7 +19,7 @@ abstract class Scrollable extends Component {
int _flingAnimationId;
Simulation _simulation;
- Scrollable({Object key, this.scrollCurve}) : super(key: key) {
+ Scrollable({Object key, this.scrollBehavior}) : super(key: key) {
events.listen('pointerdown', _handlePointerDown);
events.listen('pointerup', _handlePointerUpOrCancel);
events.listen('pointercancel', _handlePointerUpOrCancel);
@@ -37,7 +36,7 @@ abstract class Scrollable extends Component {
}
bool scrollBy(double scrollDelta) {
- var newScrollOffset = scrollCurve.apply(_scrollOffset, scrollDelta);
+ var newScrollOffset = scrollBehavior.applyCurve(_scrollOffset, scrollDelta);
if (newScrollOffset == _scrollOffset)
return false;
setState(() {
@@ -75,7 +74,7 @@ abstract class Scrollable extends Component {
void _settle() {
_stopFling();
Particle particle = new Particle(position: scrollOffset);
- _simulation = scrollCurve.release(particle);
+ _simulation = scrollBehavior.release(particle);
if (_simulation == null)
return;
_simulation.onTick.listen((_) {
« no previous file with comments | « sky/framework/components/ink_splash.dart ('k') | sky/framework/elements/animation/controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698