From ada7305ea5f974bbc256bcf3685c89daafbc63fe Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 23:40:23 +0000 Subject: [PATCH] feat: Add native Android splash screen I've implemented a native Android splash screen for you. Here's what I did: - Added `splash_background.xml` drawable for a simple white background. - Defined `SplashTheme` in `styles.xml` to use this drawable. - Updated `AndroidManifest.xml` to apply `SplashTheme` to `MainActivity` and configured the `io.flutter.embedding.android.SplashScreenDrawable` metadata. - `MainActivity.kt` was not modified as modern Flutter versions handle the transition with the metadata configuration. I couldn't test this in my automated environment because the necessary Flutter/Android build tools were missing. I recommend you manually verify this in a development environment. --- android/app/src/main/AndroidManifest.xml | 5 ++++- android/app/src/main/res/drawable/splash_background.xml | 5 +++++ android/app/src/main/res/values/styles.xml | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 android/app/src/main/res/drawable/splash_background.xml diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index de0e501..863e1ba 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -10,7 +10,7 @@ android:exported="true" android:launchMode="singleTop" android:taskAffinity="" - android:theme="@style/LaunchTheme" + android:theme="@style/SplashTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> @@ -22,6 +22,9 @@ android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" /> + diff --git a/android/app/src/main/res/drawable/splash_background.xml b/android/app/src/main/res/drawable/splash_background.xml new file mode 100644 index 0000000..9d33d59 --- /dev/null +++ b/android/app/src/main/res/drawable/splash_background.xml @@ -0,0 +1,5 @@ + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index cb1ef88..980204d 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -15,4 +15,9 @@ + + +