NativeAdView

public final class NativeAdView extends FrameLayout

Root view for NativeAd.

XML layout files for native ads should use NativeAdView as the root element for their native assets, and dynamically created views that will contain native ad assets should use an instance of this class as their root ViewGroup.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

NativeAdView(Context context)
Constructs a NativeAdView from code.
NativeAdView(Context context, AttributeSet attrs)
Constructs a NativeAdView from an XML layout.
NativeAdView(Context context, AttributeSet attrs, int defStyleAttr)
Constructs a NativeAdView from an XML layout.
NativeAdView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Constructs a NativeAdView from an XML layout.

Public Method Summary

void
destroy()
Destroys the native ad view.
AdChoicesView
getAdChoicesView()
Returns the view associated with AdChoices content.
View
getAdvertiserView()
Returns the view associated with the advertiser asset.
View
getBodyView()
Returns the view associated with the body asset.
View
getCallToActionView()
Returns the view associated with the call to action asset.
View
getHeadlineView()
Returns the view associated with the headline asset.
View
getIconView()
Returns the view associated with the icon asset.
View
getImageView()
Returns the view associated with the image asset.
MediaView
getMediaView()
Returns the view associated with the media content.
View
getPriceView()
Returns the view associated with the price asset.
View
getStarRatingView()
Returns the view associated with the star rating asset.
View
getStoreView()
Returns the view associated with the store asset.
void
setAdChoicesView(AdChoicesView adChoicesView)
Sets an AdChoicesView for displaying AdChoices content.
void
setAdvertiserView(View view)
Sets a view for the advertiser asset.
void
setBodyView(View view)
Sets a view for the body asset.
void
setCallToActionView(View view)
Sets a view for the call to action asset.
void
setClickConfirmingView(View view)
Sets the View that users will use to confirm their clickthroughs.
void
setHeadlineView(View view)
Sets a view for the headline asset.
void
setIconView(View view)
Sets a view for the icon asset.
void
setImageView(View view)
Sets a view for the image asset.
void
setMediaView(MediaView view)
Sets a media view for media content.
void
setNativeAd(NativeAd ad)
Sets the NativeAd that this view is currently displaying.
void
setPriceView(View view)
Sets a view for the price asset.
void
setStarRatingView(View view)
Sets a view for the star rating asset.
void
setStoreView(View view)
Sets a view for the store asset.

Inherited Method Summary

Public Constructors

public NativeAdView (Context context)

Constructs a NativeAdView from code.

Parameters
context The Context in which the NativeAdView is running.

public NativeAdView (Context context, AttributeSet attrs)

Constructs a NativeAdView from an XML layout.

public NativeAdView (Context context, AttributeSet attrs, int defStyleAttr)

Constructs a NativeAdView from an XML layout.

public NativeAdView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Constructs a NativeAdView from an XML layout.

Public Methods

public void destroy ()

Destroys the native ad view. No other methods should be called on the ad view after destroy() is called.

public AdChoicesView getAdChoicesView ()

Returns the view associated with AdChoices content.

public View getAdvertiserView ()

Returns the view associated with the advertiser asset.

public View getBodyView ()

Returns the view associated with the body asset.

public View getCallToActionView ()

Returns the view associated with the call to action asset.

public View getHeadlineView ()

Returns the view associated with the headline asset.

public View getIconView ()

Returns the view associated with the icon asset.

public View getImageView ()

Returns the view associated with the image asset.

public MediaView getMediaView ()

Returns the view associated with the media content.

public View getPriceView ()

Returns the view associated with the price asset.

public View getStarRatingView ()

Returns the view associated with the star rating asset.

public View getStoreView ()

Returns the view associated with the store asset.

public void setAdChoicesView (AdChoicesView adChoicesView)

Sets an AdChoicesView for displaying AdChoices content.

Parameters
adChoicesView The AdChoicesView to set

public void setAdvertiserView (View view)

Sets a view for the advertiser asset.

Parameters
view The view to set

public void setBodyView (View view)

Sets a view for the body asset.

Parameters
view The view to set

public void setCallToActionView (View view)

Sets a view for the call to action asset.

Parameters
view The view to set

public void setClickConfirmingView (View view)

Sets the View that users will use to confirm their clickthroughs.

Parameters
view The View to set.

public void setHeadlineView (View view)

Sets a view for the headline asset.

Parameters
view The view to set

public void setIconView (View view)

Sets a view for the icon asset.

Parameters
view The view to set

public void setImageView (View view)

Sets a view for the image asset.

Parameters
view The view to set

public void setMediaView (MediaView view)

Sets a media view for media content.

Parameters
view The MediaView to set

public void setNativeAd (NativeAd ad)

Sets the NativeAd that this view is currently displaying.

Parameters
ad the native ad that the view is currently displaying

public void setPriceView (View view)

Sets a view for the price asset.

Parameters
view The view to set

public void setStarRatingView (View view)

Sets a view for the star rating asset.

Parameters
view The view to set

public void setStoreView (View view)

Sets a view for the store asset.

Parameters
view The view to set