Skip to content

Commit

Permalink
fix: Remove double SplashScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Oct 10, 2024
1 parent ed55b1d commit f88f667
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/com/infomaniak/mail/ui/LaunchActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavDeepLinkBuilder
import com.infomaniak.lib.core.extensions.keepSplashscreenVisibleWhileLoading
import com.infomaniak.lib.core.extensions.setDefaultLocaleIfNeeded
import com.infomaniak.lib.stores.StoreUtils.checkUpdateIsRequired
import com.infomaniak.mail.BuildConfig
Expand Down Expand Up @@ -70,6 +71,8 @@ class LaunchActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

keepSplashscreenVisibleWhileLoading()

setDefaultLocaleIfNeeded()

handleNotificationDestinationIntent()
Expand Down
28 changes: 28 additions & 0 deletions app/src/main/res/values-night-v31/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Infomaniak Mail - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ 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 <http://www.gnu.org/licenses/>.
-->
<resources>

<style name="AppThemeLauncher31" parent="AppTheme.LauncherBase">
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splashscreen_animated_icon</item>
<item name="android:windowSplashScreenBackground">@color/backgroundColor</item>
<item name="android:windowSplashScreenBrandingImage">@drawable/splashscreen_branding_image</item>
</style>

<style name="AppThemeLauncher" parent="AppThemeLauncher31" />

</resources>
27 changes: 27 additions & 0 deletions app/src/main/res/values-night-v32/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Infomaniak Mail - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ 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 <http://www.gnu.org/licenses/>.
-->
<resources>

<style name="AppThemeLauncher32" parent="AppThemeLauncher31">
<!-- Not a magic value: "The maximum animation duration should be limited below 1000ms." -->
<item name="android:windowSplashScreenAnimationDuration">1000</item>
</style>

<style name="AppThemeLauncher" parent="AppThemeLauncher32" />

</resources>
26 changes: 26 additions & 0 deletions app/src/main/res/values-night-v33/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Infomaniak Mail - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ 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 <http://www.gnu.org/licenses/>.
-->
<resources>

<style name="AppThemeLauncher33" parent="AppThemeLauncher32">
<item name="android:windowSplashScreenBehavior">icon_preferred</item>
</style>

<style name="AppThemeLauncher" parent="AppThemeLauncher33" />

</resources>
2 changes: 0 additions & 2 deletions app/src/main/res/values-v31/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splashscreen_animated_icon</item>
<item name="android:windowSplashScreenBackground">@color/backgroundColor</item>
<item name="android:windowSplashScreenBrandingImage">@drawable/splashscreen_branding_image</item>
<!-- Not a magic value: "The maximum animation duration should be limited below 1000ms." -->
<item name="android:windowSplashScreenAnimationDuration">1000</item>
</style>

<style name="AppThemeLauncher" parent="AppThemeLauncher31" />
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/res/values-v32/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Infomaniak Mail - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ 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 <http://www.gnu.org/licenses/>.
-->
<resources>

<style name="AppThemeLauncher32" parent="AppThemeLauncher31">
<!-- Not a magic value: "The maximum animation duration should be limited below 1000ms." -->
<item name="android:windowSplashScreenAnimationDuration">1000</item>
</style>

<style name="AppThemeLauncher" parent="AppThemeLauncher32" />

</resources>
26 changes: 26 additions & 0 deletions app/src/main/res/values-v33/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Infomaniak Mail - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ 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 <http://www.gnu.org/licenses/>.
-->
<resources>

<style name="AppThemeLauncher33" parent="AppThemeLauncher32">
<item name="android:windowSplashScreenBehavior">icon_preferred</item>
</style>

<style name="AppThemeLauncher" parent="AppThemeLauncher33" />

</resources>

0 comments on commit f88f667

Please sign in to comment.