-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Android] Modal Animation Repeats When Returning from Background - Fix #28522
base: main
Are you sure you want to change the base?
[Android] Modal Animation Repeats When Returning from Background - Fix #28522
Conversation
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
but thinking loud here... isn't a way to say if the animation happened? If already happened we don't want to trigger it again, I think it will be more robust and possibly cover more scenarios, what do you think?
Yea, initially I thought the same, but I wasn't sure if the animation should trigger only once for an instance of a fragment, or maybe there were some cases where it should trigger again @PureWeen what do you think? |
@@ -346,14 +353,16 @@ public override void OnStart() | |||
int height = ViewGroup.LayoutParams.MatchParent; | |||
dialog.Window.SetLayout(width, height); | |||
|
|||
if (IsAnimated) | |||
if (IsAnimated && !_wasStopped) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of any scenario where the animation should restart after the initial OnStart()
call. We can use _pendingAnimation
instead of overriding OnStop()
and introducing a new flag.
if (IsAnimated && _pendingAnimation)
I also think that starting the animation from OnStart()
is a poor choice to begin with, as it has led us to introduce flags to handle everything properly.
Issues Fixed
Fixes #28492
Screen.Recording.2025-03-19.at.20.33.12.mov
Screen.Recording.2025-03-19.at.20.32.14.mov
What do you think @pictos?