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

Easy way to set the presplash background color #904

Merged
merged 2 commits into from
Nov 26, 2016

Conversation

mrhdias
Copy link
Contributor

@mrhdias mrhdias commented Oct 12, 2016

Easy way to set the presplash background color of Loading Screen.

--presplash-color=#AARRGGBB, --presplash-color=#RRGGBB or --presplash-color=red

Default color: #FFFFFFFF (white)

More information:
https://developer.android.com/reference/android/graphics/Color.html
Parse the color string, and return the corresponding color-int. If the string cannot be parsed, throws an IllegalArgumentException exception. Supported formats are: #RRGGBB #AARRGGBB or one of the following names: 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', 'lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey', 'aqua', 'fuchsia', 'lime', 'maroon', 'navy', 'olive', 'purple', 'silver', 'teal'.

Easy way to set the presplash background color of Loading Screen.

Edit this file: pythonforandroid/bootstraps/sdl2/build/templates/strings.tmpl.xml
and set the background presplash color

<?xml version="1.0" encoding="utf-8"?>
    <resources>
    <string name="app_name">{{ args.name }}</string>
    <string name="private_version">0.1</string>
    <string name="presplash_bkgcolor">#FF00FFFF</string>
</resources>

More information:
https://developer.android.com/reference/android/graphics/Color.html
Parse the color string, and return the corresponding color-int. If the string cannot be parsed, throws an IllegalArgumentException exception. Supported formats are: #RRGGBB #AARRGGBB or one of the following names: 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', 'lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey', 'aqua', 'fuchsia', 'lime', 'maroon', 'navy', 'olive', 'purple', 'silver', 'teal'.
@KeyWeeUsr
Copy link
Contributor

KeyWeeUsr commented Oct 12, 2016

There are .tmpl.xml template files. If you edit them to fetch {{ variable }} and put it into build.py file of a desired bootstrap, it'll do the same. Hint: it's the render() function. It'll be more desired to use this way than just search through android docs and blindly try + you can make it as an argument, with all available values in the help or something in this way :)

@mrhdias
Copy link
Contributor Author

mrhdias commented Oct 12, 2016

Thanks for the help, I make it work as you said.

I changed the name from to "presplash_bkgcolor" to to "presplash_color".
@inclement inclement merged commit 36d5492 into kivy:master Nov 26, 2016
@inclement
Copy link
Member

Sorry for the delay testing this, but it looks good, thanks! I've switched the default to black to match the old behaviour though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants