Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ flutter pub run flutter_launcher_icons

Or manually create PNG icons in each mipmap density folder (mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi).

## Edge-to-Edge Display (Android 15 / API 35)

From Android 15, apps targeting SDK 35 have edge-to-edge display enforced by default. This means app content draws behind the system bars (status bar and navigation bar).

### What was done

`MainActivity.kt` overrides `onCreate` and calls `enableEdgeToEdge()` before `super.onCreate()`. This:

- Satisfies Google Play's edge-to-edge requirement for apps targeting API 35
- Makes system bars transparent and allows content to draw behind them
- Provides backward compatibility for Android 9–14 devices

Flutter's `Scaffold`, `AppBar`, and `NavigationBar` widgets already handle window insets automatically via `MediaQuery`, so no Flutter-side UI changes were needed.

## Building for Android

To build the Android app:
Expand Down
14 changes: 13 additions & 1 deletion android/app/src/main/kotlin/ralcock/cbf/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
package ralcock.cbf

import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity()
class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
// Enable edge-to-edge display for Android 15+ (API 35) compatibility.
// This ensures system bars are transparent and content draws behind them,
// satisfying Android 15's mandatory edge-to-edge enforcement. Calling this
// before super.onCreate() also provides backward compatibility on Android 9–14.
// Flutter's Scaffold/AppBar/NavigationBar handle window insets automatically.
enableEdgeToEdge()
super.onCreate(savedInstanceState)
}
}