|
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,23 @@ protected void showLoadingScreen() {
|
356 | 357 |
|
357 | 358 | mImageView = new ImageView(this);
|
358 | 359 | mImageView.setImageBitmap(bitmap);
|
| 360 | + |
| 361 | + /* |
| 362 | + * Set the presplash loading screen background color |
| 363 | + * https://developer.android.com/reference/android/graphics/Color.html |
| 364 | + * Parse the color string, and return the corresponding color-int. |
| 365 | + * If the string cannot be parsed, throws an IllegalArgumentException exception. |
| 366 | + * Supported formats are: #RRGGBB #AARRGGBB or one of the following names: |
| 367 | + * 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', |
| 368 | + * 'lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey', 'aqua', 'fuchsia', |
| 369 | + * 'lime', 'maroon', 'navy', 'olive', 'purple', 'silver', 'teal'. |
| 370 | + */ |
| 371 | + String backgroundColor = resourceManager.getString("presplash_color"); |
| 372 | + if (backgroundColor != null) { |
| 373 | + try { |
| 374 | + mImageView.setBackgroundColor(Color.parseColor(backgroundColor)); |
| 375 | + } catch (IllegalArgumentException e) {} |
| 376 | + } |
359 | 377 | mImageView.setLayoutParams(new ViewGroup.LayoutParams(
|
360 | 378 | ViewGroup.LayoutParams.FILL_PARENT,
|
361 | 379 | ViewGroup.LayoutParams.FILL_PARENT));
|
|
0 commit comments