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

Side by Side Diff: sky/sdk/lib/framework/widgets/scrollable.dart

Issue 1177243002: Refactor fn2.dart, since it breached our 1000-line threshold. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
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 'dart:math' as math;
6 import 'dart:sky' as sky;
7
5 import '../animation/generators.dart'; 8 import '../animation/generators.dart';
6 import '../animation/mechanics.dart'; 9 import '../animation/mechanics.dart';
7 import '../animation/scroll_behavior.dart'; 10 import '../animation/scroll_behavior.dart';
8 import '../fn2.dart';
9 import '../theme/view_configuration.dart' as config; 11 import '../theme/view_configuration.dart' as config;
10 import 'dart:math' as math; 12 import 'wrappers.dart';
11 import 'dart:sky' as sky;
12 13
13 const double _kMillisecondsPerSecond = 1000.0; 14 const double _kMillisecondsPerSecond = 1000.0;
14 15
15 double _velocityForFlingGesture(sky.GestureEvent event) { 16 double _velocityForFlingGesture(sky.GestureEvent event) {
16 return math.max(-config.kMaxFlingVelocity, math.min(config.kMaxFlingVelocity, 17 return math.max(-config.kMaxFlingVelocity, math.min(config.kMaxFlingVelocity,
17 -event.velocityY)) / _kMillisecondsPerSecond; 18 -event.velocityY)) / _kMillisecondsPerSecond;
18 } 19 }
19 20
20 abstract class ScrollClient { 21 abstract class ScrollClient {
21 bool ancestorScrolled(Scrollable ancestor); 22 bool ancestorScrolled(Scrollable ancestor);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 144
144 void _handleFlingCancel(sky.GestureEvent event) { 145 void _handleFlingCancel(sky.GestureEvent event) {
145 _startSimulation(_createParticle()); 146 _startSimulation(_createParticle());
146 } 147 }
147 148
148 void _handleWheel(sky.WheelEvent event) { 149 void _handleWheel(sky.WheelEvent event) {
149 scrollBy(-event.offsetY); 150 scrollBy(-event.offsetY);
150 } 151 }
151 152
152 } 153 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/framework/widgets/scaffold.dart ('k') | sky/sdk/lib/framework/widgets/tool_bar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698