Skip to content

[Android] Modal Animation Repeats When Returning from Background - Fix#28522

Closed
kubaflo wants to merge 1 commit intodotnet:mainfrom
kubaflo:Modal-Animation-Repeats-When-Returning-from-Background
Closed

[Android] Modal Animation Repeats When Returning from Background - Fix#28522
kubaflo wants to merge 1 commit intodotnet:mainfrom
kubaflo:Modal-Animation-Repeats-When-Returning-from-Background

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Mar 19, 2025

Issues Fixed

Fixes #28492

Before After
Screen.Recording.2025-03-19.at.20.33.12.mov
Screen.Recording.2025-03-19.at.20.32.14.mov
Window!.Page!.Navigation.PushModalAsync(new ContentPage()
{
	Content = new Label() { Text = "Hello from Modal Page!" }
}, true);

What do you think @pictos?

@kubaflo kubaflo requested a review from a team as a code owner March 19, 2025 19:37
@kubaflo kubaflo self-assigned this Mar 19, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 19, 2025
@dotnet-policy-service
Copy link
Contributor

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.

Copy link
Contributor

@pictos pictos left a 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?

@kubaflo
Copy link
Contributor Author

kubaflo commented Mar 19, 2025

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?

dialog.Window.SetLayout(width, height);

if (IsAnimated)
if (IsAnimated && !_wasStopped)
Copy link
Contributor

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.

Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's iterate on this path first
https://github.com/dotnet/maui/tree/modal_window_anim

See if this just naturally works

@PureWeen
Copy link
Member

closing in favor of #29557

@PureWeen PureWeen closed this May 21, 2025
@github-project-automation github-project-automation bot moved this from Changes Requested to Done in MAUI SDK Ongoing May 21, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Android] Modal Animation Repeats When Returning from Background

5 participants