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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user