public class

BannerAdapter

extends MediaDisplayAdapter
java.lang.Object
   ↳ com.urbanairship.iam.ForegroundDisplayAdapter
     ↳ com.urbanairship.iam.MediaDisplayAdapter
       ↳ com.urbanairship.iam.banner.BannerAdapter

Class Overview

Banner display adapter.

Summary

Constants
String BANNER_CONTAINER_ID Metadata an app can use to specify the banner's container ID per activity.
[Expand]
Inherited Constants
From interface com.urbanairship.iam.InAppMessageAdapter
Protected Constructors
BannerAdapter(InAppMessage message, BannerDisplayContent displayContent)
Default constructor.
Public Methods
boolean isReady(Context context)
Called before displaying but after the message is prepared.
static BannerAdapter newAdapter(InAppMessage message)
Creates a new banner adapter.
void onDisplay(Context context, DisplayHandler displayHandler)
Protected Methods
ViewGroup getContainerView(Activity activity)
Gets the banner's container view.
BannerView onCreateView(Activity activity, ViewGroup viewGroup)
Inflates the banner view.
void onDisplayFinished(Context context)
Called when the banner is finished displaying.
void onViewCreated(BannerView view, Activity activity, ViewGroup viewGroup)
Called after the banner view is created.
[Expand]
Inherited Methods
From class com.urbanairship.iam.MediaDisplayAdapter
From class com.urbanairship.iam.ForegroundDisplayAdapter
From class java.lang.Object
From interface com.urbanairship.iam.InAppMessageAdapter

Constants

public static final String BANNER_CONTAINER_ID

Metadata an app can use to specify the banner's container ID per activity.

Constant Value: "com.urbanairship.iam.banner.BANNER_CONTAINER_ID"

Protected Constructors

protected BannerAdapter (InAppMessage message, BannerDisplayContent displayContent)

Default constructor.

Parameters
message The in-app message.
displayContent The display content.

Public Methods

public boolean isReady (Context context)

Called before displaying but after the message is prepared.

Parameters
context The application context.
Returns
  • true if the message is ready to be displayed, otherwise false.

public static BannerAdapter newAdapter (InAppMessage message)

Creates a new banner adapter.

Parameters
message The in-app message.
Returns
  • The banner adapter.
Throws
IllegalArgumentException If the message is not a banner in-app message.

public void onDisplay (Context context, DisplayHandler displayHandler)

Protected Methods

protected ViewGroup getContainerView (Activity activity)

Gets the banner's container view.

Parameters
activity The activity.
Returns
  • The banner's container view or null.

protected BannerView onCreateView (Activity activity, ViewGroup viewGroup)

Inflates the banner view.

Parameters
activity The activity.
viewGroup The container view.
Returns
  • The banner view.

protected void onDisplayFinished (Context context)

Called when the banner is finished displaying.

Parameters
context The context.

protected void onViewCreated (BannerView view, Activity activity, ViewGroup viewGroup)

Called after the banner view is created.

Parameters
view The banner view.
activity The activity.
viewGroup The container view.