Set bounds on all new motion controllers #588
Merged
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
Observed bug
Sample app scenario:
Promoter
to insideSpotlight
, rather thanBackStack
Why this happens
With
BackStack
,Promoter
was popped and recreated the next time; however, withSpotlight
it was kept aliveThe embedded
AppyxComponent
receivesupdateContext
when re-entering the compositionThis leads to its
MotionController
being recreated (without any knowledge ofTransitionBounds
)Since the component cached the last
TransitionBounds
, and the new one passed to it is exactly the same, theif
check does not set it on the newMotionController
instance:Which is fine that it's skipped, but we shouldn't rely on this being called either.
If the size of the bounds is used to calculate any
TargetUiState
values (as is the case withPromoter
), those will be messed up.Fix introduced
Always set bounds on the new
MotionController
instance.Check list
CHANGELOG.md
if required.