-
Notifications
You must be signed in to change notification settings - Fork 6k
IME Animation clean up extraneous window inset call #21213
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -199,7 +199,8 @@ public void sendAppPrivateCommand(String action, Bundle data) { | |||
|
|||
private View view; | |||
private WindowInsets lastWindowInsets; | |||
private boolean started = false; | |||
private boolean animating = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add code comments for what these 2 are for the next maintainer
@@ -212,34 +213,35 @@ public void sendAppPrivateCommand(String action, Bundle data) { | |||
@Override | |||
public WindowInsets onApplyWindowInsets(View view, WindowInsets windowInsets) { | |||
this.view = view; | |||
if (started) { | |||
if (needsSave) { | |||
// Store the view and insets for us in onEnd() below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You described the what, but didn't describe the why (saving is needed) :)
@@ -677,6 +677,10 @@ public void ime_windowInsetsSync() { | |||
builder.setInsets(WindowInsets.Type.navigationBars(), Insets.of(10, 10, 10, 40)); | |||
WindowInsets imeInsets1 = builder.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some comments for what 0, 1, 2 are supposed to represent? Different stages of an animation?
This pull request is not suitable for automatic merging in its current state.
|
Landing, Linux Web Engine passes on rerun: https://ci.chromium.org/p/flutter/builders/try/Linux%20Web%20Engine/9773 |
removing cp label from PR in favor of the issue |
* Update 1.22 engine to use Dart 2.10.0-110.5.beta * Dark mode friendly iOS debugging message (#21277) * Update FlutterViewController.mm (#21362) * Tweaked the label here a little for style ("apps", not "application" -- plural and shorter); and "launching" rather than "re-launching"? * Fix iOS platform view's mask view blocking touch events. (#21286) * Disconnect the view's AndroidKeyProcessor when detaching from the engine (#21307) * Remove extraneous window inset call on IME animation (#21213) * Retain the WindowInsetsAnimation callback if code shrinking is enabled (#21330) Co-authored-by: Jenn Magder <[email protected]> Co-authored-by: Tim Sneath <[email protected]> Co-authored-by: Chris Yang <[email protected]> Co-authored-by: Jason Simmons <[email protected]> Co-authored-by: Gary Qian <[email protected]>
Description
Fixes bug part of flutter/flutter#65821
onStart
is called too late, which resulted in one of the final IME position calls to slip through. This PR switches to theonPrepare
instead and adds some additional safeguarding to prevent overwriting the saved inset. This is consistent with https://github.com/android/user-interface-samples/blob/master/WindowInsetsAnimation/app/src/main/java/com/google/android/samples/insetsanimation/RootViewDeferringInsetsCallback.kt which also usesonPrepare
and is what this is roughly based on.