Skip to content

fix(Insets): remove manual status bar insets workaround and rely on native SDK WindowInsets support - #97

Draft
LoyalAbbas wants to merge 1 commit into
mainfrom
feat/start-support-windowinsets
Draft

LoyalAbbas wants to merge 1 commit into
mainfrom
feat/start-support-windowinsets

Conversation

@LoyalAbbas

Copy link
Copy Markdown
Collaborator

Summary

Removes the temporary client-side status bar inset and system-bar hiding workarounds introduced while waiting for native WindowInsets support in the Maps 3D SDK (tracked in https://issuetracker.google.com/issues/575850758), and fixes initial placement of the Quick Settings button on UiControlsActivity.

What Changed

  • Removed manual status bar inset workaround (Map3DSettings.applyStatusBarInsetsToMapView):
    • Deleted manual child-container margin traversal, layout change listeners, dedicated tag IDs (ids.xml), and the temporary workaround test suite (Map3DStatusBarInsetsTest.kt).
    • Replaced manual offset calls with standard ViewCompat.requestApplyInsets(...) dispatch in SampleBaseActivity (Kotlin & Java), UiControlsActivity (Kotlin, Java, Compose), Map3DQuickSettingsButton, Map3DQuickSettingsWidget, and maps3d-compose (GoogleMap3D).
    • Returned unconsumed WindowInsetsCompat from SampleBaseActivity's inset listener so sibling Map3DView instances receive system bar and display cutout insets natively.
  • Restored visible system bars on edge-to-edge screens:
    • Updated sample activities and Utilities.enableImmersiveMode() to keep system bars visible (insetsController.show(WindowInsetsCompat.Type.systemBars())) under standard edge-to-edge rendering.
  • Fixed initial Quick Settings FAB placement on UiControlsActivity:
    • Added uiControlsOverride support to Map3DQuickSettingsButton (matching Map3DQuickSettingsWidget in Compose) so asynchronous window-inset passes and attachMap() refreshes preserve screen-level UI control overrides.
    • Initialized updateTopMarginForUiControls(buildCurrentUiControls()) during onCreate in both Kotlin and Java UiControlsActivity so the Quick Settings FAB clears the active trailing controls from the first frame.

Verification

  • Verified ./gradlew spotlessCheck passes across all modules.
  • Built and verified :Maps3DSamples:ApiDemos:kotlin-app:assembleDebug, :Maps3DSamples:ApiDemos:java-app:assembleDebug, :Maps3DSamples:ComposeDemos:app:assembleDebug, and :Maps3DSamples:ApiDemos:common:testDebugUnitTest.
  • Verified on-device across Kotlin Views, Java Views, and Jetpack Compose samples that built-in 3D map UI controls, the Google Maps logo, and the Quick Settings button clear system bars and avoid overlap on initial load.

@LoyalAbbas
LoyalAbbas requested review from dkhawk and kikoso and removed request for dkhawk November 6, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant