Dash Stats Docs

AppBrainBanner

public class AppBrainBanner extends FrameLayout

A View that shows a typical banner-sized ad unit that promotes the offerwall. The text, button text, design and colors can be specified either programmatically or in XML. The way this can be set in XML for instance is:

<com.appbrain.AppBrainBanner xmlns:appbrain="http://schemas.android.com/apk/lib/com.appbrain"
     appbrain:colors="12" appbrain:design="0" appbrain:title="0" appbrain:button="0"
     android:layout_width="fill_parent" android:layout_height="wrap_content" />

See the functions setTitleIndex(int), setButtonTextIndex(int), setDesign(int) and setColors(int) for more information.

Author:AppBrain

Constructors

public AppBrainBanner(Context context, AttributeSet attrs, int defStyle)
public AppBrainBanner(Context context, AttributeSet attrs)
public AppBrainBanner(Context context)

Methods

public BannerListener getBannerListener()
Returns:the current BannerListener, set by setBannerListener(BannerListener).
public void requestAd()

Request an ad to be fetched. If a listener was set on this banner, that listener will be notified of the result. This method is automatically called once the banner is added to the view layout, so calling it manually is optional.

public void setAdId(AdId id)

Sets the ad id for this banner.

public void setAllowedToUseMediation(boolean allowedToUseMediation)

Set to false to make sure this banner will not use mediation, even if mediation is enabled for its AdId. Default value is true.

public void setBannerListener(BannerListener listener)

Set a listener interface that gets notified about clicks on the banner unit.

public void setButtonTextIndex(int index)

Set the text to use on the button. By default a random one is used. Currently, the indexes map to the following values:

  • 0: Download
  • 1: More free apps
  • 2: Download now

This method needs to be called before requestAd() is called. It only has an effect on certain types of banners.

Parameters:
  • index – The index of the button text to use.
public void setColors(int index)

Specify which of fourteen color schemes should be used. By default a random one is used. The indexes map to the following settings:

  • 0: Dark with blue button
  • 1: Light with blue button
  • 2: Light design
  • 3: Dark with blue button
  • 4: Blue with orange button
  • 5: White with green button
  • 6: Candy colored design
  • 7: Sahara colored design
  • 8: Red colored design
  • 9: Green colored design
  • 10: Blue colored design
  • 11: Purple colored design
  • 12: Light grey design
  • 13: Light black & white design

This method needs to be called before requestAd() is called. It only has an effect on certain types of banners.

Parameters:
  • index – The index of the color scheme to use.
public void setDesign(int index)

Specify which of four banner designs should be used. By default a random one is used. The indexes map to the following values:

  • 0: A simple layout with text with the button on the right
  • 1: Another simple layout with text and the button on the right
  • 2: A design where the background has arrows pointing to the right
  • 3: A design with an ellipse and the button at the bottom

This method needs to be called before requestAd() is called. It only has an effect on certain types of banners.

Parameters:
  • index – The index of the design to use.
public void setSize(BannerSize size)

Set the banner’s preferred size. The default is BannerSize.RESPONSIVE, which is the recommended setting.

public void setSize(BannerSize width, BannerSize height)

Set the banner’s preferred width and height. The defaults are BannerSize.RESPONSIVE, which is the recommended setting.

public void setTitleIndex(int index)

Set the title to use. By default a random one is used. Currently, the indexes map to the following values:

  • 0: There are some great free apps waiting for you!
  • 1: Get more great apps for your phone
  • 2: Download the best free apps
  • 3: Download today’s free app offers

This method needs to be called before requestAd() is called. It only has an effect on certain types of banners.

Parameters:
  • index – The index of the title to use.