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

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

Issue 1003553002: Update Button to be made of Material (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 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 '../animation/fling-curve.dart'; 5 import '../animation/fling-curve.dart';
6 import '../fn.dart'; 6 import '../fn.dart';
7 import 'dart:sky' as sky; 7 import 'dart:sky' as sky;
8 8
9 abstract class FixedHeightScrollable extends Component { 9 abstract class FixedHeightScrollable extends Component {
10 // TODO(rafaelw): This component really shouldn't have an opinion 10 // TODO(rafaelw): This component really shouldn't have an opinion
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 double drawStart = _scrollOffset + alignmentDelta; 73 double drawStart = _scrollOffset + alignmentDelta;
74 itemNumber = (drawStart / _itemHeight).floor(); 74 itemNumber = (drawStart / _itemHeight).floor();
75 75
76 transformStyle = 76 transformStyle =
77 'transform: translateY(${(alignmentDelta).toStringAsFixed(2)}px)'; 77 'transform: translateY(${(alignmentDelta).toStringAsFixed(2)}px)';
78 } 78 }
79 79
80 return new Container( 80 return new Container(
81 style: _style, 81 styles: [_style],
82 children: [ 82 children: [
83 new Container( 83 new Container(
84 style: _scrollAreaStyle, 84 styles: [_scrollAreaStyle],
85 inlineStyle: transformStyle, 85 inlineStyle: transformStyle,
86 children: buildItems(itemNumber, drawCount) 86 children: buildItems(itemNumber, drawCount)
87 ) 87 )
88 ] 88 ]
89 ); 89 );
90 } 90 }
91 91
92 void didUnmount() { 92 void didUnmount() {
93 _stopFling(); 93 _stopFling();
94 } 94 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 144
145 void _handleFlingCancel(sky.GestureEvent event) { 145 void _handleFlingCancel(sky.GestureEvent event) {
146 _stopFling(); 146 _stopFling();
147 } 147 }
148 148
149 void _handleWheel(sky.WheelEvent event) { 149 void _handleWheel(sky.WheelEvent event) {
150 _scrollBy(-event.offsetY); 150 _scrollBy(-event.offsetY);
151 } 151 }
152 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698