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

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

Issue 1064983002: [Effen] basic layout container class for custom layout (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: it works! 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 | « no previous file | sky/framework/fn.dart » ('j') | sky/framework/fn.dart » ('J')
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/scroll_behavior.dart'; 5 import '../animation/scroll_behavior.dart';
6 import '../debug/tracing.dart'; 6 import '../debug/tracing.dart';
7 import '../fn.dart'; 7 import '../fn.dart';
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 import 'dart:sky' as sky; 9 import 'dart:sky' as sky;
10 import 'dart:async'; 10 import 'dart:async';
11 import 'scrollable.dart'; 11 import 'scrollable.dart';
12 import '../layouts/block.dart';
12 13
13 abstract class FixedHeightScrollable extends Scrollable { 14 abstract class FixedHeightScrollable extends Scrollable {
14 static final Style _style = new Style(''' 15 static final Style _style = new Style('''
15 overflow: hidden; 16 overflow: hidden;
16 position: relative; 17 position: relative;
17 will-change: transform;''' 18 will-change: transform;'''
18 ); 19 );
19 20
20 static final Style _scrollAreaStyle = new Style(''' 21 static final Style _scrollAreaStyle = new Style('''
21 position:relative; 22 position:relative;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 itemNumber = math.max(0, (drawStart / _itemHeight).floor()); 78 itemNumber = math.max(0, (drawStart / _itemHeight).floor());
78 79
79 transformStyle = 80 transformStyle =
80 'transform: translateY(${(alignmentDelta).toStringAsFixed(2)}px)'; 81 'transform: translateY(${(alignmentDelta).toStringAsFixed(2)}px)';
81 } 82 }
82 } 83 }
83 84
84 return new Container( 85 return new Container(
85 style: _style, 86 style: _style,
86 children: [ 87 children: [
87 new Container( 88 new BlockLayout(
88 style: _scrollAreaStyle, 89 style: _scrollAreaStyle,
89 inlineStyle: transformStyle, 90 inlineStyle: transformStyle,
90 children: buildItems(itemNumber, drawCount) 91 children: buildItems(itemNumber, drawCount)
91 ) 92 )
92 ] 93 ]
93 ); 94 );
94 } 95 }
95 } 96 }
OLDNEW
« no previous file with comments | « no previous file | sky/framework/fn.dart » ('j') | sky/framework/fn.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698