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

Unified Diff: sky/framework/components/fixed_height_scrollable.dart

Issue 993033003: Move example fn widgets into sky/framework/components (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/framework/components/drawer_header.dart ('k') | sky/framework/components/floating_action_button.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/fixed_height_scrollable.dart
diff --git a/sky/examples/fn/widgets/fixedheightscrollable.dart b/sky/framework/components/fixed_height_scrollable.dart
similarity index 84%
rename from sky/examples/fn/widgets/fixedheightscrollable.dart
rename to sky/framework/components/fixed_height_scrollable.dart
index 4fee244c178644947c790993f3d3b7428873b4ba..22091c91955a76c795a46ee085b129c97918c798 100644
--- a/sky/examples/fn/widgets/fixedheightscrollable.dart
+++ b/sky/framework/components/fixed_height_scrollable.dart
@@ -1,18 +1,23 @@
-part of widgets;
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
-abstract class FixedHeightScrollable extends Component {
+import '../animation/fling-curve.dart';
+import '../fn.dart';
+import 'dart:sky' as sky;
+abstract class FixedHeightScrollable extends Component {
// TODO(rafaelw): This component really shouldn't have an opinion
// about how it is sized. The owning component should decide whether
// it's explicitly sized or flexible or whatever...
- static Style _style = new Style('''
+ static final Style _style = new Style('''
overflow: hidden;
position: relative;
flex: 1;
will-change: transform;'''
);
- static Style _scrollAreaStyle = new Style('''
+ static final Style _scrollAreaStyle = new Style('''
position:relative;
will-change: transform;'''
);
@@ -30,7 +35,12 @@ abstract class FixedHeightScrollable extends Component {
Object key,
this.minOffset,
this.maxOffset
- }) : super(key: key) {}
+ }) : super(key: key) {
+ events.listen('gestureflingstart', _handleFlingStart);
+ events.listen('gestureflingcancel', _handleFlingCancel);
+ events.listen('gesturescrollupdate', _handleScrollUpdate);
+ events.listen('wheel', _handleWheel);
+ }
List<Node> buildItems(int start, int count);
@@ -76,11 +86,7 @@ abstract class FixedHeightScrollable extends Component {
children: buildItems(itemNumber, drawCount)
)
]
- )
- ..events.listen('gestureflingstart', _handleFlingStart)
- ..events.listen('gestureflingcancel', _handleFlingCancel)
- ..events.listen('gesturescrollupdate', _handleScrollUpdate)
- ..events.listen('wheel', _handleWheel);
+ );
}
void didUnmount() {
« no previous file with comments | « sky/framework/components/drawer_header.dart ('k') | sky/framework/components/floating_action_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698