-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Drawing bug with useGlobalCoordinateSpace #85
Comments
Hey Alfredo, after looking at it. I noticed that this won't be a easy fix. Currently, Hero inserts all source views first then destination views. Before inserting a destination view, it check if there is a matched source view, and bring that source view to the front of the view hierarchy. In your case, let say the first VC is A, and second VC is B. To solve this, Hero will need to know which views need to go above certain views, a dependency system of some sort. And when pulling the source view up, Hero needs to pull all the views that are dependent on the source view. That is what I have in mind, but seems hard to implement. I don't know if you have any better ideas. I will try to come up with something next week, for now just set the zPosition of the white views. You can use the new .beginWith(modifiers:[.zPosition(5)]) This sets the zPosition directly on the snapshot's layer during the animation without animating it. On a side note, your card example looks awesome! I am updating the README graphics, do you mind if I build something similar to what you have as an example in the README? |
Understand, I'll think about it in the next days. Maybe a dependency system with a graph structure wouldn't be too hard, but it definitely require work. Do you think that is something you would like to have for Hero? If so I may want to prepare a PR and/or draft for you. About the example thing, do you mind if you try to replicate differently? For example a different form for the card, i.e. squared with a different colour. The app is not live yet and this interaction is a main part of the app, so for sure you can replicate it, I'll appreciate if it will be distinct :) |
Actually, can you try the latest master. I put up a temp fix.
…On Sun, Feb 12, 2017 at 11:20 AM Alfredo Delli Bovi < ***@***.***> wrote:
Understand, I'll think about it in the next days. Maybe a dependency
system with a graph structure wouldn't be too hard, but it definitely
require work. Do you think that is something you would like to have for
Hero? If so I may want to prepare a PR and/or draft for you.
About the example thing, do you mind if you try to replicate differently?
For example a different form for the card, i.e. squared with a different
colour. The app is not live yet and this interaction is a main part of the
app, so for sure you can replicate it, I'll appreciate if it will be
distinct :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#85 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADNEav6hjhYfEobNcT1bLOPpXs5fSyj1ks5rbzFagaJpZM4L-Qp9>
.
|
Sure, give me a sec 👍 |
Come on man!!! It worked 💯 Very well done, how you did at the end? |
Just saw the commit, thanks! |
When pulling the source view up, I do a recursive search for subviews and sibling views that might be a dependent. But I am not entirely satisfied with this implementation. If there is a inserted destination view that depend on one of the source view, it won't be pull up. When this happens, the source view will cover that destination view. I have another implementation in mind that might be better. Will try to implement it in a few days. I will put up a todo list in the projects tab later day. Glad that you are willing to help! |
HI Luke,
When using .useGlobalCoordinateSpace the animations get wrong on dismissing.
Video for reference: https://cl.ly/3e2S3n1k0V15
Looking at the view hierarchy I found what it may be wrong.
Infact, with .useGlobalCoordinateSpace the three white views appear to be before the background view (which is the highlighted row)
Instead without the .useGlobalCoordinateSpace I get the white cards views inside the background view.
I understand that in the case of .useGlobalCoordinateSpace not having the views inside the backgroundView is something expected, since we want to animated them separately.
But maybe the background view should appear before the three views? Thoughts?
I'll try to recreate the example ASAP
The text was updated successfully, but these errors were encountered: