Commit e99c880b authored by Adam Barth's avatar Adam Barth

Fix gesture events in fn2

This CL makes gesture events work again in fn2.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1146923005
parent d268da7a
...@@ -38,12 +38,17 @@ class ContainerApp extends App { ...@@ -38,12 +38,17 @@ class ContainerApp extends App {
), ),
])), ])),
]), ]),
onPointerDown: _handlePointerDown); onPointerDown: _handlePointerDown,
onGestureTap: _handleGestureTap);
} }
void _handlePointerDown(sky.PointerEvent event) { void _handlePointerDown(sky.PointerEvent event) {
print("_handlePointerDown"); print("_handlePointerDown");
} }
void _handleGestureTap(sky.GestureEvent event) {
print("_handleGestureTap");
}
} }
void main() { void main() {
......
...@@ -41,7 +41,7 @@ class SpriteBox extends RenderBox { ...@@ -41,7 +41,7 @@ class SpriteBox extends RenderBox {
size = constraints.constrain(new Size.infinite()); size = constraints.constrain(new Size.infinite());
} }
void handlePointer(PointerEvent event) { void handleEvent(Event event) {
switch (event.type) { switch (event.type) {
case 'pointerdown': case 'pointerdown':
print("pointerdown"); print("pointerdown");
......
...@@ -41,7 +41,7 @@ class InkSplash { ...@@ -41,7 +41,7 @@ class InkSplash {
class InkWell extends RenderBox { class InkWell extends RenderBox {
final List<InkSplash> _splashes = new List<InkSplash>(); final List<InkSplash> _splashes = new List<InkSplash>();
void handlePointer(sky.PointerEvent event) { void handleEvent(sky.Event event) {
switch (event.type) { switch (event.type) {
case 'pointerdown': case 'pointerdown':
_splashes.add(new InkSplash(position: new sky.Point(event.x, event.y), _splashes.add(new InkSplash(position: new sky.Point(event.x, event.y),
......
...@@ -482,7 +482,7 @@ class RenderSolidColor extends RenderDecoratedSector { ...@@ -482,7 +482,7 @@ class RenderSolidColor extends RenderDecoratedSector {
deltaTheta = constraints.constrainDeltaTheta(desiredDeltaTheta); deltaTheta = constraints.constrainDeltaTheta(desiredDeltaTheta);
} }
void handlePointer(sky.PointerEvent event) { void handleEvent(sky.Event event) {
if (event.type == 'pointerdown') if (event.type == 'pointerdown')
decoration = new BoxDecoration(backgroundColor: const sky.Color(0xFFFF0000)); decoration = new BoxDecoration(backgroundColor: const sky.Color(0xFFFF0000));
else if (event.type == 'pointerup') else if (event.type == 'pointerup')
......
...@@ -42,7 +42,7 @@ class RenderTouchDemo extends RenderBox { ...@@ -42,7 +42,7 @@ class RenderTouchDemo extends RenderBox {
RenderTouchDemo(); RenderTouchDemo();
void handlePointer(PointerEvent event) { void handleEvent(sky.Event event) {
switch (event.type) { switch (event.type) {
case 'pointerdown': case 'pointerdown':
int color = colors[event.pointer.remainder(colors.length)]; int color = colors[event.pointer.remainder(colors.length)];
......
...@@ -164,7 +164,7 @@ class StocksApp extends App { ...@@ -164,7 +164,7 @@ class StocksApp extends App {
return new ToolBar( return new ToolBar(
left: new IconButton( left: new IconButton(
icon: 'navigation/menu_white', icon: 'navigation/menu_white',
onGestureTap: (_) => _drawerController.toggle), onGestureTap: _drawerController.toggle),
center: new Text('Stocks'), center: new Text('Stocks'),
right: [ right: [
new IconButton( new IconButton(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment