-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[WIP][ASLayoutTransition] Relayout a node if one of its subnodes has a new size after layout transition #2862
[WIP][ASLayoutTransition] Relayout a node if one of its subnodes has a new size after layout transition #2862
Conversation
3a48122
to
5bbb896
Compare
… moved in a recent PR (facebookarchive#2820)" This reverts commit 7872cfb.
27cf9df
to
f88f4bb
Compare
f88f4bb
to
14ce2bd
Compare
// Hold onto __instanceLock__ until at least after the animation of this transtion kicked off, | ||
// to make sure this transition isn't invalidated after it passed the abort test below | ||
__instanceLock__.lock(); | ||
if ([self _shouldAbortTransitionWithID:transitionID]) { | ||
return; |
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.
Should this unlock here before the return?
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.
Good catch! It's very hard to hit this line (excepts for super busy nodes, like closeup) but it's a legitimate mistake of mine!
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.
Fixed.
I tested this out on my product code and it doesn't work in my case. Huy has the repro steps and will double check to see if it's a bug on my side or ASDK's side. |
Closing this in favor of an overhaul of the layout system. |
_transitionInProgress
flag is turned off before that, any layout pass occurs afterward, but before-transitionContext:didComplete:
is called, can erase all pending states of the transition, causing old subviews to remain in the hierarchy forever.@maicki, @garrettmoon, @appleguy, @Adlai-Holler: Would love to have your feedbacks here.
@hannahmbanana Please help me to test this diff with Pinterest master. I already did that, as well as with ASDKLayoutTransition example and the sample projects in #2841 and #2816. However, with all the branch and context switchings, I may overlooked something. Gonna test it more tomorrow!