BannerAdSize

sealed class BannerAdSize

The size of a banner ad. Pass one of these to Moloco.createMolocoBanner.

Fixed sizes:

  • Standard — 320×50 banner.

  • Tablet — 728×90 leaderboard banner.

  • MREC — 300×250 medium rectangle.

Adaptive sizes (InlineAdaptive and AnchoredAdaptive) — use these with adaptive / flex-slot bid requests:

  • The server sets the ad height from the bid response (creative height).

  • The container fills its parent's width (MATCH_PARENT) by default.

  • Passing availableWidth (in dp) sets the rendered container to that fixed width. It is recommended to pass availableWidth for adaptive bidding and set it to the same wMax used in your adaptive / flex-slot bid request, so the requested and rendered widths match.

  • Because the height isn't known until the bid response returns, host the returned Banner in a parent view with a WRAP_CONTENT height (or set it to the bid response / creative height if you already know it) so the creative is not clipped or padded.

The two adaptive variants render identically; they are separate types only so inline and anchored placements can be tracked separately in the SDK's internal health metrics.

Inheritors

Types

Link copied to clipboard
data class AnchoredAdaptive(val availableWidth: Int? = null) : BannerAdSize

Anchored adaptive banner. The container fills its parent width by default; height is determined by the server from the bid response (creative height).

Link copied to clipboard
data class InlineAdaptive(val availableWidth: Int? = null) : BannerAdSize

Inline adaptive banner. The container fills its parent width by default; height is determined by the server from the bid response (creative height).

Link copied to clipboard

Medium rectangle banner size (300×250dp).

Link copied to clipboard

Standard banner size (320×50dp).

Link copied to clipboard

Tablet leaderboard banner size (728×90dp).