mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-13 11:29:01 -04:00
Backport splash screen to API 26 (#2747)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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),
|
||||
|
||||
21
app/src/main/res/drawable-anydpi/ic_splash.xml
Normal file
21
app/src/main/res/drawable-anydpi/ic_splash.xml
Normal 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>
|
||||
19
app/src/main/res/values-night/colors.xml
Normal file
19
app/src/main/res/values-night/colors.xml
Normal 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>
|
||||
27
app/src/main/res/values-night/styles.xml
Normal file
27
app/src/main/res/values-night/styles.xml
Normal 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>
|
||||
@@ -16,4 +16,5 @@
|
||||
-->
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#67ea94</color>
|
||||
<color name="ic_splash">#000000</color>
|
||||
</resources>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user