CompanionAdSlot

public interface CompanionAdSlot


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

Summary

Nested types

Listener interface for click events.

Constants

default static final int

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

Public methods

abstract void

Registers a listener for companion clicks.

abstract ViewGroup

Returns the ViewGroup into which the companion will be rendered.

abstract int

Returns the height of the companion slot.

abstract int

Returns the width of the companion slot.

abstract boolean

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

abstract void

Removes a listener for companion clicks.

abstract void

Sets the ViewGroup into which the companion will be rendered.

abstract void
setSize(int width, int height)

Sets the size of the slot.

Constants

FLUID_SIZE

default static final int FLUID_SIZE = -2

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 methods

addClickListener

abstract void addClickListener(CompanionAdSlot.ClickListener clickListener)

Registers a listener for companion clicks.

getContainer

abstract ViewGroup getContainer()

Returns the ViewGroup into which the companion will be rendered.

getHeight

abstract int getHeight()

Returns the height of the companion slot.

getWidth

abstract int getWidth()

Returns the width of the companion slot.

isFilled

abstract boolean isFilled()

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

removeClickListener

abstract void removeClickListener(CompanionAdSlot.ClickListener clickListener)

Removes a listener for companion clicks.

setContainer

abstract void setContainer(ViewGroup container)

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

setSize

abstract void setSize(int width, int height)

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