com.annahid.libs.artenus.unified
AdManager
Superclass of unified ad managers. If a UnifiedServices implementation supports ads, it
should provide a sub-class of this class.
public abstract class AdManager
Field Summary
Modifier and Type | Field and Description |
---|---|
protected | adLayout Holds the ad layout managed by this ad manager. |
Constructor Summary
Modifier and Type | Constructor and Description |
---|---|
public | AdManager() |
Method Summary
Modifier and Type | Method and Description |
---|---|
public final void | destroyAd() Releases resources associated with the ad unit when it is no longer needed. |
protected abstract void | destroyAdView(View adView) Implemented by subclasses to destroy a view corresponding to an ad unit. |
public final int | getAdHeight() Gets the height of the ad unit currently displayed. |
protected String | getAdUnitId() Gets the currently assigned ad unit identifier. |
protected abstract View | getAdView() Implemented by subclasses to return a view corresponding to the ad unit overlay. |
public final void | hideAd() Hides the ad unit. |
public final void | setAdLayout(AdLayout adLayout) Sets the game layout on which ads should be placed. |
public final void | setAdPlacementListener(AdPlacementListener listener) Sets the listener that is responsible for handling ad placement events. |
public void | setAdUnitId(String adUnitId) Sets the identifier for the ad unit that should be displayed over the stage by this ad
manager. |
public final void | showAd(AdManager.Placements show) Hides or displays the ad unit at a specified location. |
Methods inherited from java.lang.Object
clone
, equals
, finalize
, getClass
, hashCode
, notify
, notifyAll
, toString
, wait
, wait
, wait
Method Detail
destroyAd |
---|
public final void destroyAd() Releases resources associated with the ad unit when it is no longer needed. An example of
a situation where this method needs to be called is when the user buys the full version of
the app using IAP, and ads need to be removed. |
destroyAdView | ||
---|---|---|
protected abstract void destroyAdView( View adView ) Implemented by subclasses to destroy a view corresponding to an ad unit. Subclasses usually
do not need to do type checking, as the framework only passes ad units created by the same
instance as the argument. Parameters:
|
getAdHeight |
---|
public final int getAdHeight() Gets the height of the ad unit currently displayed. Returns:
The height of the ad unit in pixels, or 0 if it is not present |
getAdUnitId |
---|
protected String getAdUnitId() Gets the currently assigned ad unit identifier. Returns:
Ad unit identifier |
getAdView |
---|
protected abstract View getAdView() Implemented by subclasses to return a view corresponding to the ad unit overlay. The exact
sub-type of the returned View depends on the specific implementation. Returns:
The ad view |
hideAd |
---|
public final void hideAd() Hides the ad unit. This is the same as calling showAd(Placements) with the
HIDDEN option. |
setAdLayout | ||
---|---|---|
public final void setAdLayout( AdLayout adLayout ) Sets the game layout on which ads should be placed. Parameters:
|
setAdPlacementListener | ||
---|---|---|
public final void setAdPlacementListener( AdPlacementListener listener ) Sets the listener that is responsible for handling ad placement events. Parameters:
|
setAdUnitId | ||
---|---|---|
public void setAdUnitId( String adUnitId ) Sets the identifier for the ad unit that should be displayed over the stage by this ad
manager. The format of the identifier depends on the specific implementation. Parameters:
|
showAd | ||
---|---|---|
public final void showAd( AdManager.Placements show ) Hides or displays the ad unit at a specified location. Parameters:
|