Skip to content

Commit

Permalink
Add a note in ImeSyncDeferringInsetsCallback explaining the reason be…
Browse files Browse the repository at this point in the history
…hind capturing the latest final inset state (#43109)

Solely documentation change to explain the reasoning behind the change in #42700.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
  • Loading branch information
gmackall committed Jun 23, 2023
1 parent 76a2d4a commit a9b93ed
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -68,6 +68,12 @@ class ImeSyncDeferringInsetsCallback {
// When an animation begins, android sends a WindowInset with the final
// state of the animation. When needsSave is true, we know to capture this
// initial WindowInset.
//
// Certain actions, like dismissing the keyboard, can trigger multiple
// animations that are slightly offset in start time. To capture the
// correct final insets in these situations we update needsSave to true
// in each onPrepare callback, so that we save the latest final state
// to apply in onEnd.
private boolean needsSave = false;

ImeSyncDeferringInsetsCallback(@NonNull View view) {
Expand Down

0 comments on commit a9b93ed

Please sign in to comment.