BaseDisplayContainer

public interface BaseDisplayContainer
Known Indirect Subclasses

A base class for more specialized container interfaces. The SDK-owned ad UI will be displayed within the container. Companion ads will be placed in the companion slots. Subclasses are responsible for displaying any additional media (linear ads, streams, etc.).

Public Method Summary

abstract void
destroy()
Releases resources attached to the container.
abstract ViewGroup
getAdContainer()
Returns the previously set container, or null if none has been set.
abstract Collection<CompanionAdSlot>
getCompanionSlots()
Gets the companion slots that have been set.
abstract void
registerFriendlyObstruction(FriendlyObstruction friendlyObstruction)
Registers a view that overlays or obstructs this container as "friendly" for viewability measurement purposes.
abstract void
registerVideoControlsOverlay(View videoControlsOverlay)
This method is deprecated. - Use registerFriendlyObstruction(FriendlyObstruction) instead.
abstract void
setAdContainer(ViewGroup container)
This method is deprecated. Please use the constructor which determines the Ad Container at construction time.
abstract void
setCompanionSlots(Collection<CompanionAdSlot> companionSlots)
Sets slots for displaying companions.
abstract void
unregisterAllFriendlyObstructions()
Unregisters all previously registered friendly obstructions.
abstract void
unregisterAllVideoControlsOverlays()
This method is deprecated. - Use unregisterAllFriendlyObstructions() instead.

Public Methods

public abstract void destroy ()

Releases resources attached to the container. This will invalidate the container and remove all views attached to it. Should be called when the associated AdsLoader is no longer needed.

public abstract ViewGroup getAdContainer ()

Returns the previously set container, or null if none has been set.

public abstract Collection<CompanionAdSlot> getCompanionSlots ()

Gets the companion slots that have been set. Returns an empty list if none have been set.

public abstract void registerFriendlyObstruction (FriendlyObstruction friendlyObstruction)

Registers a view that overlays or obstructs this container as "friendly" for viewability measurement purposes.

See Open Measurement in the IMA SDK for guidance on what is and what is not allowed to be registered.

Parameters
friendlyObstruction An obstruction to be marked as "friendly" until unregistered.

public abstract void registerVideoControlsOverlay (View videoControlsOverlay)

This method is deprecated.
- Use registerFriendlyObstruction(FriendlyObstruction) instead.

Registers video playback controls that will overlay this container. WARNING: It is critical that video controls obscure as little ad space as possible so that viewability measurement isn't impacted.

Parameters
videoControlsOverlay Small or mostly transparent video controls overlay.

public abstract void setAdContainer (ViewGroup container)

This method is deprecated.
Please use the constructor which determines the Ad Container at construction time.

Sets the ViewGroup in which linear UI will be displayed.

Parameters
container

public abstract void setCompanionSlots (Collection<CompanionAdSlot> companionSlots)

Sets slots for displaying companions. Passing null will reset the container to having no companion slots.

Parameters
companionSlots

public abstract void unregisterAllFriendlyObstructions ()

Unregisters all previously registered friendly obstructions.

public abstract void unregisterAllVideoControlsOverlays ()

This method is deprecated.
- Use unregisterAllFriendlyObstructions() instead.

Unregisters all previously registered video controls overlays.