Package 

Class EloKeyboardBannerAdKt

    • Method Summary

      Modifier and Type Method Description
      final static Unit EloKeyboardBannerAd(List<ChatMessage> messages, Modifier modifier, List<ContextObject> contextObjects, EloAdStyle style, EloAdDisclosure sponsoredLabel, Boolean showLoadingPlaceholder, String loadingAccessibilityLabel, Function1<AdResult, Unit> onResult) Pins an inline banner ad above the software keyboard with one composable — no keyboard tracking or layout code in the host.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • EloKeyboardBannerAd

        @Composable() final static Unit EloKeyboardBannerAd(List<ChatMessage> messages, Modifier modifier, List<ContextObject> contextObjects, EloAdStyle style, EloAdDisclosure sponsoredLabel, Boolean showLoadingPlaceholder, String loadingAccessibilityLabel, Function1<AdResult, Unit> onResult)

        Pins an inline banner ad above the software keyboard with one composable — no keyboard tracking or layout code in the host. Mirrors iOS .eloKeyboardBannerAd(messages:).

        Place it as the bottom-most element of your screen, directly below the composer. The slot requests with display_position = "banner", renders the two-line inline banner on fill, collapses to zero height on no-fill or error, and reloads when messages changes (observe outcomes via onResult). It applies IME and navigation-bar insets itself: with the keyboard open the strip rides its top edge; closed, it rests at the bottom safe area.

        While the request is in flight it shows the strip-shaped skeleton at the strip's own size, so the composer above keeps its place when an ad arrives. showLoadingPlaceholder defaults to true, matching EloAdView; pass false to keep the keyboard edge clear until an ad fills.

        Host-side caveats:

        • Window mode.WindowInsets.ime only reports the keyboard in an edge-to-edge window (WindowCompat.setDecorFitsSystemWindows(window, false) — the enforced default on targetSdk 35+) with windowSoftInputMode="adjustResize". Under adjustPan/adjustNothing or a decor-fitting window the IME inset reads 0 and the banner degrades to resting at the window bottom instead of pinning — it never overlaps the composer or crashes.

        • Don't double-consume insets. If an ancestor already applies imePadding(), the insets are consumed upstream and the banner adds no padding of its own. Avoid applying both to the same subtree.

        • Composer hit target. Keep your input field's tappable area out of the margin above the strip — ad networks (AdMob included) treat placements that invite accidental clicks next to text inputs as policy violations. The strip's outer margins are deliberately not tappable.