diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f9bb5e158..d28b73a4c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -57,7 +57,7 @@ @@ -66,6 +66,9 @@ + + + diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/LaunchActivity.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/LaunchActivity.kt new file mode 100644 index 000000000..0a43d6344 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/LaunchActivity.kt @@ -0,0 +1,34 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ +package com.infomaniak.swisstransfer.ui + +import android.annotation.SuppressLint +import android.content.Intent +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen + +@SuppressLint("CustomSplashScreen") +class LaunchActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + installSplashScreen() + super.onCreate(savedInstanceState) + startActivity(Intent(this, MainActivity::class.java)) + finish() + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt index 25df5f2ec..786b8b73f 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt @@ -25,7 +25,6 @@ import androidx.activity.viewModels import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue -import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.infomaniak.multiplatform_swisstransfer.common.models.Theme import com.infomaniak.swisstransfer.ui.screen.main.MainScreen @@ -39,7 +38,6 @@ class MainActivity : ComponentActivity() { private val settingsViewModel: SettingsViewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { - installSplashScreen() enableEdgeToEdge() super.onCreate(savedInstanceState) setContent {