Closed breyed closed 2 months ago
Hi @breyed,
thanks for the feature proposal. It should be possible to implement. I will try to implement it in the future.
Hi @breyed,
I have implemented optional animations in the latest release.
The update in version 5.1.0 doesn’t work. In a response to a Command from a view on the popover, my code essentially does this:
popover.IsAnimated = false;
popover.Hide();
page.Navigation.PushModalAsync(navigationPage)
The popover still animates before the modal push animation begins. Tested on iOS 17.5 and Android 14.
Hi @breyed, I made a dumb mistake in the iOS handler. I published a fix.
In 5.1.1 IsAnimated = false
works on iOS. However, on Android 14, it still animates.
Hi,
on Android, it does not work only if you change the IsAnimated
property while the popover is open. Popover
is implemented using PopupWindow
on Android. I do not know why, but changing AnimationStyle
of PopupWindow
while the window is open does not have any effect (the change is only reflected the next time it is opened). If you change the property before you open the popover, it works as expected:
https://github.com/user-attachments/assets/7ff79cf3-0ea0-413d-b5b5-64cfd225d569
Perhaps you need to call [update](https://developer.android.com/reference/android/widget/PopupWindow#update()) for the new animation style to take effect.
Hi @breyed,
thank you for the tip about the update()
method. I implemented it and published a new version. However, I could not make it working in a situation when the Hide()
method is called right after IsAnimated
is changed. You have to wait a bit for the new animation style to take effect, for example using Task.Delay()
, although this is far from a perfect solution:
popover.IsAnimated = false;
await Task.Delay(10);
popover.Hide();
~Does Dispatcher.Dispatch
work around the issue? If so, it’s cleaner than using Delay
.~ I tried Dispatcher.Dispatch
, but it had no effect.
Feature request: Just as you can dismiss a popover without animation on iOS using dismiss(animated:completion:), it would be useful to hide the MAUI
Popover
without animation. (In my use case, I want to immediately navigate to another page.)