Backport splash screen to API 26 (#2747)

This commit is contained in:
Phil Oliver
2025-08-15 21:33:30 -04:00
committed by GitHub
parent e9a03e5658
commit 69841ebd59
8 changed files with 86 additions and 4 deletions

View File

@@ -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">
<meta-data
android:name="com.google.android.geo.API_KEY"

View File

@@ -104,7 +104,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">
<!-- Default crash collection and analytics off until we (possibly) turn it on in application.onCreate -->

View File

@@ -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),

View File

@@ -0,0 +1,21 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="2.4944882"
android:scaleY="2.4944882"
android:translateX="18.36"
android:translateY="18.36">
<path
android:pathData="m17.5564,11.8482 l-5.208,7.6376 -1.5217,-1.0377 5.9674,-8.7512c0.1714,-0.2513 0.4558,-0.4019 0.76,-0.4022 0.3042,-0.0003 0.5889,0.1497 0.7608,0.4008l5.9811,8.7374 -1.5199,1.0404z"
android:strokeLineJoin="round"
android:fillColor="@color/ic_splash"
android:fillType="evenOdd"/>
<path
android:pathData="m5.854,19.4956 l6.3707,-9.3423 -1.5749,-1.0739 -6.3707,9.3423z"
android:strokeLineJoin="round"
android:fillColor="@color/ic_splash"
android:fillType="evenOdd"/>
</group>
</vector>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright (c) 2025 Meshtastic LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<resources>
<color name="ic_splash">#FFFFFF</color>
</resources>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright (c) 2025 Meshtastic LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Shim in the system UI overrides -->
<style name="SplashTheme.NightAdjusted" parent="Theme.SplashScreen">
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
<item name="windowSplashScreenBackground">#000000</item>
</style>
</resources>

View File

@@ -16,4 +16,5 @@
-->
<resources>
<color name="ic_launcher_background">#67ea94</color>
<color name="ic_splash">#000000</color>
</resources>

View File

@@ -15,8 +15,20 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.Material3.DynamicColors.DayNight.NoActionBar"/>
<!-- Shim in the system UI overrides -->
<style name="SplashTheme.NightAdjusted" parent="Theme.SplashScreen">
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
<item name="windowSplashScreenBackground">#FFFFFF</item>
</style>
<style name="SplashTheme" parent="SplashTheme.NightAdjusted">
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash</item>
<item name="postSplashScreenTheme">@style/AppTheme</item>
</style>
<style name="AppTheme" parent="Theme.Material3.DynamicColors.DayNight.NoActionBar" />
</resources>