From 69841ebd59bc137cfe38e5752ebca11f5fab39c5 Mon Sep 17 00:00:00 2001 From: Phil Oliver <3497406+poliver@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:33:30 -0400 Subject: [PATCH] Backport splash screen to API 26 (#2747) --- app/src/google/AndroidManifest.xml | 2 +- app/src/main/AndroidManifest.xml | 2 +- .../java/com/geeksville/mesh/MainActivity.kt | 2 ++ .../main/res/drawable-anydpi/ic_splash.xml | 21 +++++++++++++++ app/src/main/res/values-night/colors.xml | 19 +++++++++++++ app/src/main/res/values-night/styles.xml | 27 +++++++++++++++++++ app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/styles.xml | 16 +++++++++-- 8 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable-anydpi/ic_splash.xml create mode 100644 app/src/main/res/values-night/colors.xml create mode 100644 app/src/main/res/values-night/styles.xml diff --git a/app/src/google/AndroidManifest.xml b/app/src/google/AndroidManifest.xml index 30c5add98..face7326d 100644 --- a/app/src/google/AndroidManifest.xml +++ b/app/src/google/AndroidManifest.xml @@ -29,7 +29,7 @@ android:label="@string/app_name" android:supportsRtl="true" android:hardwareAccelerated="true" - android:theme="@style/AppTheme" + android:theme="@style/SplashTheme" android:localeConfig="@xml/locales_config"> diff --git a/app/src/main/java/com/geeksville/mesh/MainActivity.kt b/app/src/main/java/com/geeksville/mesh/MainActivity.kt index 9fbb95717..15da8e36c 100644 --- a/app/src/main/java/com/geeksville/mesh/MainActivity.kt +++ b/app/src/main/java/com/geeksville/mesh/MainActivity.kt @@ -44,6 +44,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.platform.LocalView import androidx.core.content.edit import androidx.core.net.toUri +import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.lifecycle.lifecycleScope import com.geeksville.mesh.android.BindFailedException import com.geeksville.mesh.android.GeeksvilleApplication @@ -80,6 +81,7 @@ class MainActivity : private var showAppIntro by mutableStateOf(false) override fun onCreate(savedInstanceState: Bundle?) { + installSplashScreen() enableEdgeToEdge( // Disable three-button navbar scrim on pre-Q devices navigationBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT), diff --git a/app/src/main/res/drawable-anydpi/ic_splash.xml b/app/src/main/res/drawable-anydpi/ic_splash.xml new file mode 100644 index 000000000..f5f632822 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_splash.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml new file mode 100644 index 000000000..c85e84c94 --- /dev/null +++ b/app/src/main/res/values-night/colors.xml @@ -0,0 +1,19 @@ + + + #FFFFFF + diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..235481fee --- /dev/null +++ b/app/src/main/res/values-night/styles.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 351badbfe..388590f28 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -16,4 +16,5 @@ --> #67ea94 + #000000 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c2b8746f5..1a668ba6d 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -15,8 +15,20 @@ along with this program. If not, see . --> - + - + + + +