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

Side by Side Diff: sky/sdk/lib/framework/components2/drawer.dart

Issue 1168203004: Add material shadows to toolbar and drawer (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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/sdk/lib/framework/components2/fixed_height_scrollable.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 '../animation/animated_value.dart'; 5 import '../animation/animated_value.dart';
6 import '../animation/curves.dart'; 6 import '../animation/curves.dart';
7 import '../fn2.dart'; 7 import '../fn2.dart';
8 import '../theme/colors.dart'; 8 import '../theme2/colors.dart';
9 import '../theme2/shadows.dart';
9 import 'animated_component.dart'; 10 import 'animated_component.dart';
10 import 'dart:math' as math; 11 import 'dart:math' as math;
11 import 'dart:sky' as sky; 12 import 'dart:sky' as sky;
12 import 'material.dart'; 13 import 'material.dart';
13 import 'package:vector_math/vector_math.dart'; 14 import 'package:vector_math/vector_math.dart';
14 15
15 const double _kWidth = 304.0; 16 const double _kWidth = 304.0;
16 const double _kMinFlingVelocity = 0.4; 17 const double _kMinFlingVelocity = 0.4;
17 const double _kBaseSettleDurationMS = 246.0; 18 const double _kBaseSettleDurationMS = 246.0;
18 const double _kMaxSettleDurationMS = 600.0; 19 const double _kMaxSettleDurationMS = 600.0;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 this.children, 104 this.children,
104 this.level: 0 105 this.level: 0
105 }) : super(key: key) { 106 }) : super(key: key) {
106 animateField(controller.position, #_position); 107 animateField(controller.position, #_position);
107 } 108 }
108 109
109 UINode build() { 110 UINode build() {
110 Matrix4 transform = new Matrix4.identity(); 111 Matrix4 transform = new Matrix4.identity();
111 transform.translate(_position); 112 transform.translate(_position);
112 113
113 Color maskColor = new Color(((_position / _kWidth + 1) * 0xFF).floor() << 24 ); 114 double scaler = _position / _kWidth + 1;
115 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0);
114 116
115 var mask = new EventListenerNode( 117 var mask = new EventListenerNode(
116 new Container(decoration: new BoxDecoration(backgroundColor: maskColor)), 118 new Container(decoration: new BoxDecoration(backgroundColor: maskColor)),
117 onGestureTap: controller.handleMaskTap, 119 onGestureTap: controller.handleMaskTap,
118 onGestureFlingStart: controller.handleFlingStart 120 onGestureFlingStart: controller.handleFlingStart
119 ); 121 );
120 122
121 Material content = new Material( 123 Container content = new Container(
122 content: new Container( 124 decoration: new BoxDecoration(
123 decoration: new BoxDecoration(backgroundColor: new Color(0xFFFFFFFF)), 125 backgroundColor: Grey[50],
124 width: _kWidth, 126 boxShadow: Shadow[level]),
125 transform: transform, 127 width: _kWidth,
126 child: new BlockContainer(children: children) 128 transform: transform,
127 ), 129 child: new BlockContainer(children: children)
128 level: level); 130 );
129 131
130 return new EventListenerNode( 132 return new EventListenerNode(
131 new StackContainer( 133 new StackContainer(
132 children: [ mask, content ] 134 children: [ mask, content ]
133 ), 135 ),
134 onPointerDown: controller.handlePointerDown, 136 onPointerDown: controller.handlePointerDown,
135 onPointerMove: controller.handlePointerMove, 137 onPointerMove: controller.handlePointerMove,
136 onPointerUp: controller.handlePointerUp, 138 onPointerUp: controller.handlePointerUp,
137 onPointerCancel: controller.handlePointerCancel 139 onPointerCancel: controller.handlePointerCancel
138 ); 140 );
139 } 141 }
140 } 142 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/framework/components2/fixed_height_scrollable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698