Skip to content

Commit c0f65e8

Browse files
Android edge-to-edge fixes
This fixes Android with bottom navigation that ends up on the side after rotate. There's a size heuristic to identify camera cut-out vs navigation that we can revisit in future if needed.
1 parent 86ca7f4 commit c0f65e8

File tree

11 files changed

+285
-164
lines changed

11 files changed

+285
-164
lines changed

android/app/src/main/java/org/microbit/createai/MainActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ public class MainActivity extends BridgeActivity {
99
@Override
1010
public void onStart() {
1111
super.onStart();
12+
// Enable edge-to-edge mode for all Android versions.
13+
// On API 35+ this is automatic, but older versions need this call
14+
// to make status/navigation bars transparent and allow content underneath.
15+
// The @capacitor-community/safe-area plugin handles icon colors via config.
1216
EdgeToEdge.enable(this);
1317
}
1418

capacitor.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ const config: CapacitorConfig = {
88
android: {
99
adjustMarginsForEdgeToEdge: "disable",
1010
},
11+
plugins: {
12+
SafeArea: {
13+
// "DARK" = light/white icons for dark header background
14+
// (confusing name - it refers to the background, not the icons)
15+
statusBarStyle: "DARK",
16+
navigationBarStyle: "LIGHT",
17+
},
18+
// Required by @capacitor-community/safe-area plugin from v8
19+
SystemBars: {
20+
insetsHandling: "disable",
21+
},
22+
},
1123
};
1224

1325
function getIP() {

ios/App/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PODS:
55
- Capacitor
66
- CapacitorCommunityBluetoothLe (7.3.0):
77
- Capacitor
8-
- CapacitorCommunitySafeArea (7.0.0-beta.5):
8+
- CapacitorCommunitySafeArea (7.0.0):
99
- Capacitor
1010
- CapacitorCordova (7.4.4)
1111
- CapacitorFilesystem (7.1.6):
@@ -54,7 +54,7 @@ SPEC CHECKSUMS:
5454
Capacitor: 358dd1c3fdd71d969547b17e159fd8a7736cb45f
5555
CapacitorApp: 26587c2ce485d88ddb39adb21cac64f8e481afe3
5656
CapacitorCommunityBluetoothLe: 41f9dec8a4c16ab6b81e56402b6047fc19b4735d
57-
CapacitorCommunitySafeArea: 53e3ad999bada9892cb4e9aca8fa8012aabad4b2
57+
CapacitorCommunitySafeArea: 211e919d3f0ff6020a3b2acb3b772fa30fb685ef
5858
CapacitorCordova: bf648a636f3c153f652d312ae145fb508b6ffced
5959
CapacitorFilesystem: 66f05ee0d8b1ccdc00d509091273a9b3b57c4a0b
6060
IONFilesystemLib: 89258b8e3e85465da93127d25d7ce37f977e8a6f

0 commit comments

Comments
 (0)