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

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

Issue 1231103005: Rename watchPerformance to watch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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/sdk/lib/widgets/popup_menu.dart ('k') | sky/sdk/lib/widgets/toggleable.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 'dart:sky' as sky; 5 import 'dart:sky' as sky;
6 6
7 import 'package:newton/newton.dart'; 7 import 'package:newton/newton.dart';
8 import 'package:sky/animation/animated_simulation.dart'; 8 import 'package:sky/animation/animated_simulation.dart';
9 import 'package:sky/animation/scroll_behavior.dart'; 9 import 'package:sky/animation/scroll_behavior.dart';
10 import 'package:sky/theme/view_configuration.dart' as config; 10 import 'package:sky/theme/view_configuration.dart' as config;
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 enum ScrollDirection { vertical, horizontal } 25 enum ScrollDirection { vertical, horizontal }
26 26
27 abstract class Scrollable extends StatefulComponent { 27 abstract class Scrollable extends StatefulComponent {
28 28
29 Scrollable({ 29 Scrollable({
30 String key, 30 String key,
31 this.backgroundColor, 31 this.backgroundColor,
32 this.direction: ScrollDirection.vertical 32 this.direction: ScrollDirection.vertical
33 }) : super(key: key) { 33 }) : super(key: key);
34 _animation = new AnimatedSimulation(_tickScrollOffset);
35 }
36 34
37 Color backgroundColor; 35 Color backgroundColor;
38 ScrollDirection direction; 36 ScrollDirection direction;
39 37
38 void initState() {
39 _animation = new AnimatedSimulation(_tickScrollOffset);
40 }
41
40 void syncFields(Scrollable source) { 42 void syncFields(Scrollable source) {
41 backgroundColor = source.backgroundColor; 43 backgroundColor = source.backgroundColor;
42 direction == source.direction; 44 direction == source.direction;
43 } 45 }
44 46
45 double _scrollOffset = 0.0; 47 double _scrollOffset = 0.0;
46 double get scrollOffset => _scrollOffset; 48 double get scrollOffset => _scrollOffset;
47 49
48 ScrollBehavior _scrollBehavior; 50 ScrollBehavior _scrollBehavior;
49 ScrollBehavior createScrollBehavior(); 51 ScrollBehavior createScrollBehavior();
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 167
166 void _handleFlingCancel(sky.GestureEvent event) { 168 void _handleFlingCancel(sky.GestureEvent event) {
167 settleScrollOffset(); 169 settleScrollOffset();
168 } 170 }
169 171
170 void _handleWheel(sky.WheelEvent event) { 172 void _handleWheel(sky.WheelEvent event) {
171 scrollBy(-event.offsetY); 173 scrollBy(-event.offsetY);
172 } 174 }
173 175
174 } 176 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/popup_menu.dart ('k') | sky/sdk/lib/widgets/toggleable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698