-
public final class EloKeyboardBannerAdKt
-
-
Method Summary
Modifier and Type Method Description final static UnitEloKeyboardBannerAd(List<ChatMessage> messages, Modifier modifier, List<ContextObject> contextObjects, EloAdStyle style, String sponsoredLabel, String openLinkAccessibilityLabel, 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. -
-
Method Detail
-
EloKeyboardBannerAd
@Composable() final static Unit EloKeyboardBannerAd(List<ChatMessage> messages, Modifier modifier, List<ContextObject> contextObjects, EloAdStyle style, String sponsoredLabel, String openLinkAccessibilityLabel, 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 loads with AdDisplayPosition.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.
Host-side caveats:
Window mode.
WindowInsets.imeonly reports the keyboard in an edge-to-edge window (WindowCompat.setDecorFitsSystemWindows(window, false)— the enforced default on targetSdk 35+) withwindowSoftInputMode="adjustResize". UnderadjustPan/adjustNothingor 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.
-
-
-
-