Android edge-to-edge: embrace SDK 35 enforcement and CSS safe-area insets#2283
Android edge-to-edge: embrace SDK 35 enforcement and CSS safe-area insets#2283myieye wants to merge 2 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
C# Unit Tests165 tests 165 ✅ 21s ⏱️ Results for commit a26113c. ♻️ This comment has been updated with latest results. |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Android 15 (SDK 35) enforces edge-to-edge layouts and the old `OptOutEdgeToEdgeEnforcement` attribute in styles-v35 was causing `env(safe-area-inset-*)` to return 0 inside the BlazorWebView. Replace the opt-out with a new `AndroidEdgeToEdgeInsets` class that listens to `WindowInsetsCompat` callbacks and injects the real inset values as CSS custom properties (`--safe-area-inset-*`) into the WebView via JavaScript. MainActivity is updated to wire up the listener instead of relying on the deprecated opt-out style. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add `viewport-fit=cover` to the HTML meta viewport tag so the WebView renders into the full screen including the notch/status-bar area. Then apply the `--safe-area-inset-*` CSS custom properties (set by `AndroidEdgeToEdgeInsets`) throughout the viewer: - `app.css`: root vars + utility classes for padding/margin insets - `App.svelte` / `ShadcnProjectView.svelte`: top/bottom padding on main content areas - `sidebar.svelte` / `sidebar-provider.svelte`: fixed positioning accounts for top inset so the sidebar doesn't underlap the status bar - `sonner.svelte`: toaster offset respects bottom inset - `dialog-content.svelte`, `drawer-content.svelte`, `alert-dialog-content.svelte`, `sheet-content.svelte`: overflow and padding adjustments so content isn't clipped behind system bars - `fab-container.svelte`: FAB raised above the bottom nav bar - `HomeView.svelte`: home view padding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
417acf9 to
a26113c
Compare
Embrace Android 15+ (SDK 35) edge-to-edge instead of opting out, and add CSS safe-area inset support so the viewer UI clears the status bar and gesture nav bar.
The opt-out style (
windowOptOutEdgeToEdgeEnforcement) is deprecated on Android 16+ and was causingenv(safe-area-inset-*)to return 0 inside the BlazorWebView; the newAndroidEdgeToEdgeInsetsclass reads realWindowInsetsCompatvalues and injects them as CSS custom properties (--safe-area-inset-*) into the WebView.