• Home
Name Date Size #Lines LOC

..--

android/12-May-2024-505401

ios/12-May-2024-1,1471,084

lib/12-May-2024-519448

test_driver/12-May-2024-3428

.metadataD12-May-2024287 97

README.mdD12-May-20241.5 KiB3323

pubspec.yamlD12-May-20245.9 KiB8072

README.md

1# Integration test for touch events on embedded Android views
2
3This test verifies that the synthesized motion events that get to embedded
4Android view are equal to the motion events that originally hit the FlutterView.
5
6The test app's Android code listens to MotionEvents that get to FlutterView and
7to an embedded Android view and sends them over a platform channel to the Dart
8code where the events are matched.
9
10This is what the app looks like:
11
12![android_views test app](https://flutter.github.io/assets-for-api-docs/assets/readme-assets/android_views_test.png)
13
14The blue part is the embedded Android view, because it is positioned at the top
15left corner, the coordinate systems for FlutterView and for the embedded view's
16virtual display has the same origin (this makes the MotionEvent comparison
17easier as we don't need to translate the coordinates).
18
19The app includes the following control buttons:
20  * RECORD - Start listening for MotionEvents for 3 seconds, matched/unmatched events are
21    displayed in the listview as they arrive.
22  * CLEAR - Clears the events that were recorded so far.
23  * SAVE - Saves the events that hit FlutterView to a file.
24  * PLAY FILE - Send a list of events from a bundled asset file to FlutterView.
25
26A recorded touch events sequence is bundled as an asset in the
27assets_for_android_view package which lives in the goldens repository.
28
29When running this test with `flutter drive` the record touch sequences is
30replayed and the test asserts that the events that got to FlutterView are
31equivalent to the ones that got to the embedded view.
32
33