CompanionAdSlot

interface CompanionAdSlot


A companion ad slot for which the SDK should retrieve ads.

Summary

Nested types

Listener interface for click events.

Constants

const Int

Fluid companion ads have no fixed size, but rather adapt to fit the creative content they display.

Public functions

Unit

Registers a listener for companion clicks.

ViewGroup!

Returns the ViewGroup into which the companion will be rendered.

Int

Returns the height of the companion slot.

Int

Returns the width of the companion slot.

Boolean

Returns true if the companion slot is filled, false otherwise.

Unit

Removes a listener for companion clicks.

Unit
setContainer(container: ViewGroup!)

Sets the ViewGroup into which the companion will be rendered.

Unit
setSize(width: Int, height: Int)

Sets the size of the slot.

Constants

FLUID_SIZE

const val FLUID_SIZE = -2: Int

Fluid companion ads have no fixed size, but rather adapt to fit the creative content they display. Set width and height to fluid size to allow companion slot to be filled by fluid companion ad.

Public functions

addClickListener

fun addClickListener(clickListener: CompanionAdSlot.ClickListener!): Unit

Registers a listener for companion clicks.

getContainer

fun getContainer(): ViewGroup!

Returns the ViewGroup into which the companion will be rendered.

getHeight

fun getHeight(): Int

Returns the height of the companion slot.

getWidth

fun getWidth(): Int

Returns the width of the companion slot.

isFilled

fun isFilled(): Boolean

Returns true if the companion slot is filled, false otherwise.

removeClickListener

fun removeClickListener(clickListener: CompanionAdSlot.ClickListener!): Unit

Removes a listener for companion clicks.

setContainer

fun setContainer(container: ViewGroup!): Unit

Sets the ViewGroup into which the companion will be rendered. Required.

setSize

fun setSize(width: Int, height: Int): Unit

Sets the size of the slot. Only companions matching the slot size will be displayed in the slot.