Triton Mobile SDK for Android 3.5.1 This is a custom android player made by Triton Digital

Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
com.tritondigital.ads.BannerView Class Reference

The View to display banner ads. More...

Inheritance diagram for com.tritondigital.ads.BannerView:

## Classes
interface | BannerListener
| A listener for receiving BannerView notifications. More...

## Public Member Functions
| BannerView (Context context)
| Constructor.
| BannerView (Context context, AttributeSet attrs)
| Constructor.
| BannerView (Context context, AttributeSet attrs, int defStyle)
| Constructor.
void | onPause ()
| Pauses any extra processing associated with this BannerView.
void | onResume ()
| Resumes an BannerView after a previous call to pause().
void | release ()
| Destroys the internal state of this BannerView.
void | setListener (BannerListener listener)
| Sets the banner listener.
BannerListener | getListener ()
| Returns the banner listener.
int | getBannerWidth ()
| Returns the banner's width in density-independent pixels.
int | getBannerHeight ()
| Returns the banner's height in density-independent pixels.
int | getBannerFallbackWidth ()
| Returns the banner's fallback width in density-independent pixels.
int | getBannerFallbackHeight ()
| Returns the banner's fallback height in density-independent pixels.
void | setBannerSize (int width, int height)
void | setBannerSize (int width, int height, int fallbackWidth, int fallbackHeight)
| Sets the ad size in density-independent pixels.
Point | getBestBannerSize (Bundle ad, int containerWidth, int containerHeight)
| Find the best banner size from an ad bundle which fits a layout container.
void | showAd (Bundle ad)
| Show an ad.
void | clearBanner ()
| Clears the current ad but keep the View in order to reuse it later.
boolean | isBannerLoaded ()
| Returns true if the an ad is loaded.
Bundle | getBestBannerSize (ArrayList< Bundle > banners, int width, int height)

## Static Public Member Functions
static String | debugErrorToStr (int errorCode)
| Converts the error codes to a string.

## Static Public Attributes
static final int | ERROR_UNKNOWN = AdLoader.ERROR_UNKNOWN
static final int | ERROR_NO_INVENTORY = AdLoader.ERROR_NO_INVENTORY
static final int | ERROR_UNKNOWN_HOST = AdLoader.ERROR_UNKNOWN_HOST
static final int | ERROR_NETWORK_NOT_AVAILABLE = AdLoader.ERROR_NETWORK_NOT_AVAILABLE
static final int | ERROR_BANNER_SIZE_NOT_SET = 8012
| setBannerSize(int, int) must be called before loading an ad
static final int | ERROR_LOAD_AFTER_RELEASE = 8006
| Trying to load an ad after release()
static final int | ERROR_NO_BANNERS = 8010
| The loaded ad doesn't have any banner.
static final int | ERROR_NO_BANNER_RIGHT_SIZE = 8011
| The loaded ad doesn't have a banner of the right size.
static final int | ERROR_TIMEOUT = 8013
| The maximum time has been reached.

## Protected Member Functions
void | onError (int error)

## Protected Attributes
final String | TAG = Log.makeTag("BannerView")

## Detailed Description

The View to display banner ads.

The size must be set prior to calling showAd(Bundle).

Ad Size
  The ad size must be set prior to calling showAd(Bundle). The ad size and the View size are not the same thing. For example, a 320x50 ad can be loaded in a WRAP_CONTENT view.

Fallback Size
  A fallback size can be set in case no ad is available for the main size. This feature was added in order to easily support 320x50 and 300x50 in the same view.

## Member Function Documentation

## ◆ clearBanner()

void com.tritondigital.ads.BannerView.clearBanner | ( |  | ) |

Clears the current ad but keep the View in order to reuse it later.

This method is usually called at the end of an audio ad with a sync banner.

## ◆ debugErrorToStr()

static String com.tritondigital.ads.BannerView.debugErrorToStr | ( | int | errorCode | ) |
| static

Converts the error codes to a string.

Note
  Only use for debugging purpose.

## ◆ getBestBannerSize()

Point com.tritondigital.ads.BannerView.getBestBannerSize | ( | Bundle | ad,
|  | int | containerWidth,
|  | int | containerHeight
| ) |  |

Find the best banner size from an ad bundle which fits a layout container.

It returns null if no size fits the container

Parameters

  ad | The Ad bundle with the banners to search for
  containerWidth | The container width in dp
  containerHeight | The container height in dp

Returns
  a Point with Width and Height or null if no size fits the container

## ◆ onPause()

void com.tritondigital.ads.BannerView.onPause | ( |  | ) |

Pauses any extra processing associated with this BannerView.

This method should be called in the parent Activity.onPause() method.

See also
  http://developer.android.com/reference/android/webkit/WebView.html#onPause()

## ◆ onResume()

void com.tritondigital.ads.BannerView.onResume | ( |  | ) |

Resumes an BannerView after a previous call to pause().

This method should be called in the parent Activity.onResume() method.

See also
  http://developer.android.com/reference/android/webkit/WebView.html#onResume()

## ◆ release()

void com.tritondigital.ads.BannerView.release | ( |  | ) |

Destroys the internal state of this BannerView.

This method should be called after this BannerView has been removed from the view system. No other methods should be called this.

## ◆ setBannerSize() [1/2]

void com.tritondigital.ads.BannerView.setBannerSize | ( | int | width,
|  | int | height
| ) |  |

See also
  BannerView::setBannerSize(int, int, int, int)

## ◆ setBannerSize() [2/2]

void com.tritondigital.ads.BannerView.setBannerSize | ( | int | width,
|  | int | height,
|  | int | fallbackWidth,
|  | int | fallbackHeight
| ) |  |

Sets the ad size in density-independent pixels.

The size change will be effective only on the next ad display. The fallback values will be used if no banner is found with the main size.

## ◆ showAd()

void com.tritondigital.ads.BannerView.showAd | ( | Bundle | ad | ) |

Show an ad.

This view takes care of taking the right banner from the ad bundle.

Parameters

  ad | The ad to load.

The documentation for this class was generated from the following file:

- ads/src/main/java/com/tritondigital/ads/BannerView.java