Interface NativeAdData
-
- All Implemented Interfaces:
public interface NativeAdData
-
-
Method Summary
Modifier and Type Method Description abstract UnitattachToLayout(ViewGroup layout, View mainImageView, View iconView, View ctaView)Binds the native ad instance with given ViewGroup. abstract UnitdetachFromLayout()Removes the binding between native ad and ViewGroup. abstract StringgetTitle()Returns the title of native ad. abstract StringgetDescription()Returns the description of native ad. abstract StringgetCallToAction()Returns the call to action of native ad. abstract StringgetImageUrl()Returns the URL of the image asset of native ad. abstract StringgetIconUrl()Returns the URL of the icon asset of native ad. abstract NativeAd.NativeAdRatinggetRating()Returns the rating asset of native ad. abstract ViewgetBrandingLogo()Returns the view with branding logo or ad information related to the ad network providing the native ad. abstract StringgetAdvertiser()Returns the advertiser asset of native ad (not the same as ad network providing it). abstract AdNetworkgetNetwork()Returns the ad network providing given native ad abstract AdInfogetAdInfo()Returns additional information like price and currency of the ad. abstract BooleanisExpired()Returns if the native ad has expired and shall no longer be used. abstract BooleanisReady()Returns if the native ad is ready to be displayed. -
-
Method Detail
-
attachToLayout
abstract Unit attachToLayout(ViewGroup layout, View mainImageView, View iconView, View ctaView)
Binds the native ad instance with given ViewGroup. Needed for click handling and tracking.
- Parameters:
layout- ViewGroup used to render the native ad.mainImageView- View used to show the main image of the ad.iconView- View used to show the icon of the native ad.ctaView- View used to show the Call To Action of the native ad.
-
detachFromLayout
abstract Unit detachFromLayout()
Removes the binding between native ad and ViewGroup. Should be called when the native ad will no longer be presented and should be destroyed.
-
getTitle
abstract String getTitle()
Returns the title of native ad.
- Returns:
String with title asset of the ad, or null if it is not available.
-
getDescription
abstract String getDescription()
Returns the description of native ad.
- Returns:
String with description asset of the ad, or null if it is not available.
-
getCallToAction
abstract String getCallToAction()
Returns the call to action of native ad.
- Returns:
String with call to action asset of the ad, or null if it is not available.
-
getImageUrl
abstract String getImageUrl()
Returns the URL of the image asset of native ad.
- Returns:
String with URL of the image asset of the ad, or null if it is not available.
-
getIconUrl
abstract String getIconUrl()
Returns the URL of the icon asset of native ad.
- Returns:
String with URL of the icon asset of the ad, or null if it is not available.
-
getRating
abstract NativeAd.NativeAdRating getRating()
Returns the rating asset of native ad.
- Returns:
NativeAdRating instance containing both value and scale of rating, or null if it is not available.
-
getBrandingLogo
abstract View getBrandingLogo()
Returns the view with branding logo or ad information related to the ad network providing the native ad. Some networks like Facebook Audience Network require this special view to be visible on native ads.
- Returns:
View that should be added to native ad layout, or null if it is not available.
-
getAdvertiser
abstract String getAdvertiser()
Returns the advertiser asset of native ad (not the same as ad network providing it).
- Returns:
String with advertiser asset of the ad, or null if it is not available.
-
getNetwork
abstract AdNetwork getNetwork()
Returns the ad network providing given native ad
- Returns:
Enum value representing the ad network providing the ad.
-
getAdInfo
abstract AdInfo getAdInfo()
Returns additional information like price and currency of the ad.
-
isExpired
abstract Boolean isExpired()
Returns if the native ad has expired and shall no longer be used.
- Returns:
True if native ad has expired, false otherwise.
-
-
-
-