-
-
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
UIVisualEffectView transition #26
Comments
I haven't looked at the exact code that peforms the animations, but is it possible to check for the views that are animated (traversing the view hierarchy)? Then every VisualEffectView's effect would be set to |
With the new .overFullScreen support. This should be possible. We just have to figure out how to animation UIVisualEffectView, since it doesn't support opacity animation. |
As I said |
Yes, but that doesn't allow interactive scrubbing or reversing the animation. |
For that you have to set the blur with a UIViewPropertyAnimator and then scrub by setting it's progress |
But that's iOS 10+ |
I tried implementing the UIViewPropertyAnimator. I modify to menu example to have a blur background. http://lkzhao.com/video/?path=%5Cpublic%5Cposts%5Chero%5Cmenu.mov It doesn't works when it is interactive though. Whenever, I set the .fractionComplete, the blur effect immediately jumps to the end. |
Maybe if it's interactive you have to take a snapshot of the view and animate its alpha similar to the way I tried to do it? |
@lkzhao Actually the way you tried should work, check out this example project: https://github.com/fichek/AnimateBlurRadius/ |
I think the problem is here: https://github.com/lkzhao/Hero/blob/master/Sources/HeroViewPropertyViewContext.swift#L59 |
If you set the |
I added a
UIVisualEffectView
to the MusicPlayer example to simulate this issue.It breaks during the transition and also after the transition is complete it's still not the way it should be.
Hero off
Hero on
Console outputs this warning:
Code used is available here: https://github.com/felix-dumit/Hero/tree/visual-effect-snapshot
Any ideas? Maybe take a snapshot of the window at the effectView (final) bounds?
I played around with this idea here: 7d9f0f1
Still needs some work but here is an initial result:
It still breaks once the animation is complete, though.
This is probably an unrelated question, but in the above scenario, how could I make it so the effectView frame doesn't animate (i.e it already starts with the the final frame)?
The text was updated successfully, but these errors were encountered: