From 8f62a4efbe09f1d154faa8e3f264064c8110a99f Mon Sep 17 00:00:00 2001
From: cogwheel0 <172976095+cogwheel0@users.noreply.github.com>
Date: Mon, 25 Aug 2025 11:09:20 +0530
Subject: [PATCH] chore: fix android 15 edge to edge warnings
---
.../app/cogwheel/conduit/MainActivity.kt | 8 +++++
.../app/src/main/res/values-night/styles.xml | 9 ++++-
.../app/src/main/res/values-v31/styles.xml | 9 ++++-
.../app/src/main/res/values-v35/styles.xml | 33 +++++++++++++++++++
android/app/src/main/res/values/styles.xml | 9 ++++-
lib/core/services/platform_service.dart | 9 +++--
6 files changed, 72 insertions(+), 5 deletions(-)
create mode 100644 android/app/src/main/res/values-v35/styles.xml
diff --git a/android/app/src/main/kotlin/app/cogwheel/conduit/MainActivity.kt b/android/app/src/main/kotlin/app/cogwheel/conduit/MainActivity.kt
index e4ac145..fd5fe0f 100644
--- a/android/app/src/main/kotlin/app/cogwheel/conduit/MainActivity.kt
+++ b/android/app/src/main/kotlin/app/cogwheel/conduit/MainActivity.kt
@@ -2,10 +2,18 @@ package app.cogwheel.conduit
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
+import android.os.Bundle
+import androidx.core.view.WindowCompat
class MainActivity : FlutterActivity() {
private lateinit var backgroundStreamingHandler: BackgroundStreamingHandler
+ override fun onCreate(savedInstanceState: Bundle?) {
+ // Enable edge-to-edge display for Android 15+ compatibility
+ WindowCompat.setDecorFitsSystemWindows(window, false)
+ super.onCreate(savedInstanceState)
+ }
+
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml
index dbc9ea9..11115bc 100644
--- a/android/app/src/main/res/values-night/styles.xml
+++ b/android/app/src/main/res/values-night/styles.xml
@@ -7,8 +7,11 @@
- @drawable/launch_background
- false
- false
- - false
+
+ - true
- shortEdges
+ - @android:color/transparent
+ - @android:color/transparent
diff --git a/android/app/src/main/res/values-v31/styles.xml b/android/app/src/main/res/values-v31/styles.xml
index a6497f8..2cbe5b7 100644
--- a/android/app/src/main/res/values-v31/styles.xml
+++ b/android/app/src/main/res/values-v31/styles.xml
@@ -4,9 +4,12 @@
diff --git a/android/app/src/main/res/values-v35/styles.xml b/android/app/src/main/res/values-v35/styles.xml
new file mode 100644
index 0000000..85122a2
--- /dev/null
+++ b/android/app/src/main/res/values-v35/styles.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
index 0d1fa8f..2c89051 100644
--- a/android/app/src/main/res/values/styles.xml
+++ b/android/app/src/main/res/values/styles.xml
@@ -7,8 +7,11 @@
- @drawable/launch_background
- false
- false
- - false
+
+ - true
- shortEdges
+ - @android:color/transparent
+ - @android:color/transparent
diff --git a/lib/core/services/platform_service.dart b/lib/core/services/platform_service.dart
index 42fab57..95529a4 100644
--- a/lib/core/services/platform_service.dart
+++ b/lib/core/services/platform_service.dart
@@ -312,6 +312,7 @@ class PlatformService {
}
/// Apply platform-specific status bar styling
+ /// Updated for Android 15+ edge-to-edge compatibility
static void setPlatformStatusBarStyle({
bool isDarkContent = false,
Color? backgroundColor,
@@ -329,16 +330,20 @@ class PlatformService {
),
);
} else {
+ // For Android 15+, use edge-to-edge approach
+ // Avoid deprecated setStatusBarColor, setNavigationBarColor, setNavigationBarDividerColor
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
- statusBarColor: backgroundColor ?? Colors.transparent,
+ // Only set icon brightness, avoid deprecated color properties
statusBarIconBrightness: isDarkContent
? Brightness.dark
: Brightness.light,
- systemNavigationBarColor: backgroundColor,
systemNavigationBarIconBrightness: isDarkContent
? Brightness.dark
: Brightness.light,
+ // Use transparent colors for edge-to-edge
+ statusBarColor: Colors.transparent,
+ systemNavigationBarColor: Colors.transparent,
),
);
}