public interface

AdViewController

com.applovin.adview.AdViewController

This interface is deprecated.
- This is for internal use only and will be removed in a later SDK version.

Class Overview

This interface represents a controller for an Ad view. The controller is responsible for handling all view operations.

Summary

Public Methods
abstract void contractAd()
This method is used to contract an ad expanded with @link{expandAd()} back.
abstract void destroy()
Cleanup view's resources
abstract void expandAd()
This method is used to expand current ad to full-screen.
abstract AppLovinAdSize getSize()
Get current ad size
abstract String getZoneId()
Get current zone
abstract void initializeAdView(AppLovinAdView parentView, Context context, AppLovinAdSize size, String zoneId, AppLovinSdk sdk, AttributeSet viewAttributes)
Initialize the controller using specified parameters
abstract boolean isAdReadyToDisplay()
Check if an ad is currently preloaded and ready to be displayed.
abstract boolean isAutoDestroy()
Check auto-destroy logic.
abstract void loadNextAd()
Start loading next advertisement.
abstract void pause()
Pause and clean current ad
abstract void renderAd(AppLovinAd ad)
Render specified ad.
abstract void renderAd(AppLovinAd ad, String placement)
This method is deprecated. Placements have been deprecated and will be removed in a future SDK version. Please configure zones from the UI and use them instead.
abstract void resume()
Resume rendering of the current ad
abstract void setAdClickListener(AppLovinAdClickListener callback)
Set a callback that would be notified of ad click events.
abstract void setAdDisplayListener(AppLovinAdDisplayListener callback)
Set a callback that would be notified of ad display events.
abstract void setAdLoadListener(AppLovinAdLoadListener callback)
Set a callback that would be notified of ad loading events.
abstract void setAdVideoPlaybackListener(AppLovinAdVideoPlaybackListener callback)
Set a callback that may be notified of video playback events, if and only if the ad contains a video.
abstract void setAdViewEventListener(AppLovinAdViewEventListener callback)
Set a callback that would be notified of ad view events.
abstract void setAutoDestroy(boolean isAutoDestroy)
True if the view should be destroyed automatically on when detached from the window

Public Methods

public abstract void contractAd ()

This method is used to contract an ad expanded with @link{expandAd()} back.

public abstract void destroy ()

Cleanup view's resources

public abstract void expandAd ()

This method is used to expand current ad to full-screen.

public abstract AppLovinAdSize getSize ()

Get current ad size

Returns
  • Get current size

public abstract String getZoneId ()

Get current zone

Returns
  • Get current zone id

public abstract void initializeAdView (AppLovinAdView parentView, Context context, AppLovinAdSize size, String zoneId, AppLovinSdk sdk, AttributeSet viewAttributes)

Initialize the controller using specified parameters

Parameters
parentView Parent ad view. Must not be null.
context Parent context. Must be an Activity. Must not be null.
size Desired ad size. May be null.
zoneId Desired zone id. May be null.
sdk SDK to use. May be null.
viewAttributes View attributes. May be null.

public abstract boolean isAdReadyToDisplay ()

Check if an ad is currently preloaded and ready to be displayed.

Returns
  • True if a subsequent call to a show method will result in an immediate display. False if a call to a show method will require network activity first.

public abstract boolean isAutoDestroy ()

Check auto-destroy logic.

Returns
  • True if the view should be destroyed automatically on when detached from the window

public abstract void loadNextAd ()

Start loading next advertisement. This method will return immediately. An advertisement will be rendered by this view when available.

public abstract void pause ()

Pause and clean current ad

public abstract void renderAd (AppLovinAd ad)

Render specified ad.

Parameters
ad Ad to render. Must not be null.

public abstract void renderAd (AppLovinAd ad, String placement)

This method is deprecated.
Placements have been deprecated and will be removed in a future SDK version. Please configure zones from the UI and use them instead.

Render specified ad.

Parameters
ad Ad to render. Must not be null.
placement Placement name.

public abstract void resume ()

Resume rendering of the current ad

public abstract void setAdClickListener (AppLovinAdClickListener callback)

Set a callback that would be notified of ad click events.

Parameters
callback A callback to be notified of ad click events.

public abstract void setAdDisplayListener (AppLovinAdDisplayListener callback)

Set a callback that would be notified of ad display events. These include add displayed and ad hidden.

Parameters
callback A callback to be notified of ad loading events.

public abstract void setAdLoadListener (AppLovinAdLoadListener callback)

Set a callback that would be notified of ad loading events. These include add loaded and ad failed to load events

Parameters
callback A callback to be notified of ad loading events.

public abstract void setAdVideoPlaybackListener (AppLovinAdVideoPlaybackListener callback)

Set a callback that may be notified of video playback events, if and only if the ad contains a video.

Parameters
callback A callback to be notified of video events.

public abstract void setAdViewEventListener (AppLovinAdViewEventListener callback)

Set a callback that would be notified of ad view events.

Parameters
callback A callback to be notified of ad view events.

public abstract void setAutoDestroy (boolean isAutoDestroy)

True if the view should be destroyed automatically on when detached from the window

Parameters
isAutoDestroy True of the view should be destroyed automatically when detached from the window.