Skip to content

feat: report the inline banner's height (setBannerHeightChangedCallback) - #53

Merged
boehlerlukas merged 2 commits into
masterfrom
feat/inline-banner-inset
Oct 16, 2026
Merged

boehlerlukas merged 2 commits into
masterfrom
feat/inline-banner-inset

Conversation

@boehlerlukas

Copy link
Copy Markdown
Contributor

Customer ask (Operátor ICT, ticket 129428): in Flutter, inline banners cover the app instead of pushing it down like on the web. This adds the native signal the Flutter SDK needs (GleapSDK/Flutter-SDK PR on feat/inline-banner-inset); iOS has the same in GleapSDK/Gleap-iOS-SDK.

API

  • Gleap.getInstance().setBannerHeightChangedCallback(BannerHeightChangedCallback) — dp from the top of the content that the inline banner covers. Fires on show, on resize (layout listener: banner page height, rotation, insets) and with 0 on close / replace / clearIdentity. Not on the overlay rebuild when another activity resumes (the banner comes back there), so content doesn't jump when returning from the widget. Floating banners report 0. Only changes are reported.
  • Gleap.getInstance().getBannerHeight() — the current value, for listeners that start later.

Visual change: in edge-to-edge apps the inline banner now reaches up under the status bar in the banner color (padding + translationY, overlay clipToPadding=false), like on iOS, instead of leaving app content showing above it. Apps that aren't edge-to-edge get no top inset, so nothing changes there. Floating banners are untouched.

Tested (Flutter example on the Medium Phone API 36.1 emulator against this branch published to mavenLocal, banner fed through GleapOverlayManager.showBanner with a real inline payload, at targetSdk 33 and 35 (forced edge-to-edge)):

  • Inline shown → 106 dp, banner covers the status bar, AppBar directly below with no gap or overlap (checked at full resolution); close (X) → 0
  • Floating → 0, unchanged look; floating replaced by inline → 106
  • Widget opened and back with the banner shown → no flicker, still 106; app relaunched → banner and layout restored
  • Landscape → 86 dp, content follows
  • Flutter hot restart with a banner shown → recovered via getBannerHeight()
  • :gleap:testDebugUnitTest passes

Ships with the next synchronized SDK release (## Unreleased in CHANGELOG).

🤖 Generated with Claude Code

…r content below it

setBannerHeightChangedCallback reports the space an inline banner takes at the top of the screen
(dp): on show, resize and rotation, 0 on close or replace (not on the overlay rebuild for another
activity). Floating banners report 0. getBannerHeight returns the current value. In edge-to-edge
apps the inline banner now covers the status bar in its color, like on iOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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