feat(android): enable edge-to-edge and set SDK to 36

This commit is contained in:
cogwheel0
2025-10-25 14:46:55 +05:30
parent b786687eb1
commit f463102105
4 changed files with 11 additions and 48 deletions

View File

@@ -16,13 +16,13 @@ if (keystorePropertiesFile.exists()) {
android {
namespace = "app.cogwheel.conduit"
compileSdk = flutter.compileSdkVersion
compileSdk = 36
ndkVersion = "27.0.12077973"
defaultConfig {
applicationId = "app.cogwheel.conduit"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
targetSdk = 36
versionCode = flutter.versionCode
versionName = flutter.versionName
}

View File

@@ -5,15 +5,22 @@ import io.flutter.embedding.engine.FlutterEngine
import android.os.Build
import android.os.Bundle
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsControllerCompat
class MainActivity : FlutterActivity() {
private lateinit var backgroundStreamingHandler: BackgroundStreamingHandler
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Enable edge-to-edge display (backwards compatible)
// Enable edge-to-edge display for all Android versions
// This is the official way to enable edge-to-edge that works with Android 15+
WindowCompat.setDecorFitsSystemWindows(window, false)
// Configure system bar appearance for edge-to-edge
val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView)
windowInsetsController.isAppearanceLightStatusBars = false
windowInsetsController.isAppearanceLightNavigationBars = false
}
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on for Android 15+ -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#0A0A0A</item>
<item name="android:enableEdgeToEdge">true</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
<item name="android:enableEdgeToEdge">true</item>
</style>
</resources>

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting for Android 15+ -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:enableEdgeToEdge">true</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
<item name="android:enableEdgeToEdge">true</item>
</style>
</resources>