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

Adding Avatar activity badge #1502

Merged
merged 10 commits into from
Jan 30, 2023
Merged

Conversation

sophialee0416
Copy link
Contributor

@sophialee0416 sophialee0416 commented Jan 20, 2023

Platforms Impacted

  • iOS
  • macOS

Description of changes

Binary change:

File Before After Delta
libFluentUI.a 28,908,720 bytes 28,977,656 bytes +68,936 bytes
Avatar 661,536 bytes 590,176 bytes -71,360 bytes
AvatarModifiers 36,352 bytes 41,688 bytes +5,336 bytes
AvatarTokenSet 120,768 bytes 136,816 bytes +16,048 bytes
AvatarGroup 362,344 bytes 362,520 bytes +176 bytes
ShapeCutout 36,448 bytes 39,280 bytes +2832 bytes
  • AvatarDemoController: Added toggle for displaying circle and square activity badges
  • AvatarDemoController_SwiftUI: Added Picker for MSFAvatarActivityStyles and a toggle to add a custom image
  • Avatar: Added new activityStyle and activityImage property in the Avatar state, removed unused PresenceCutout
  • AvatarModifiers: Added new modifier to create an activity badge
  • AvatarTokenSet: Moved a few existing tokens to constant, added new tokens for activity badge
  • ShapeCutout: Renamed from CircleCutout to give more shape creation versatility
  • AvatarGroup: Updated CircleCutout usage to ShapeCutout

Note: Activity is only displayed in .size40 and .size56, and in the .default style with image/initials.

Verification

LTR RTL
image image
image image
image image
image image
image image
image image

Presence (no change)

Before After
image image
image image

TableViewCell (no change)

Before After
image image

AvatarGroup (no change)
Simulator Screen Recording - iPhone 14 Pro - 2023-01-27 at 15 16 56

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

@sophialee0416 sophialee0416 requested a review from a team as a code owner January 20, 2023 10:09
@sophialee0416 sophialee0416 added the New API This PR introduces new API label Jan 20, 2023
@edjamesmsft
Copy link
Contributor

There is a fair amount of binary size increase unaccounted for - do you know where the rest might be coming from?

@sophialee0416 sophialee0416 added the API break This PR introduces a breaking API change label Jan 26, 2023
@harrieshin
Copy link
Contributor

avatargroup animation verification?

@edjamesmsft
Copy link
Contributor

I notice on the dark background screenshots, the cutout color isn't the same color as the background of the image. Is that expected? I assume that's just an icon issue and outside the scope of this PR?

image

@sophialee0416
Copy link
Contributor Author

I notice on the dark background screenshots, the cutout color isn't the same color as the background of the image. Is that expected? I assume that's just an icon issue and outside the scope of this PR?

image

Not an icon issue, intentional & by design

@edjamesmsft
Copy link
Contributor

I notice on the dark background screenshots, the cutout color isn't the same color as the background of the image. Is that expected? I assume that's just an icon issue and outside the scope of this PR?
image

Not an icon issue, intentional & by design

Ah I see the background of the icon is customizable. For the purposes of making that clear, I might choose a more different background color, so it looks more intentional. At the moment the colors are close enough that it looks potentially accidental. But not a blocker.

@sophialee0416
Copy link
Contributor Author

I notice on the dark background screenshots, the cutout color isn't the same color as the background of the image. Is that expected? I assume that's just an icon issue and outside the scope of this PR?
image

Not an icon issue, intentional & by design

Ah I see the background of the icon is customizable. For the purposes of making that clear, I might choose a more different background color, so it looks more intentional. At the moment the colors are close enough that it looks potentially accidental. But not a blocker.

This is also default by design. On the demo controller you can choose to use an alternate background if you'd like to see the border.

@harrieshin
Copy link
Contributor

make sure the avatar rings are fine too for both avatargroup and just avatar please!

@sophialee0416 sophialee0416 enabled auto-merge (squash) January 28, 2023 01:02
@sophialee0416 sophialee0416 requested a review from a team as a code owner January 28, 2023 04:48
@sophialee0416 sophialee0416 merged commit e576535 into microsoft:main Jan 30, 2023
@sophialee0416 sophialee0416 deleted the avatarActivity branch April 24, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API break This PR introduces a breaking API change New API This PR introduces new API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants