refactor: Update MainActivity for edge-to-edge display support

- Implemented modern edge-to-edge display handling for Android 15+ in MainActivity.kt.
- Removed deprecated SystemUiMode.edgeToEdge configuration from main.dart, as edge-to-edge is now managed natively.
- Ensured backward compatibility by maintaining the previous edge-to-edge display settings for lower Android versions.
This commit is contained in:
cogwheel0
2025-10-20 23:56:40 +05:30
parent e05a560966
commit a0a0d43116
2 changed files with 11 additions and 10 deletions

View File

@@ -10,10 +10,15 @@ class MainActivity : FlutterActivity() {
private lateinit var backgroundStreamingHandler: BackgroundStreamingHandler
override fun onCreate(savedInstanceState: Bundle?) {
// Ensure content draws behind system bars (backwards compatible helper)
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
// Modern edge-to-edge implementation for Android 15+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
window.decorView.setOnApplyWindowInsetsListener(null)
}
// Enable edge-to-edge display (backwards compatible)
WindowCompat.setDecorFitsSystemWindows(window, false)
}
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {