24 Commits

Author SHA1 Message Date
Adam Barth
a4a783b64f Add support for pointer hover (#6884) 2016-11-15 21:13:37 -08:00
Jason Simmons
b41645cc17 Catch and log any exceptions thrown by an app's gesture recognizer callbacks (#6542)
If a recognizer is interrupted by an exception from a callback, it could be
left in an inconsistent state and be unable to process future events
2016-10-28 14:37:17 -07:00
Adam Barth
034d2fcd5d Ensure delayed multidrag timer is stopped (#6340)
Previously we were relying on the gesture arena to call us back to
cancel our timer. However, in the case where we've already been
accepted, asking the gesture arena to reject us doesn't lead to a
callback and we fail to stop the timer (and hence trigger an assert).

Fixes #6156
2016-10-15 13:02:38 -07:00
Hans Muller
e2ff169d5b Have the scale gesture callback uses details objects (#6204) 2016-10-04 12:44:36 -07:00
Hans Muller
596637ade4 Added scale-to-zoom gesture support to the Gallery grid demo (#6185) 2016-10-03 16:08:15 -07:00
Adam Barth
c9eda86b0e Switch to PointerData API (#6131)
Now dart:ui does the decoding of the pointer data itself, which means we don't
need to do it in the framework.
2016-09-29 21:25:20 -07:00
James Robinson
a95c9fdb58 Isolate imports of generated Dart code from generated path (#5960)
This rewrites imports of various mojom.dart files from the Flutter
engine repo to instead import normal-looking dart files from the
(new) flutter_services package. This package handles exporting the
correct symbols from generated code wherever that may live.

Includes an engine roll to 3551e7a48e2e336777b15c7637af92fd7605b6c5
which contains the new flutter_services package.
2016-09-21 14:00:29 -07:00
Adam Barth
a60fefc131 Improve test coverage (#5473)
These tests should hit some previously untested lines.
2016-08-17 18:18:07 -07:00
Adam Barth
bb0c41f2a6 Improve test coverage for gestures.dart (#4773)
This patch adds tests for some code paths we weren't hitting before and removes
some dead code that couldn't be tested because it was unreachable.
2016-06-27 14:42:41 -07:00
Adam Barth
2af668f832 Change how navigator prevents redundant operations (#4769)
* Change how navigator prevents redundant operations

Instead of requiring transactions, we now cancel all active pointers that are
interacting with the navigator and absorb future pointers until we get a chance
to build. This approach isn't perfect (e.g., events that trigger off the
cancelled pointers could still interact with the navigator), but it should be
better than the current transaction-based approach.

Fixes #4716

* Remove openTransaction

* test

* fixup
2016-06-27 13:07:47 -07:00
Adam Barth
2d4acb8041 Convert drag gestures to use details objects (#4343)
Previously we supplied individual parameters to the various drag and pan
callbacks. However, that approach isn't extensible because each new
parameter is a breaking change to the API.

This patch makes a one-time breaking change to the API to provide a
"details" object that we can extend over time as we need to expose more
information. The first planned extension is adding enough information to
accurately produce an overscroll glow on Android.
2016-06-02 23:45:49 -07:00
Adam Barth
0c0a866c79 Add the ability to create global pointer routes (#4239)
We'll use this functionality to implement some subtle behaviors for tooltips.
2016-05-27 12:42:12 -07:00
Ian Hickson
3252701753 Make it possible to run tests live on a device (#3936)
This makes it possible to substitute 'flutter run' for 'flutter test'
and actually watch a test run on a device.

For any test that depends on flutter_test:

1. Remove any import of 'package:test/test.dart'.

2. Replace `testWidgets('...', (WidgetTester tester) {`
      with `testWidgets('...', (WidgetTester tester) async {`

3. Add an "await" in front of calls to any of the following:
    * tap()
    * tapAt()
    * fling()
    * flingFrom()
    * scroll()
    * scrollAt()
    * pump()
    * pumpWidget()

4. Replace any calls to `tester.flushMicrotasks()` with calls to
   `await tester.idle()`.

There's a guarding API that you can use, if you have particularly
complicated tests, to get better error messages. Search for
TestAsyncUtils.
2016-05-16 12:53:13 -07:00
Adam Barth
51b1550df7 Delay win-by-default in gesture arena (#3552)
Wait until the end of the microtask to tell gesture recognizers that
they've won in the gesture arena. This lets recognizers dispose reject
themselves at arbitrary times without triggering gestures in awkward
call stacks.

Fixes #3183
2016-04-26 14:52:31 -07:00
Ian Hickson
e968d91ca4 Rename binding abstract classes (#3482)
The old names were getting silly and started stepping on valuable namespace.

The new names are consistent and clear.
2016-04-21 17:18:46 -07:00
Ian Hickson
e41c1c0b06 Split services/ into services/ and foundation/ (#3350)
We're getting back to the point where we have a bunch of foundation APIs
and it's getting confusing having them mixed with services/.
2016-04-15 13:18:29 -07:00
Jason Simmons
0f70464e1d Treat pointer cancel events similarly to pointer up events (#3242) 2016-04-12 11:17:43 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Adam Barth
44c4e930d1 [rename fixit] GestureArena -> GestureArenaManager
Also, change the keys to be explicitly pointer ids.

Fixes #202
2016-03-12 11:13:02 -08:00
Hixie
c7339de6bc Enable always_declare_return_types lint
And fix a zillion omissions this uncovered.
2016-03-09 17:57:39 -08:00
Adam Barth
4b1a9ff14c Remove PointerRouter and GestureArena arguments
There's no reason to make clients supply a PointerRounter and a
GestureArena when constructing gesture recognizers. These objects are
statics and the gesture recognizers can just grab them directly.

Also, remove the callback constructor arguments. Almost no code used
them. Instead, people seem to prefer using the `..` operator to set
callbacks on the recognizers. Removing the arguments removes a bunch of
boilerplate.
2016-02-24 22:23:00 -08:00
Adam Barth
4fb47600e4 Add a Velocity class to be explicit about units
We were using an Offset, which represented pixels/second, but it wasn't
clear to clients whether that was pixels/ms. Now we use a Velocity class
that is explict about the units.

Fixes #1510
Fixes #785
2016-02-13 22:59:09 -08:00
Adam Barth
07a9cc758a DoubleTap gesture asserts when rejected
The pointer router was using an iteration pattern that always delivers
handleEvent calls even if you remove a route during the iteration.
That's awkward to program against and causes trouble for the double-tap
gesture.

This patch switches PointerRouter to using a re-entrant iteration
pattern that supports removing routes (but not adding routes) during the
iteration.
2016-01-10 23:12:37 -08:00
Ian Hickson
7151fdd054 Move flutter tests from packages/unit to packages/flutter/test 2015-12-16 08:00:57 -08:00