-
Notifications
You must be signed in to change notification settings - Fork 437
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
Suggestion: freeze / unfreeze view #46
Comments
Have you tried calling |
That was in fact the first thing I tried, then null image, then null generator. The exception was thrown each time. |
The library was not created with view transformations in mind. This is because the transition will break if the view bounds change. There may not exist enough image surface to accomodate extra space that a view gains when its dimensions increase. Besides that, it would be cumbersome to force custom generators to support it. Make sure you really need to deal with bound animation, sometimes you can achieve the same effect by using translations instead, just by overlaying your KBV with a sibling view. However, if you REALLY need to change bounds, there's something you could try, but I'm not sure if it'll work:
As a side effect, you'll have a transition mismatch after this animation, since you're now dealing with a different KBV. |
Thanks for the suggestion, I guess I will go for that. For now I just put the visibility to Gone, the parent view will just scale down and I'll later attempt to put a dummy imageview as you said. I'll post again here if I found a better solution for future reference. |
I stumbled upon some errors while I'm performing ObjectAnimator animations on kenburnsview, mainly, I was expanding/collapsing the view.
Each time the height field changed, the image view was stuttering, reloading the image or transition on it.
I always got IncompatibleRatioException: can't perform effect on rects with distinct aspect ratios.
I tried to resolve it by setting the image to null, then by setting the transition generator to null (but that didn't work so instead I set it to a new generator with method to return; immediately without calculations, but that also crashed for another reason, because the library needs values from that method).
Eventually I thought about suggesting a method which freezes the layout so that no calculations or redraws are done. This is helpful in advanced situations such as collapsing/expanding/animating the bounds of kenburnsview, even with height/width of zero.
Of course, an unfreeze method after animations are completed.
The text was updated successfully, but these errors were encountered: