This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Resolve Layout changes during native measure/arrange pass #12017
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StephaneDelcroix
approved these changes
Sep 8, 2020
rmarinho
suggested changes
Sep 10, 2020
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.
Issue 45125 failing on Android all API's i think might be related
hartez
force-pushed
the
delayed-layouts
branch
from
September 14, 2020 17:05
20c011f
to
a6f266f
Compare
hartez
force-pushed
the
delayed-layouts
branch
from
September 22, 2020 15:11
1036b3e
to
9bd26e5
Compare
None of these UI test failures have anything to do with the changes. |
That one's fixed. |
PureWeen
approved these changes
Sep 25, 2020
This was referenced Dec 3, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
To avoid excessive re-layouts, any property changes which trigger a layout in a Forms Layout (StackLayout, FlexLayout, etc.) are currently batched up and executed later on the UI thread. While this avoids "layout storms", it also introduces a slight delay in layout changes in the UI and in some rare cases can cause consistency issues. It also means that for many UI changes the native layout engine ends up being invoked an extra time to handle the queued layout changes.
These changes handle the queued layout changes as part of the next measure/layout pass of the native engine on the supported platforms (UWP, iOS, and Android) rather than queueing them up on the UI thread for later processing. This reduces the number of measure/layout passes on those platforms, and eliminates some of the potential consistency issues.
These changes also retain support for the old behavior on platforms which have not added layout resolution to their measure/layout process. Other platforms can opt into the new behavior by implementing the
IPlatformInvalidate
interface and setting thePlatformInvalidator
property on theDevice
class duringForms.Init
.Issues Resolved
Delays and extra measure/layout passes on the supported platforms.
API Changes
New interface:
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
All the tests.
PR Checklist