-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(splashscreen): Add support for spinner on Android and iOS #1653
feat(splashscreen): Add support for spinner on Android and iOS #1653
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment.
And a few more things:
- Use 2 spaces instead of 4
- As most spinner names are different per platform, better use different config values for them, like
androidSpinnerStyle
andiosSpinnerStyle
, otherwise will not work unless the user changes it every time. - On iOS you have
launchSpinnerStyle
andlaunchSpinnerColor
that are not mentioned on the PR explanation and not present on Android. Why is that? - Don't add iOS 13 code yet, it's still on beta and might change. Also makes the tests to fail because that code is not available on Xcode 10.
- Document the new preferences in Splash docs
@@ -1,149 +1,270 @@ | |||
import Foundation | |||
import AudioToolbox | |||
|
|||
// https://stackoverflow.com/questions/24263007/how-to-use-hex-color-values | |||
extension UIColor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an UIColor extension already (UIColor.swift) with hex implementation, so move it all there. It's not good to have it inside another class, nor have hex duplicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your feedback, @jcesarmobile.
Please have a look at the changes, I hope I made it all right this time. Let me know if you have any other suggestions.
@jcesarmobile I am using This is the only one that uses 2 spaces instead of 4. Even if do copy/paste of code in Xcode itself, it will change to 4 spaces. I am not sure what kind of code formatter you are using, but I am open for any suggestion to do it the proper way. |
@jcesarmobile Thank you for the suggestion, it works that way in Xcode with 2 spaces indentation. |
I've made a few code changes on the iOS code fixing some mistakes and code formatting. Also simplified the iOS styles to just large and small, making large the default to match android default, because as they can be colored I think it doesn't make sense to have a grey option that you can change to another color. Android code looks good, going to merge, thanks! |
This pull request will add support for displaying a spinner on top of the splash screen, both for Android and iOS.
There are some new configuration keys:
true
will enable the spinner, defaults tofalse
.Android:
horizontal
,small
,large
,inverse
,smallInverse
,largeInverse
.iOS < 13:
whiteLarge
,large
,gray
.iOS >= 13:
large
,medium
.#RGB
or#ARGB
.Refers also to issue #928.