fluentui-apple
fluentui-apple copied to clipboard
Implement Shimmer in SwiftUI
Platforms Impacted
- [x] iOS
- [ ] macOS
Description of changes
Implement ShimmerView and ShimmerLinesView in SwiftUI
Known Issues:
- The existing logic is off with the shimmer angle (even in the UIKit implementation, the angles vary between the views). The shimmerAngle token's comment says "Angle of the direction of the gradient, in radian. 0 means horizontal, Pi/2 means vertical," but the formula for radians is degrees * (pi/180), not -(pi/degrees) as it currently is. I will address this in a separate change. For now, the SwiftUI implementation uses the .topLeading and .bottomTrailing UnitPoints for the gradient.
- matchedGeometryEffect syncs views was able to sync shimmers between two identical views, but I was not able to find a way to synchronize shimmers between views that are not the same (i.e. two views that are the same size will be in sync, but different views may fall out of sync). This will need to be addressed.
Pull request checklist
This PR has considered:
- [x] Light and Dark appearances
- [x] iOS supported versions (all major versions greater than or equal current target deployment version)
- [ ] VoiceOver and Keyboard Accessibility
- [x] Internationalization and Right to Left layouts
- [x] Different resolutions (1x, 2x, 3x)
- [x] Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
- [ ] iPad Pointer interaction
- [x] SwiftUI consumption (validation or new demo scenarios needed)
- [ ] Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow
Can you grab a before/after binary size comparison?
Can you grab a before/after binary size comparison?
Before: 34,391,068 bytes (34.8 MB on disk) After: 35,032,396 bytes (35.4 MB on disk)
Can you grab a before/after binary size comparison?
Before: 34,391,068 bytes (34.8 MB on disk) After: 35,032,396 bytes (35.4 MB on disk)
That's quite the increase. Do you think you could get the after size without the new demo, so we can see how much just the new control is adding?
Can you grab a before/after binary size comparison?
Before: 34,391,068 bytes (34.8 MB on disk) After: 35,032,396 bytes (35.4 MB on disk)
That's quite the increase. Do you think you could get the after size without the new demo, so we can see how much just the new control is adding?
Without the demo: 34,674,828 bytes (35.1 MB on disk)
Can you grab a before/after binary size comparison?
Before: 34,391,068 bytes (34.8 MB on disk) After: 35,032,396 bytes (35.4 MB on disk)
That's quite the increase. Do you think you could get the after size without the new demo, so we can see how much just the new control is adding?
Without the demo: 34,674,828 bytes (35.1 MB on disk)
I think we're still gonna have problems pitching a 280kB size increase for this one component...