184 Commits

Author SHA1 Message Date
Zachary Anderson
c62d665299
Revert "Deprecate Android v1 embedding classes (#20868)" (#21338)
This reverts commit 3011b14a25ea5c9fd54ecffc2e154e587c4a6b1a.
2020-09-22 14:38:18 -07:00
xster
3011b14a25
Deprecate Android v1 embedding classes (#20868) 2020-09-21 15:02:02 -07:00
Gary Qian
15bf1bbf6f
[Android R] Integrate DisplayCutouts into viewportMetrics (#20921) 2020-09-02 05:18:35 -07:00
Greg Spencer
88fd13fcd3
Reland: Implement delayed event synthesis key event handling for Android (#20736)
This re-lands the key event synthesis implementation for Android (Original PR: #19024, Revert PR: #19956). The only difference is sending the synthesized key events to the root view instead of the current view.

Without sending it to the root view, the system doesn't have any chance of handling keys like the back button. The event will still not be sent to the framework twice, since we turn off event propagation while re-dispatching the event.
2020-08-28 14:45:38 -07:00
Jason Simmons
d41e10bd75
Release the AccessibilityBridge when destroying a legacy FlutterView (#20610) 2020-08-19 14:11:02 -07:00
Emmanuel Garcia
7f5d044f36
Wait before switching surfaces (#20100) 2020-07-30 20:36:01 -07:00
Greg Spencer
18200e7e8e
Revert "Implement delayed event synthesis key event handling for Android (#19024)" (#19956)
This reverts commit 8825f9178d884d07b43590ef52bb929ac9a3773f because it breaks flutter_gallery__back_button_memory and a customer test.
2020-07-22 12:36:26 -07:00
Greg Spencer
8825f9178d
Implement delayed event synthesis key event handling for Android (#19024)
This implements the design in flutter.dev/go/handling-synchronous-keyboard-events for Android.

I started with Android, but this will be used for all platforms as we add them.

The related framework PR is: flutter/flutter#59358 (which has already landed)
2020-07-17 11:03:19 -07:00
Kaushik Iska
1832613e09
[android] Childview will process its motion events (#19662) 2020-07-14 19:18:14 -07:00
Gary Qian
3a96741247
Platform resolved locale and Android localization refactor (#18645) 2020-06-16 04:29:50 -07:00
Dan Field
983b6e198d
Call Shell::NotifyLowMemory when backgrounded/memory pressure occurs on Android (#19026)
* Reland "Call Shell::NotifyLowMemoryWarning on Android Trim and LowMemory events (#18979)" (#19023)"

This reverts commit 0a852d8ad7e0b132d86c0a604f2c41a110f2b3b6.
2020-06-12 15:12:25 -07:00
Emmanuel Garcia
0a852d8ad7
Revert "Call Shell::NotifyLowMemoryWarning on Android Trim and LowMemory events (#18979)" (#19023)
This reverts commit f5ab179e7a793e2bd5d087d59911e99f8b45e6c9.
2020-06-12 12:31:12 -07:00
Dan Field
f5ab179e7a
Call Shell::NotifyLowMemoryWarning on Android Trim and LowMemory events (#18979) 2020-06-10 17:18:17 -07:00
Tong Mu
b3e7732cf9
System mouse cursor: Android (#18569)
Adds system mouse cursor to the Android engine.
2020-06-01 18:08:43 -07:00
Gary Qian
e9f1efa280
Add fullscreen padding workarounds to v2 android embedding (#18193) 2020-05-09 04:31:27 -07:00
Mehmet Fidanboylu
feb94f6c97
Protect LanguageRange behind Android O. (#17882) 2020-04-23 05:59:52 -07:00
Gary Qian
8dc91229b4
PlatformResolvedLocale localization message channel (#17755) 2020-04-21 15:34:44 -07:00
Jason Simmons
f9e53c72c6
Unregister the TextInputChannel method handler when the TextInputPlugin is destroyed (#17646)
Fixes https://github.com/flutter/flutter/issues/54275
2020-04-17 14:25:34 -07:00
LongCatIsLooong
cf3d738f50
Android text input autofill (#17465) 2020-04-16 03:41:23 -07:00
Emmanuel Garcia
025e2d82dd
Migrate embedding to AndroidX (#17075) 2020-03-13 21:19:24 -07:00
xster
1ff81bc117
Make a pass through all the embedding javadocs (#17109) 2020-03-13 16:34:34 -07:00
Michael Klimushyn
077918dcfd
Apply Google Java format (#16501)
This shouldn't result in any logical changes. I've done a quick smoke
test by building a local Android engine and running Flutter gallery, no
compile errors or other obvious issues.

Applied by running `/ci/format.sh | patch -p0` with the altered script
added in flutter/engine#16500. I did locally modify the script slightly
further so it would run against all Java files in the repo instead of
just modified ones.
2020-02-07 16:10:46 -08:00
Michael Klimushyn
0816c040fb
Deprecated FlutterView v1 points to FlutterView v2 (#16304)
FlutterView#enableTransparentBackground has been deprecated for some
time now since it breaks a11y highlighting in most cases. When the
warning was first added there was no known workaround, but now the v2
embedding is in stable and ready to support this usecase. Update the
warning to point to the v2 embedding.
2020-01-31 15:06:52 -08:00
Michael Klimushyn
531a9cfb8e
Fire PlatformViewController FlutterView callbacks (#13015)
Fixes a bug where `PlatformViewController` was not being notified of `FlutterView` attachment changes.
2019-10-14 14:03:25 -07:00
Matt Carroll
fde7c8c334
Rename first frame method and notify FlutterActivity when full drawn (#38714 #36796). (#11357) 2019-09-03 15:49:53 -07:00
Shi-Hao Hong
014ab76ad0
Pass Android Q insets.systemGestureInsets to Window (#10413)
* Pass Android Q system gesture inset information from insets.systemGestureInsets to Window.systemGestureInsets
2019-08-16 13:42:56 -04:00
Matt Carroll
f336e05a69
Android Embedding PR37: Separated FlutterActivity and FlutterFragment via FlutterActivityAndFragmentDelegate (#9895) 2019-07-29 17:40:25 -07:00
Michael Klimushyn
839f9a2707
Deprecate FlutterView#enableTransparentBackground (#10235)
The API breaks accessibility highlighting because of
SurfaceView#setZOrderOnTop. Deprecate it since the underlying issue is
an Android SDK one that can't be worked around from within a
SurfaceView.
2019-07-29 12:46:26 -07:00
Matt Carroll
9cf13568e2
Added hasRenderedFirstFrame() to old FlutterView for Espresso (#36211). (#9939) 2019-07-19 16:46:02 -07:00
Jason Simmons
3f4f606105
Simplify loading of app bundles on Android (#9360)
* Remove deprecated runBundle APIs
* Remove code related to dynamic patching (including support for multiple
  bundle paths)
* Change FlutterRunArugments.bundlePath to be the Android AssetManager path
  where the app's assets are located
2019-06-25 14:17:50 -07:00
Chris Bracken
14d2954a52
Eliminate unused import in FlutterView (#9439)
Eliminates an unused import in FlutterView.java. Fixes import ordering.
2019-06-24 11:17:18 -07:00
Amir Hardon
3757f19923
delegate checkInputConnectionProxy to the relevant platform view (#9426)
The previous logic allowed proxying for any view that belonged to one of the platform views' virtual displays which may lead to us allowing proxying for a view that the platform view isn't allowing proxying for, previous logic also didn't account for unattached views.

This change instead delegates the decision to the platform view.

We use the fact that each virtual display has its unique context to associate any view with its relevant virtual display.

A nice side effect of calling the platform view's checkInputConnectionProxy for webviews is that the plugin now has a way to get a handle to the ThreadedInputConnectionProxyView, which may be useful for getting keyboard working on webview's prior to Android N.
2019-06-21 14:30:58 -07:00
Matt Carroll
a2db2ea6f1
Android Embedding Refactor PR35: Ensure all JNI methods are in FlutterJNI (#34751). (#9391) 2019-06-20 17:13:58 -07:00
Amir Hardon
259d334e05
Reland "Keyboard support for embedded Android views. (#9203) (#9257)
#9203 broke the keyboard_resize integration test(see more details in flutter/flutter#34085 (comment)).

This re-lands @9203 and fixes the issue the integration test uncovered by always allowing to hide the keyboard.

The difference from the original change is 07d2598
2019-06-10 12:56:35 -07:00
Jonah Williams
ddd36e8338
Revert "Keyboard support for embedded Android views. (#9203)" (#9239) 2019-06-07 18:21:57 -07:00
Amir Hardon
e80df363d2
Keyboard support for embedded Android views. (#9203)
Generally what this PR is doing is setting up a delegation mechanism
for Android's onCreateInputConnection.

It works by letting the framework know when an embedded view gets loses
focus(within the virtual display), the framework maintains a focus node
for each Android view that is kept in sync with the focus state of the
embedded view.

The TextInputPlugin is extended to allow for 2 type of text clients a
"framework client"(what we had before) and a "platform view client".
When the AndroidView's focus node in the framework is focused the
framework sets a "platform view text client" for the TextInputPlugin,
which will result in the TextInputPlugin delegating
createInputConnection to the platform view.

When a platform view is resized, we are detaching it from a virtual
display and attaching it to a new one, as a side affect a platform view
might lose an active input connection, to workaround that we "lock" the
connection when resizing(by caching it and forcing the cached copy until
the resize is done).

Additional things worth calling out in this PR:

To properly answer which views are allowed for input connection
proxying we compare a candidate view's root view to the set of root
views of all virtual displays.
We also preserve a view's focus state across resizes.
Note that this PR only wires text for the io.flutter.view.FlutterView
For the new Android embedding some additional plumbing is necessary.

Corresponding framework PR: flutter/flutter#33901

flutter/flutter#19718
2019-06-06 21:58:04 -07:00
Matt Carroll
008090b8ab
Extracted PlatformViewsChannel from PlatformViewsController. (#7847) 2019-06-03 11:04:33 -07:00
Matt Carroll
904cfc4fe3
Add @UiThread to MethodChannel and related classes/calls (#32642). (#8947) 2019-05-13 13:26:31 -07:00
Alan Doubleday
075b4899d0 Support ContextWrapper when FlutterView is instantiated within a Fragment. (#7776) 2019-04-08 10:30:36 -07:00
Jason Simmons
68bd4f2c64
Do not drop the DartExecutor's message handler when a FlutterNativeView is detached from the FlutterView (#8254)
An activity can use ViewFactory.retainNativeFlutterView to reuse a
FlutterNativeView across multiple instances of the activity.  In this
scenario, the FlutterNativeView should continue to handle incoming messages
sent from Dart.
2019-03-21 18:08:58 -07:00
Amir Hardon
6a8a45fc4f
Have the AccessibilityBridge attach/detach itself to the (#8229)
PlatformViewsDelegate.

Since onDetachedFromWindow can be called after the activity was
destroyed, the previous call to detach the accessibility bridge could
have crash as the NativeFlutterView was already null.
2019-03-20 12:26:30 -07:00
Matt Carroll
1dbd2046b5
Moved io.flutter.embedding.engine.android package to io.flutter.embedding.android (#8221) 2019-03-20 11:30:49 -07:00
Amir Hardon
45f69ac471
Plumb a reference of PlatformViewsController and AccessibilityBridge to each other (#8208)
This is in preparation for implementing platform views a11y on Android.

And e2e working prototype is available here: https://github.com/amirh/engine/tree/a11y_hacks

flutter/flutter#19418
2019-03-19 15:48:45 -07:00
Matt Carroll
09db84fad6
Android Embedding PR 19: Add accessibility to new FlutterView. (#8109) 2019-03-14 14:24:49 -07:00
Matt Carroll
8b0df6ded5
Bugfix #29203: NPE in getAccessibilityProvider in old FlutterView. (#8126) 2019-03-11 23:45:03 -07:00
Matt Carroll
20165b3147
Integrated AndroidTouchProcessor within the old FlutterView (#8095) 2019-03-11 16:04:44 -07:00
Matt Carroll
718329ce6e
Android Embedding PR 17: Clarify AccessibilityBridge and move logic out of FlutterView. (#8061) 2019-03-08 18:09:04 -08:00
Michael Klimushyn
1d10e0eb67
Guard against NewAPI failures (#8048)
Adds minimum SDK checks around minimum APIs.

flutter/flutter#28848
2019-03-08 13:33:58 -08:00
Jonah Williams
ca0bac4fb0
Revert "add signal to pointer kinds" (#8066) 2019-03-06 20:55:34 -08:00
stuartmorgan
dd80fc9ff6
Add engine support for scrollwheel events (#7494)
Adds support for pointer signals, in a way that will support both discrete events (e.g., scroll wheels, flutter/flutter#22762) and continuous gestures (e.g., trackpad scroll, flutter/flutter#21953).

Also exposes these new event options to the embedder. Does not include code to send the
new events from the platform shells.
2019-03-05 14:12:07 -08:00