public interface NativeAd
Interface allows to set NativeAdEventListener and to define whether web links are opened by in-app browser or by third-party browsers.

Method Summary

All Methods
Instance Methods
Abstract Methods
Modifier and TypeMethod and Description
voidaddImageLoadingListener(NativeAdImageLoadingListener listener)
Adds listener for receiving notifications about images loading progress.
voidbindNativeAd(NativeAdViewBinder viewBinder)
Bind view with native ad's content.
NativeAdAssetsgetAdAssets()
Returns ad assets.
NativeAdTypegetAdType()
Returns native ad type ResponseNativeType.
java.lang.StringgetInfo()
Information field for ResponseNativeType.IMAGE ad
voidloadImages()
Asynchronously loads ad's images.
voidremoveImageLoadingListener(NativeAdImageLoadingListener listener)
Removes listener, so it's no longer notified about images loading progress.
voidsetNativeAdEventListener(NativeAdEventListener eventListener)

Method Detail

bindNativeAd

void bindNativeAd(@NonNull
                  NativeAdViewBinder viewBinder)
           throws NativeAdException
Bind view with native ad's content.
Parameters:
viewBinder - An NativeAdViewBinder object.
Throws:
NativeAdException - If attempt to bind ad to view without providing view for any of required assets.

setNativeAdEventListener

void setNativeAdEventListener(@Nullable
                              NativeAdEventListener eventListener)
Parameters:
eventListener - NativeAdEventListener.

getAdAssets

@NonNull
NativeAdAssets getAdAssets()
Returns ad assets.
Returns:
Ad assets.

getAdType

@NonNull
NativeAdType getAdType()
Returns native ad type ResponseNativeType.
Returns:
Native ad type.

getInfo

@Nullable
java.lang.String getInfo()
Information field for ResponseNativeType.IMAGE ad
Returns:
null or info field value

loadImages

void loadImages()
Asynchronously loads ad's images. Every loaded image is set to corresponding ImageView. Images are not persisted in memory and should be loaded each time ad is being bound. Typically, every bind call should be followed by loadImages call, if automatic image loading is disabled in NativeAdRequestConfiguration.

addImageLoadingListener

void addImageLoadingListener(@NonNull
                             NativeAdImageLoadingListener listener)
Adds listener for receiving notifications about images loading progress.
Parameters:
listener - Image loading listener.

removeImageLoadingListener

void removeImageLoadingListener(@NonNull
                                NativeAdImageLoadingListener listener)
Removes listener, so it's no longer notified about images loading progress.
Parameters:
listener - Image loading listener.