|
30 | 30 | import java.io.InputStream;
|
31 | 31 | import android.graphics.Bitmap;
|
32 | 32 | import android.graphics.BitmapFactory;
|
| 33 | +import android.graphics.Color; |
33 | 34 |
|
34 | 35 | import org.libsdl.app.SDLActivity;
|
35 | 36 |
|
@@ -356,6 +357,30 @@ protected void showLoadingScreen() {
|
356 | 357 |
|
357 | 358 | mImageView = new ImageView(this);
|
358 | 359 | mImageView.setImageBitmap(bitmap);
|
| 360 | + |
| 361 | + /* |
| 362 | + * Edit this file: pythonforandroid/bootstraps/sdl2/build/templates/strings.tmpl.xml |
| 363 | + * and set the background presplash color |
| 364 | + * <?xml version="1.0" encoding="utf-8"?> |
| 365 | + * <resources> |
| 366 | + * <string name="app_name">{{ args.name }}</string> |
| 367 | + * <string name="private_version">0.1</string> |
| 368 | + * <string name="presplash_bkgcolor">#FF00FFFF</string> |
| 369 | + * </resources> |
| 370 | + * https://developer.android.com/reference/android/graphics/Color.html |
| 371 | + * Parse the color string, and return the corresponding color-int. |
| 372 | + * If the string cannot be parsed, throws an IllegalArgumentException exception. |
| 373 | + * Supported formats are: #RRGGBB #AARRGGBB or one of the following names: |
| 374 | + * 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', |
| 375 | + * 'lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey', 'aqua', 'fuchsia', |
| 376 | + * 'lime', 'maroon', 'navy', 'olive', 'purple', 'silver', 'teal'. |
| 377 | + */ |
| 378 | + String backgroundColor = resourceManager.getString("presplash_bkgcolor"); |
| 379 | + if (backgroundColor != null) { |
| 380 | + try { |
| 381 | + mImageView.setBackgroundColor(Color.parseColor(backgroundColor)); |
| 382 | + } catch (IllegalArgumentException e) {} |
| 383 | + } |
359 | 384 | mImageView.setLayoutParams(new ViewGroup.LayoutParams(
|
360 | 385 | ViewGroup.LayoutParams.FILL_PARENT,
|
361 | 386 | ViewGroup.LayoutParams.FILL_PARENT));
|
|
0 commit comments