com.yandex.mobile.ads.nativeads
Interface NativeAd
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
Modifier and Type | Method and Description |
---|---|
void | addImageLoadingListener(NativeAdImageLoadingListener listener)
Adds listener for receiving notifications about images loading progress.
|
void | bindNativeAd(NativeAdViewBinder viewBinder)
Bind view with native ad's content.
|
NativeAdAssets | getAdAssets()
Returns ad assets.
|
NativeAdType | getAdType()
Returns native ad type
ResponseNativeType . |
java.lang.String | getInfo()
Information field for
ResponseNativeType.IMAGE ad |
void | loadImages()
Asynchronously loads ad's images.
|
void | removeImageLoadingListener(NativeAdImageLoadingListener listener)
Removes listener, so it's no longer notified about images loading progress.
|
void | setNativeAdEventListener(NativeAdEventListener eventListener)
Sets an
NativeAdEventListener . |
Method Detail
bindNativeAd
void bindNativeAd(@NonNull NativeAdViewBinder viewBinder) throws NativeAdException
Bind view with native ad's content.
- Parameters:
viewBinder
- AnNativeAdViewBinder
object.- Throws:
NativeAdException
- If attempt to bind ad to view without providing view for any of required assets.
setNativeAdEventListener
void setNativeAdEventListener(@Nullable NativeAdEventListener eventListener)
Sets an
NativeAdEventListener
.- Parameters:
eventListener
-NativeAdEventListener
.
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.