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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Notification animation tearing in SwiftUI #2018

Merged

Conversation

mischreiber
Copy link
Contributor

@mischreiber mischreiber commented May 7, 2024

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

Move FluentNotification to use Color instead of UIColor, which resolves the issue with animation tearing in iOS 17.

While developing this fix, I noticed that the animation curve is twice as slow in SwiftUI as in UIKit, so fixed that too.

Binary change

Total increase: 1,608 bytes
Total decrease: -78,792 bytes

File Before After Delta
Total 31,069,608 bytes 30,992,424 bytes 馃帀 -77,184 bytes
Full breakdown
File Before After Delta
IndeterminateProgressBar.o 230,320 bytes 231,928 bytes 鈿狅笍 1,608 bytes
NotificationTokenSet.o 94,216 bytes 94,016 bytes 馃帀 -200 bytes
FluentNotification.o 684,792 bytes 663,744 bytes 馃帀 -21,048 bytes
__.SYMDEF 4,861,000 bytes 4,837,816 bytes 馃帀 -23,184 bytes
UIKit+SwiftUI_interoperability.o 46,664 bytes 12,304 bytes 馃帀 -34,360 bytes

Verification

Texted all varieties of notification, in both dark and light mode.

Visual Verification

Before:

before.mp4

After:

after.mp4

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@mischreiber mischreiber requested a review from a team as a code owner May 7, 2024 18:23
@mischreiber mischreiber enabled auto-merge (squash) May 7, 2024 22:52
@mischreiber mischreiber merged commit 0000e4d into microsoft:main May 8, 2024
7 checks passed
@mischreiber mischreiber deleted the fluent-notification-animation branch May 8, 2024 02:12
@joannaquu joannaquu mentioned this pull request May 23, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants