Package com.yandex.mobile.ads.nativeads
Interface NativeAd
-
@MainThread public interface NativeAd
Interface allows to setNativeAdEventListener
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 Type Method 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 typeResponseNativeType
.java.lang.String
getInfo()
Information field forResponseNativeType.IMAGE
advoid
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 anNativeAdEventListener
.
-
-
-
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 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.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 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.
-
-