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

Unified Diff: sky/framework/components/material.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/ink_splash.dart ('k') | sky/framework/components/menu_divider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/material.dart
diff --git a/sky/examples/fn/widgets/material.dart b/sky/framework/components/material.dart
similarity index 71%
rename from sky/examples/fn/widgets/material.dart
rename to sky/framework/components/material.dart
index b0a828295d6e653dfcba404c0d0fd19388081b7f..4e8d5f1a3ae8ecdfde3ac03eb394757f88e3755c 100644
--- a/sky/examples/fn/widgets/material.dart
+++ b/sky/framework/components/material.dart
@@ -1,10 +1,16 @@
-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 MaterialComponent extends Component {
+import '../fn.dart';
+import 'dart:sky' as sky;
+import 'dart:collection';
+import 'ink_splash.dart';
+abstract class Material extends Component {
static const _splashesKey = const Object();
- static Style _style = new Style('''
+ static final Style _style = new Style('''
transform: translateX(0);
position: absolute;
top: 0;
@@ -15,7 +21,11 @@ abstract class MaterialComponent extends Component {
LinkedHashSet<SplashAnimation> _splashes;
- MaterialComponent({ Object key }) : super(key: key);
+ Material({ Object key }) : super(key: key) {
+ events.listen('gesturescrollstart', _cancelSplashes);
+ events.listen('wheel', _cancelSplashes);
+ events.listen('pointerdown', _startSplash);
+ }
Node build() {
List<Node> children = [];
@@ -28,9 +38,7 @@ abstract class MaterialComponent extends Component {
style: _style,
children: children,
key: _splashesKey
- )..events.listen('gesturescrollstart', _cancelSplashes)
- ..events.listen('wheel', _cancelSplashes)
- ..events.listen('pointerdown', _startSplash);
+ );
}
sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingClientRect();
« no previous file with comments | « sky/framework/components/ink_splash.dart ('k') | sky/framework/components/menu_divider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698