Package com.yandex.mobile.ads.nativeads
Interface NativeAd
-
@MainThread public interface NativeAdInterface allows to setNativeAdEventListenerand 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 Type Method 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 typeResponseNativeType.java.lang.StringgetInfo()Information field forResponseNativeType.IMAGEadvoidloadImages()Asynchronously loads ad's images.voidremoveImageLoadingListener(NativeAdImageLoadingListener listener)Removes listener, so it's no longer notified about images loading progress.voidsetNativeAdEventListener(NativeAdEventListener eventListener)Sets anNativeAdEventListener.
-
-
-
Method Detail
-
bindNativeAd
void bindNativeAd(@NonNull NativeAdViewBinder viewBinder) throws NativeAdExceptionBind view with native ad's content.- Parameters:
viewBinder- AnNativeAdViewBinderobject.- Throws:
NativeAdException- If attempt to bind ad to view without providing view for any of required assets.
-
setNativeAdEventListener
void setNativeAdEventListener(@Nullable NativeAdEventListener eventListener)Sets anNativeAdEventListener.- Parameters:
eventListener-NativeAdEventListener.
-
getAdAssets
@NonNull NativeAdAssets getAdAssets()
Returns ad assets.- Returns:
- Ad assets.
-
getAdType
@NonNull NativeAdType getAdType()
Returns native ad typeResponseNativeType.- Returns:
- Native ad type.
-
getInfo
@Nullable java.lang.String getInfo()
Information field forResponseNativeType.IMAGEad- 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 inNativeAdRequestConfiguration.
-
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.
-
-