public class

AppBrainBanner

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.appbrain.AppBrainBanner

Class Overview

A View that shows a typical banner-size ad unit that promoted 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 as:

 <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, setButtonTextIndex, setDesign and setColors for more information. This class is only available in the AppLift SDK.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
AppBrainBanner(Context context, AttributeSet attrs, int defStyle)
AppBrainBanner(Context context, AttributeSet attrs)
AppBrainBanner(Context context)
Public Methods
void onWindowFocusChanged(boolean hasWindowFocus)
synchronized void requestAd()
Request an ad to be fetched.
void setBannerListener(BannerListener listener)
Set a listener interface that gets notified about clicks on the banner unit.
void setButtonTextIndex(int index)
Set the text to use on the button.
void setColors(int index)
Specify which of fourteen color schemes should be used.
void setDesign(int index)
Specify which of four banner designs should be used.
void setIsMediatedBanner(boolean isMediated, String name)
void setTitleIndex(int index)
Set the title to use.
void setVisibility(int visibility)
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

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

public AppBrainBanner (Context context, AttributeSet attrs)

public AppBrainBanner (Context context)

Public Methods

public void onWindowFocusChanged (boolean hasWindowFocus)

public synchronized void requestAd ()

Request an ad to be fetched. If a listener was set on this banner, that listener will be notified of the result.

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. This needs to be called before requestAd(). Currently, the indexes map to the following values:
0: Download
1: More free apps
2: Download now

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. This needs to be called before requestAd(). 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

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. This needs to be called before requestAd(). 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

Parameters
index The index of the design to use.

public void setIsMediatedBanner (boolean isMediated, String name)

public void setTitleIndex (int index)

Set the title to use. By default a random one is used. This needs to be called before requestAd(). 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

Parameters
index The index of the title to use.

public void setVisibility (int visibility)