Skip to content

traitCollectionDidChange loading indicator #4928

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

Merged
merged 6 commits into from
Jun 27, 2025

Conversation

joyceqin-stripe
Copy link
Collaborator

@joyceqin-stripe joyceqin-stripe commented May 22, 2025

Summary

The loading indicator color used to be based off of the system mode (light or dark) instead of the component color, and it wouldn't change its color in response to an appearance change. Now we use traitCollectionDidChange to calculate the correct color and change it when necessary.

Motivation

MOBILESDK-3426

Testing

Before

ScreenRecording_04-04-2025.11-12-05_1.MP4

After

Simulator.Screen.Recording.-.iPhone.16.-.2025-05-22.at.20.34.18.mp4

Changelog

N/A

This comment was marked as outdated.

@joyceqin-stripe joyceqin-stripe marked this pull request as ready for review May 23, 2025 15:57
@joyceqin-stripe joyceqin-stripe requested review from a team as code owners May 23, 2025 15:57
@@ -73,6 +73,14 @@ class LoadingViewController: UIViewController, BottomSheetContentViewController
])
activityIndicator.startAnimating()
}

#if !canImport(CompositorServices)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming this is to block vision OS? I believe we can now use #if !os(visionOS) since our minimum Xcode version supports this. Somewhere there was a comment about this that I can't find now. Maybe @davidme-stripe could confirm. Probably a good idea to clean up all of the #if !canImport(CompositorServices) uses to stop us from accidentally propagating this hack.

@@ -73,6 +73,14 @@ class LoadingViewController: UIViewController, BottomSheetContentViewController
])
activityIndicator.startAnimating()
}

#if !canImport(CompositorServices)
public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@gbirch-stripe gbirch-stripe left a comment

Choose a reason for hiding this comment

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

lgtm

@joyceqin-stripe joyceqin-stripe merged commit 386dbdb into master Jun 27, 2025
7 of 10 checks passed
@joyceqin-stripe joyceqin-stripe deleted the joyceqin/RUN_MOBILESDK-4050 branch June 27, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants