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

Side by Side Diff: sky/framework/components/scrollable.dart

Issue 1043283003: [Effen] s/Node/UINode/, s/Element/WrapperNode/, s/EventTarget/EventListenerNode/ (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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/framework/components/scaffold.dart ('k') | sky/framework/editing/editable_text.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 '../animation/generators.dart'; 5 import '../animation/generators.dart';
6 import '../animation/mechanics.dart'; 6 import '../animation/mechanics.dart';
7 import '../animation/scroll_behavior.dart'; 7 import '../animation/scroll_behavior.dart';
8 import '../fn.dart'; 8 import '../fn.dart';
9 import '../theme/view-configuration.dart' as config; 9 import '../theme/view-configuration.dart' as config;
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 10 matching lines...) Expand all
21 ScrollBehavior scrollBehavior; 21 ScrollBehavior scrollBehavior;
22 double get scrollOffset => _scrollOffset; 22 double get scrollOffset => _scrollOffset;
23 23
24 double _scrollOffset = 0.0; 24 double _scrollOffset = 0.0;
25 Simulation _simulation; 25 Simulation _simulation;
26 26
27 Scrollable({Object key, this.scrollBehavior}) : super(key: key) { 27 Scrollable({Object key, this.scrollBehavior}) : super(key: key) {
28 onDidUnmount(_stopSimulation); 28 onDidUnmount(_stopSimulation);
29 } 29 }
30 30
31 Node buildContent(); 31 UINode buildContent();
32 32
33 Node build() { 33 UINode build() {
34 return new EventTarget( 34 return new EventListenerNode(
35 buildContent(), 35 buildContent(),
36 onPointerDown: _handlePointerDown, 36 onPointerDown: _handlePointerDown,
37 onPointerUp: _handlePointerUpOrCancel, 37 onPointerUp: _handlePointerUpOrCancel,
38 onPointerCancel: _handlePointerUpOrCancel, 38 onPointerCancel: _handlePointerUpOrCancel,
39 onGestureFlingStart: _handleFlingStart, 39 onGestureFlingStart: _handleFlingStart,
40 onGestureFlingCancel: _handleFlingCancel, 40 onGestureFlingCancel: _handleFlingCancel,
41 onGestureScrollUpdate: _handleScrollUpdate, 41 onGestureScrollUpdate: _handleScrollUpdate,
42 onWheel: _handleWheel 42 onWheel: _handleWheel
43 ); 43 );
44 } 44 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 void _handleFlingCancel(sky.GestureEvent event) { 96 void _handleFlingCancel(sky.GestureEvent event) {
97 _startSimulation(_createParticle()); 97 _startSimulation(_createParticle());
98 } 98 }
99 99
100 void _handleWheel(sky.WheelEvent event) { 100 void _handleWheel(sky.WheelEvent event) {
101 scrollBy(-event.offsetY); 101 scrollBy(-event.offsetY);
102 } 102 }
103 } 103 }
OLDNEW
« no previous file with comments | « sky/framework/components/scaffold.dart ('k') | sky/framework/editing/editable_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698