OLD | NEW |
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 '../rendering/box.dart'; | 8 import '../rendering/box.dart'; |
9 import '../theme/colors.dart'; | 9 import '../theme/colors.dart'; |
10 import 'animated_component.dart'; | 10 import 'animated_component.dart'; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 UINode build() { | 110 UINode build() { |
111 Matrix4 transform = new Matrix4.identity(); | 111 Matrix4 transform = new Matrix4.identity(); |
112 transform.translate(_position); | 112 transform.translate(_position); |
113 | 113 |
114 sky.Color maskColor = new sky.Color(((_position / _kWidth + 1) * 0xFF).floor
() << 24); | 114 sky.Color maskColor = new sky.Color(((_position / _kWidth + 1) * 0xFF).floor
() << 24); |
115 | 115 |
116 var mask = new EventListenerNode( | 116 var mask = new EventListenerNode( |
117 new Container( | 117 new Container( |
118 desiredSize: new sky.Size.infinite(), | 118 desiredSize: sky.Size.infinite, |
119 decoration: new BoxDecoration(backgroundColor: maskColor) | 119 decoration: new BoxDecoration(backgroundColor: maskColor) |
120 ), | 120 ), |
121 onGestureTap: controller.handleMaskTap, | 121 onGestureTap: controller.handleMaskTap, |
122 onGestureFlingStart: controller.handleFlingStart | 122 onGestureFlingStart: controller.handleFlingStart |
123 ); | 123 ); |
124 | 124 |
125 Material content = new Material( | 125 Material content = new Material( |
126 content: new Container( | 126 content: new Container( |
127 decoration: new BoxDecoration(backgroundColor: new sky.Color(0xFFFFFFFF)
), | 127 decoration: new BoxDecoration(backgroundColor: new sky.Color(0xFFFFFFFF)
), |
128 desiredSize: new sky.Size.fromWidth(_kWidth), | 128 desiredSize: new sky.Size.fromWidth(_kWidth), |
129 transform: transform, | 129 transform: transform, |
130 child: new BlockContainer(children: children) | 130 child: new BlockContainer(children: children) |
131 ), | 131 ), |
132 level: level); | 132 level: level); |
133 | 133 |
134 return new EventListenerNode( | 134 return new EventListenerNode( |
135 new StackContainer( | 135 new StackContainer( |
136 children: [ mask, content ] | 136 children: [ mask, content ] |
137 ), | 137 ), |
138 onPointerDown: controller.handlePointerDown, | 138 onPointerDown: controller.handlePointerDown, |
139 onPointerMove: controller.handlePointerMove, | 139 onPointerMove: controller.handlePointerMove, |
140 onPointerUp: controller.handlePointerUp, | 140 onPointerUp: controller.handlePointerUp, |
141 onPointerCancel: controller.handlePointerCancel | 141 onPointerCancel: controller.handlePointerCancel |
142 ); | 142 ); |
143 } | 143 } |
144 } | 144 } |
OLD | NEW |