Skip to content
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

Add crossfade animation during orientation change when used within UIKit hierarchy #778

Merged
merged 7 commits into from Aug 31, 2023

Conversation

elijah-semyonov
Copy link

@elijah-semyonov elijah-semyonov commented Aug 30, 2023

Proposed Changes

Add crossfade animation during orientation change to avoid stretching (Compose doesn't support per-view frame interpolation like native UIKit does)

Testing

Test: instantiate ComposeWindow outside of SwiftUI UIViewControllerRepresentable context, rotate the device.

Videos

Before

RPReplay_Final1693396041.MP4

After

RPReplay_Final1693395717.MP4
RPReplay_Final1693395836.MP4

@dima-avdeev-jb
Copy link

Found janks in our Demo project on simulator:

Screen.Recording.2023-08-30.at.19.54.20.mp4

@elijah-semyonov
Copy link
Author

Found janks in our Demo project on simulator:

Fixed in 0a22390

# Conflicts:
#	compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/window/ComposeWindow.uikit.kt
@elijah-semyonov elijah-semyonov merged commit 8f57b8c into jb-main Aug 31, 2023
3 checks passed
@elijah-semyonov elijah-semyonov deleted the es/ios-proper-orientation-change-animation branch August 31, 2023 09:53
updateLayout(it)
}
}
}

private fun UIViewController.checkIfInsideSwiftUI(): Boolean {
var parent = parentViewController
Copy link
Member

Choose a reason for hiding this comment

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

This part is not formatter properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants