Skip to content

Implement enter end exit animation for Dialog#2596

Merged
Andrei Salavei (ASalavei) merged 16 commits into
jb-mainfrom
andrei.salavei/dialog-animation
Dec 8, 2025
Merged

Implement enter end exit animation for Dialog#2596
Andrei Salavei (ASalavei) merged 16 commits into
jb-mainfrom
andrei.salavei/dialog-animation

Conversation

@ASalavei

@ASalavei Andrei Salavei (ASalavei) commented Nov 26, 2025

Copy link
Copy Markdown
  • Implement Enter and Exit animation for Dialog
  • Exit animation performed using dedicated GraphicsLayer with content snapshot for fade-out animation
  • Add animateTransition parameter to the DialogProperties

Fixes https://youtrack.jetbrains.com/issue/CMP-4365/iOS-iOS-Dialog-has-no-enter-and-exit-animation

Animation
iOS:

Simulator.Screen.Recording.-.iPhone.16.-.2025-10-23.at.16.01.19.mp4

Desktop:

Screen.Recording.2025-10-23.at.15.50.47.mov

Comparing with Android:

Screen.Recording.2025-09-01.at.16.03.32.mov

Release Notes

Features - Multiple Platforms

  • Add enter end exit animation for Dialog. It can be disabled via DialogProperties.animateTransition or via global feature flag ComposeUiFlags.isDialogAnimationEnabled

@ASalavei Andrei Salavei (ASalavei) changed the title Andrei.salavei/dialog animation Implement enter end exit animation for Dialog Nov 26, 2025
Andrei Salavei (ASalavei) added a commit that referenced this pull request Dec 4, 2025
Required due to the introduction of a new API (#2596) that needs to be
consumed in material3

## Release Notes
N/A

@MatkovIvan Ivan Matkov (MatkovIvan) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM in general, just a few minor things

Comment thread compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/window/Dialog.skiko.kt Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we add a test that validates the crash we had with the previous solution (due to reparenting the content) doesn't happen?

Comment thread compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/window/Dialog.skiko.kt Outdated
Comment thread compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/window/Dialog.skiko.kt Outdated
@ASalavei

Copy link
Copy Markdown
Author

Can we add a test that validates the crash we had with the previous solution (due to reparenting the content) doesn't happen?

Done

@MatkovIvan Ivan Matkov (MatkovIvan) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, just styling nitpicks

PS can't wait for adoption of automated formatter check

@ASalavei Andrei Salavei (ASalavei) merged commit 6272079 into jb-main Dec 8, 2025
16 checks passed
@ASalavei Andrei Salavei (ASalavei) deleted the andrei.salavei/dialog-animation branch December 8, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants