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

CB-13392(Android & iOS): Display app version on splashscreen #148

Closed
wants to merge 6 commits into from

Conversation

j-corral
Copy link

Platforms affected

Android and iOS

What does this PR do?

This is a feature to display the app version on the splashscreen.
Documentation has been updated up to use this feature.

What testing has been done on this change?

Sorry there are no tests for this feature so i couldn't check items below.
Do no hesitate to join me if you need further informations.
Thanks.

Checklist

  • Reported an issue in the JIRA database
  • Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
  • Added automated test coverage as appropriate for this change.

@macdonst
Copy link
Member

@johnlejardinnier Pretty cool PR. I've specifically called out some folks to review your PR.

@macdonst
Copy link
Member

@infil00p ah, now I see you already reviewed an earlier version of this PR.

@johnlejardinnier in the future, you can just push a new commit to the PR branch so you don't have to close and re-open a new one.

@j-corral
Copy link
Author

@macdonst Thanks a lot !
Sorry i've closed previous PR because it was not made properly (Not reported on JIRA and wrong commit name).
Now it's clean.

Thank you for the tip, this is my first contribution.

Copy link
Contributor

@kerrishotts kerrishotts left a comment

Choose a reason for hiding this comment

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

Thanks for your PR -- cool stuff, and I hope we see more PRs from you in the future! I've left a few specific points in the code itself, but a few general things also stand out:

  1. It'd be great if this were available on all supported platforms. I'm a great believer in consistency, and although iOS/Android account for the majority of use, it'd be nice to see this extended to Browser and UWP at least. (Note that this isn't required...)

  2. I'd like to see some of the constants become actual constants (rather than magic values) -- especially default values. I can infer some of those things, but it'd be nicer (I think) if they were actual constants.

  3. Docs should be clear about where the version # comes from (I wonder if this would eventually need to become a pref as well?)

README.md Outdated Show resolved Hide resolved
src/android/SplashScreen.java Outdated Show resolved Hide resolved
src/ios/CDVSplashScreen.m Outdated Show resolved Hide resolved
position = (mainScreenWidth / 2) - padding;
}

CGRect rect = CGRectMake(position, mainScreenHeight - 30.0, textSize.width, textSize.height);
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious -- what's this look like on an iPhone X? Does this clear the home screen indicator?

@@ -60,6 +60,63 @@ - (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NS
[self updateImage];
}

- (UIColor *)colorFromHexString:(NSString *)hexString {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does Cordova not export any methods to handle color parsing in preferences? (I don't know -- have't looked). If it does, I'd suggest using those, rather than building your own. If not, a few thoughts:

  1. Would it make sense to support the case where the user forgets "#"?
  2. Would it make sense to support the backgroundColor pref case where it uses "0x" instead?

Copy link
Author

Choose a reason for hiding this comment

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

For the moment i will not change this part because i don't know what is the better solution.

Copy link
Member

Choose a reason for hiding this comment

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

statusbar plugin uses a similar code for this. It's in the plugin, not provided by Cordova. It also checks that the color is a string (it's not a problem here as it's a preference, so I think we can be sure that it's a string. But also checks the length and the #

Copy link
Contributor

Choose a reason for hiding this comment

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

Statusbar handles all of this in js here: https://github.com/apache/cordova-plugin-statusbar/blob/master/www/statusbar.js#L75
including shortcut css, like #345 => #334455

@j-corral
Copy link
Author

@kerrishotts Thank you so much for your review.
I will make some changes, then i'll push a new commit as soon as possible.

@purplecabbage
Copy link
Contributor

I think this is a nice feature, thanks for contributing!
I agree with @kerrishotts that windows support should be there for consistency. That is, if this feature is going into the splashscreen plugin ... I also see no reason why this could not be its own plugin that depends on the splashscreen plugin ... and just adds this feature.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
In this case you'll have `v1.0`


###### Customize app version
Copy link
Member

Choose a reason for hiding this comment

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

What font will be used? Maybe add an example screenshot here so one can visualize what it will look like.

Copy link
Author

@j-corral j-corral Jan 24, 2018

Choose a reason for hiding this comment

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

For the screenshot, could i commit picture into the repo ?
Or do i need to upload file on the web ?

Copy link
Member

Choose a reason for hiding this comment

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

Just can just paste images into comments - they will automatically be uploaded and shown.

@janpio
Copy link
Member

janpio commented Jan 24, 2018

Very nice feature and a good addition to the splashscreen functionality @johnlejardinnier.
I left some comment on the docs part of it.

Copy link
Member

@infil00p infil00p left a comment

Choose a reason for hiding this comment

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

LGTM! Just need the docs updated as per @janpio's suggestions and it's all good to go.

@j-corral
Copy link
Author

Thanks all for your time and reviews :)
For the moment i will update docs, following @janpio suggestions.
So you will be able to merge this PR.
Then when i will have some time, i will try to improve compatibility for Windows as asked.

@purplecabbage
Copy link
Contributor

purplecabbage commented Jan 24, 2018 via email

@purplecabbage
Copy link
Contributor

This is how you attach an image to a comment ...

35361925-1c20836a-0118-11e8-86e0-21b04057f5f1

Please remove the file from your pr.

@erisu
Copy link
Member

erisu commented Jun 26, 2020

The SplashScreen plugin for iOS has been integrated into the cordova-ios platform repo as a core feature of iOS. The iOS source code no longer resides in this repo and has been removed.

If you believe that this is a still needed feature for iOS, please create a new PR on the cordova-ios repo with the iOS changes.

As for Android, Android still requires this plugin so this PR will still be needed for Android. I would recommend remove the iOS changes from this PR and rebase the PR with master.

@NiklasMerz NiklasMerz closed this Apr 2, 2022
Apache Cordova: Plugin Pull Requests automation moved this from ⏳ Ready for Review to ☠️ Closed/Abandoned Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

9 participants