Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missed "frame" when going back to UsersListScreen #3

Open
MaciejCiemiega opened this issue Apr 19, 2020 · 1 comment
Open

Missed "frame" when going back to UsersListScreen #3

MaciejCiemiega opened this issue Apr 19, 2020 · 1 comment

Comments

@MaciejCiemiega
Copy link
Member

It's not that visible on the gif, you can only see it when going back from Irene.

When going from UsersListScreen to UserDetailsScreen everything works fine. The sequence is as follows:

  1. startElement from previous screen is gone
  2. endElement calls onElementRegistered and hides itself (by using alpha = 0)
  3. transition is set to SharedElementTransition.WaitingForEndElementPosition and invalidateTransitionsOverlay() is called.
  4. SharedElementTransitionsOverlay reads that transition and draws SharedElementTransitionPlaceholder of startElement for a brief moment until endElement will be positioned and we can launch the real transition.
  5. endElement calls onElementPositioned.
  6. transition is set to SharedElementTransition.InProgress and invalidateTransitionsOverlay() is called.
  7. SharedElementTransitionsOverlay reads and draws the real transition from startElement to endElement

Steps 2, 3 and 4 are done in the same pass (frame?). endElement hides itself, but at the same time we already have a placeholder of startElement drawn by SharedElementTransitionsOverlay.

When going from UserDetailsScreen to UsersListScreen there is one difference though. It looks like AdapterList (that is used on UsersListScreen) never disposes its list items, even when it's gone (#1, https://issuetracker.google.com/issues/150174792). I believe it causes it to be positioned "instantly"(?). The sequence is as follows:

  1. startElement from previous screen is gone
  2. endElement calls onElementRegistered and hides itself (by using alpha = 0)
  3. transition is set to SharedElementTransition.WaitingForEndElementPosition and invalidateTransitionsOverlay() is called.
  4. DIFFERENT: NOT HAPPENING
  5. DIFFERENT: endElement calls onElementPositioned in the same pass as 2 and 3. SharedElementTransitionsOverlay had no chance to refresh, so we have missed frame.
  6. transition is set to SharedElementTransition.InProgress and invalidateTransitionsOverlay() is called.
  7. SharedElementTransitionsOverlay reads and draws the real transition from startElement to endElement
@saket
Copy link

saket commented Aug 29, 2021

Hey @MaciejCiemiega, is this still an issue now that the linked issue is fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants