Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

New Avatar API: hasBackgroundOutline #2081

Merged
merged 2 commits into from
Aug 3, 2024

Conversation

mischreiber
Copy link
Contributor

@mischreiber mischreiber commented Aug 2, 2024

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

Adding a new API for Avatar and AvatarGroup that optionally renders an outline around the Avatar instances with the Fluent background color.

This is the same color (and the same logic) that is used when drawing a ring around the Avatar. Useful for when the control is being rendered atop a dark or complicated background, such as a photo.

As an addendum, this change also brings formal deprecation to the isTransparent property of Avatar. This is from a very old version of the Fluent spec, and should not be used anymore. The default value has been changed to false, and will be fully removed in a future version of Fluent.

Binary change

Total increase: 31,000 bytes
Total decrease: 0 bytes

File Before After Delta
Total 31,248,472 bytes 31,279,472 bytes ⚠️ 31,000 bytes
Full breakdown
File Before After Delta
AvatarGroup.o 383,488 bytes 399,688 bytes ⚠️ 16,200 bytes
Avatar.o 601,344 bytes 609,088 bytes ⚠️ 7,744 bytes
__.SYMDEF 4,860,560 bytes 4,865,256 bytes ⚠️ 4,696 bytes
AvatarModifiers.o 45,952 bytes 47,760 bytes ⚠️ 1,808 bytes
FocusRingView.o 846,992 bytes 847,520 bytes ⚠️ 528 bytes
MSFAvatarGroup.o 30,352 bytes 30,376 bytes ⚠️ 24 bytes

Verification

Verified enabling and disabling the value in both UIKit and SwiftUI.

Visual Verification
UIKit SwiftUI
UIKit SwiftUI
UIKit_Dark SwiftUI_Dark

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 August 2, 2024 18:15
@mischreiber mischreiber added the New API This PR introduces new API label Aug 2, 2024
@mischreiber mischreiber enabled auto-merge (squash) August 3, 2024 01:11
@mischreiber mischreiber merged commit 2421cf4 into microsoft:main Aug 3, 2024
7 checks passed
@mischreiber mischreiber deleted the avatarBackgroundOutline branch August 3, 2024 17:02
@harrieshin harrieshin mentioned this pull request Aug 16, 2024
12 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
New API This PR introduces new API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants