69 Commits

Author SHA1 Message Date
Justin McCandless
7071dc7061
NO_SUGGESTIONS keyboard flag in Android (#13099)
Add the enableSuggestions parameter to control Android's keyboard suggestions
2019-10-23 10:47:19 -07:00
Jason Simmons
72420a3ba5
Remove redundant call to updateEditingState in sendKeyEvent (#13175)
See https://github.com/flutter/flutter/issues/41005
2019-10-16 15:53:12 -07:00
Gary Qian
ecf4f464c7
Restart all modern Samsung keyboard IMM (#12780) 2019-10-04 15:14:38 -04:00
Jason Simmons
5c428d9247 Check for a null input method subtype (#12706)
Fixes https://github.com/flutter/flutter/issues/41557
2019-10-01 09:03:47 -07:00
Michael Klimushyn
efb7bf434f
Work around Samsung keyboard issue (#12432)
Samsung's Korean keyboard has a bug where it always attempts to combine
characters based on its internal state, ignoring if and when the cursor
is moved programmatically. EG typing "ㄴㅇ" and then moving the cursor
back to the front of the text and typing "ㄴ" again would result in
"ㄴㅇㄴ", not "ㄴㄴㅇ".

Fully restarting the IMM works around this because it flushes the
keyboard's internal state and stops it from trying to incorrectly
combine characters. However this also has some negative performance
implications, so we only apply the workaround on Samsung devices set
to use Korean input.

This also effectively disables the feature on Samsung keyboards that
allowed users to re-open a composing region for previously typed
characters. See https://github.com/flutter/flutter/issues/29341#issuecomment-531283508.

Fixes flutter/flutter#29341.
2019-09-25 11:16:32 -07:00
Matt Carroll
dce8a34048
Revert "Notify framework to clear input connection when app is backgrounded (#35054) (#9498)" (#11720)
This reverts commit 4003fbc3ed48865cf6993d01be60749c3cabeff5.
2019-08-29 15:42:11 -07:00
Matt Carroll
4003fbc3ed
Notify framework to clear input connection when app is backgrounded (#35054) (#9498) 2019-08-19 14:12:45 -07:00
Justin McCandless
4decc174ee
Add support for Android's visible password input type (#9999)
For framework PR https://github.com/flutter/flutter/issues/31738
2019-07-23 07:57:39 -07:00
Matt Carroll
649e025f70
Removed PlatformViewsController if-statements from TextInputPlugin (#34286). (#9938) 2019-07-19 13:52:45 -07:00
Gary Qian
fa7627d17c
Fix backspace crash on Chinese devices (#9734) 2019-07-10 12:08:03 -07:00
Amir Hardon
56954457a5
Don't hang to a platform view's input connection after it's disposed (#9423)
Addresses the crash reported in https://github.com/flutter/flutter/issues/19718#issuecomment-504174596
2019-06-24 13:13:00 -07:00
Amir Hardon
4c9fa49408
request FlutterView focus when setting a platform view text client (#9366) 2019-06-18 19:05:36 -07:00
Gary Qian
675033fc05
Check for invalid indexes when performing InputAdpator backspace. (#9322) 2019-06-17 15:13:30 -07:00
Matt Carroll
4fc95ebb29
Fixed memory leaks within FlutterFragment and FlutterView (#34268, #34269, #34270). (#9288) 2019-06-11 17:01:20 -07:00
Matt Carroll
8040117420
Fix TextInputPlugin NPE caused by PlatformViewsController ref in new embedding (#34283). (#9283) 2019-06-11 15:21:55 -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
Chris Bracken
509a43fe27
Apply minor cleanups to Android embedding (#9088)
Eliminate an unused import, add missing @Override annotations, and
eliminate an unused logger.
2019-05-25 15:45:14 -07:00
Gary Qian
f5fa03b5eb
Use Android text selection shifting API to handle keyboard backspace (#8956) 2019-05-15 10:44:23 +08:00
Matt Carroll
6145e9046a
Android Embedding PR 13: Integrated text input, keyevent input, and some other channel comms in FlutterView. (#7979) 2019-02-28 15:02:56 -08:00
Matt Carroll
18ad03d49d
Fixed an Android keyboard entry bug that was introduced by the embedding refactor. (#28438) (#7954) 2019-02-25 19:15:49 -08:00
Matt Carroll
2f4a38dbd3
Android embedding refactor pr3 add remaining systemchannels (#7892)
Merging back in after reversion. Fixed some messaging issues in FlutterNativeView and corrected some message parsing.
2019-02-20 17:05:31 -08:00
Dan Field
6d7eb52185
Revert "Android embedding refactor pr3 add remaining systemchannels (#7874)" (#7886)
This reverts commit f4fba6d7110338caf3878cf42e26e17744108d00.
2019-02-20 11:18:12 -08:00
Matt Carroll
f4fba6d711
Android embedding refactor pr3 add remaining systemchannels (#7874) 2019-02-19 15:51:13 -08:00
Chris Bracken
163a2fd5e1
Revert "Android embedding refactor pr3 add remaining systemchannels (#7738)" (#7849)
From build log:
```
../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:95: error: cannot find symbol
    private final LocalizationChannel localizationChannel;
                  ^
  symbol:   class LocalizationChannel
  location: class FlutterView
../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:172: error: cannot find symbol
        localizationChannel = new LocalizationChannel(dartExecutor);
                                  ^
  symbol:   class LocalizationChannel
  location: class FlutterView
2 errors
```

This reverts commit 256db4bc23b7931509233df0dc04e44e16608229.
2019-02-15 15:03:19 -08:00
Matt Carroll
256db4bc23
Android embedding refactor pr3 add remaining systemchannels (#7738) 2019-02-15 13:45:24 -08:00
Jason Simmons
395937380c
Log errors returned from method channel invocations in the text input plugin (#7476)
See https://github.com/flutter/flutter/issues/25715
2019-01-14 17:26:05 -08:00
Todd Volkert
f79f7f6312
Allow inferred types using diamond syntax (#7237) 2018-12-17 16:35:10 -08:00
Rafael Ring
9071a39dd2 Fix keyboard not showing for targetSdk 28 (#6985)
After bumping the targetSdk of Flutter apps to 28, the keyboard doesn't open anymore when inputting text on an Android Pie devices. The problem is caused by a change on the way the focus in handled: when the call `mImm.showSoftInput(view, 0);` is made, the currently focused view is the `DecorView` from the `Activity` hosting Flutter but the passed view reference (`view` argument) is the `FlutterView`. As the `InputMethodManager` checks if both views are the same before showing the keyboard, it never appears because the `FlutterView` never has focus.
As Flutter doesn't have any input views as far as the Android side is concerned, the focus should always stay on the `FlutterView` itself and thus, this PR changes the `TextInputPlugin` to focus on the `FlutterView` as soon as it's created, fixing the keyboard issue.

Co-authored-by: Igor Borges <igorborges12@gmail.com>
2018-12-10 21:01:12 -08:00
Michael Goderbauer
70a1106b50
Unify copyright lines (#6757) 2018-11-07 12:24:35 -08:00
Simon Lightfoot
9f0ad8b794 Fixes negative end selection offset. (#6171) 2018-09-05 12:12:21 -07:00
jslavitz
1c76824186
entering a character with a selection deletes the selection (#6113) 2018-08-30 10:29:04 -07:00
Jonah Williams
d1c71e5206
add text capitalization support to ios and android (#5752) 2018-07-19 18:07:18 -07:00
amirh
51785d244d
Remove unused Java imports (#5663) 2018-07-03 09:21:03 -07:00
matthew-carroll
061e899b55
Support all keyboard actions. (#11344) (#5620)
* Support all keyboard actions. (#11344)
2018-07-02 06:58:01 +00:00
Mehmet Fidanboylu
d7e3f2d6e7
Fix lint errors to prepare for building Android files in Google (#5440) 2018-06-01 10:16:50 -07:00
Simon Lightfoot
abd74ed5ed Add support for physical keyboards on Android (#5324)
* Fixes flutter/flutter#7943
* Fixes flutter/flutter#9347
* Fixes flutter/flutter#11177
2018-05-24 15:21:33 -07:00
Stanislav Baranov
7fa08b3ba9
Support for decimal and signed numeric keyboard (#4853)
* Support for decimal and signed numeric keyboard

* Comments
2018-03-26 13:14:38 -07:00
Jason Simmons
a2f488ac7f
Do not report a cursor location if there is no active selection (#4427)
Fixes https://github.com/flutter/flutter/issues/13398
2017-12-07 17:43:51 -08:00
5u3it
31585e0def Native keyboard behavior update for multiline input (#4234)
Use sentence capitalization for non-obscuretext fields of TextInputType.text
and TextInputType.multiline on iOS and Android.
2017-10-19 13:56:35 -07:00
gspencergoog
90ba98e741 Fixing accidental paste. (#4145) 2017-09-26 13:44:39 -07:00
gspencergoog
faabc10178 Support correct keyboards for multi-line text editing. (#4115)
This addresses part of #8028, implementing the Engine-side support for it.
2017-09-26 12:53:19 -07:00
Jason Simmons
f02a30b405 Support sendKeyEvent for arrow keys (#3940)
Fixes https://github.com/flutter/flutter/issues/11352
2017-07-31 16:52:34 -07:00
Jason Simmons
ca19ab0a99 Check for an empty selection in deleteSurroundingText (#3938)
Fixes https://github.com/flutter/flutter/issues/11437
2017-07-31 16:18:27 -07:00
Jason Simmons
f56da86f98 Invert the autocorrect flag (#3875)
See https://github.com/flutter/engine/pull/3866
2017-07-13 15:33:08 -07:00
Jason Simmons
74d6f60558 Enable text autocorrect on Android with a flag to disable it (#3866)
See https://github.com/flutter/flutter/issues/11168
2017-07-12 14:44:20 -07:00
Jason Simmons
456d746eb0 Do not enter text for key events that are not associated with a character (#3860)
Fixes https://github.com/flutter/flutter/issues/10723
2017-07-10 17:41:14 -07:00
Jason Simmons
8d5372a82a Do not try to apply selections outside the length of the text (#3845)
See https://github.com/flutter/flutter/issues/11041
2017-06-30 14:50:01 -07:00
Jason Simmons
4d1f1f6d8a Do not call restartInput twice when setting a new text input client. (#3808)
If restartInput is called twice in quick succession, then the IME may output
warnings related to usage of the obsolete connection resulting from the first
call.

Fixes https://github.com/flutter/flutter/issues/10730
2017-06-21 10:47:02 -07:00