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
This commit is contained in:
@@ -38,12 +38,17 @@ class ContainerApp extends App {
|
||||
),
|
||||
])),
|
||||
]),
|
||||
onPointerDown: _handlePointerDown);
|
||||
onPointerDown: _handlePointerDown,
|
||||
onGestureTap: _handleGestureTap);
|
||||
}
|
||||
|
||||
void _handlePointerDown(sky.PointerEvent event) {
|
||||
print("_handlePointerDown");
|
||||
}
|
||||
|
||||
void _handleGestureTap(sky.GestureEvent event) {
|
||||
print("_handleGestureTap");
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -41,7 +41,7 @@ class SpriteBox extends RenderBox {
|
||||
size = constraints.constrain(new Size.infinite());
|
||||
}
|
||||
|
||||
void handlePointer(PointerEvent event) {
|
||||
void handleEvent(Event event) {
|
||||
switch (event.type) {
|
||||
case 'pointerdown':
|
||||
print("pointerdown");
|
||||
|
||||
@@ -41,7 +41,7 @@ class InkSplash {
|
||||
class InkWell extends RenderBox {
|
||||
final List<InkSplash> _splashes = new List<InkSplash>();
|
||||
|
||||
void handlePointer(sky.PointerEvent event) {
|
||||
void handleEvent(sky.Event event) {
|
||||
switch (event.type) {
|
||||
case 'pointerdown':
|
||||
_splashes.add(new InkSplash(position: new sky.Point(event.x, event.y),
|
||||
|
||||
@@ -482,7 +482,7 @@ class RenderSolidColor extends RenderDecoratedSector {
|
||||
deltaTheta = constraints.constrainDeltaTheta(desiredDeltaTheta);
|
||||
}
|
||||
|
||||
void handlePointer(sky.PointerEvent event) {
|
||||
void handleEvent(sky.Event event) {
|
||||
if (event.type == 'pointerdown')
|
||||
decoration = new BoxDecoration(backgroundColor: const sky.Color(0xFFFF0000));
|
||||
else if (event.type == 'pointerup')
|
||||
|
||||
@@ -42,7 +42,7 @@ class RenderTouchDemo extends RenderBox {
|
||||
|
||||
RenderTouchDemo();
|
||||
|
||||
void handlePointer(PointerEvent event) {
|
||||
void handleEvent(sky.Event event) {
|
||||
switch (event.type) {
|
||||
case 'pointerdown':
|
||||
int color = colors[event.pointer.remainder(colors.length)];
|
||||
|
||||
@@ -164,7 +164,7 @@ class StocksApp extends App {
|
||||
return new ToolBar(
|
||||
left: new IconButton(
|
||||
icon: 'navigation/menu_white',
|
||||
onGestureTap: (_) => _drawerController.toggle),
|
||||
onGestureTap: _drawerController.toggle),
|
||||
center: new Text('Stocks'),
|
||||
right: [
|
||||
new IconButton(
|
||||
|
||||
Reference in New Issue
Block a user