diff options
| author | David Göransson <david.goransson@mullvad.net> | 2024-12-09 14:45:41 +0100 |
|---|---|---|
| committer | David Göransson <david.goransson@mullvad.net> | 2024-12-09 16:09:39 +0100 |
| commit | 897f04a7e18f5bc36617a73a4b890aea380449c1 (patch) | |
| tree | 4809703452f223680fe18e6bfb1a58117782fb66 /android | |
| parent | 018fe963c17b360fcf7623370785420ae41eda2e (diff) | |
| download | mullvadvpn-897f04a7e18f5bc36617a73a4b890aea380449c1.tar.xz mullvadvpn-897f04a7e18f5bc36617a73a4b890aea380449c1.zip | |
Use enableEdgeToEdge helper function
Address a warning in Google Play console warning us not to
use the legacy way of enables edge to edge.
Diffstat (limited to 'android')
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt index d6f8b08279..baf2da3b70 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt @@ -1,12 +1,14 @@ package net.mullvad.mullvadvpn.ui import android.content.Intent +import android.graphics.Color import android.os.Bundle import androidx.activity.ComponentActivity +import androidx.activity.SystemBarStyle import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import androidx.activity.result.contract.ActivityResultContracts import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen -import androidx.core.view.WindowCompat import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle @@ -59,9 +61,10 @@ class MainActivity : ComponentActivity(), AndroidScopeComponent { !isReady } - // Tell the system that we will draw behind the status bar and navigation bar - // This needs to be called after installSplashScreen() - WindowCompat.setDecorFitsSystemWindows(window, false) + enableEdgeToEdge( + statusBarStyle = SystemBarStyle.dark(Color.TRANSPARENT), + navigationBarStyle = SystemBarStyle.dark(Color.TRANSPARENT), + ) super.onCreate(savedInstanceState) |
