public class MoPubStaticNativeAdRenderer extends java.lang.Object implements MoPubAdRenderer<StaticNativeAd>
MoPubAdRenderer for rendering native ads.| Constructor and Description |
|---|
MoPubStaticNativeAdRenderer(ViewBinder viewBinder)
Constructs a native ad renderer with a view binder.
|
| Modifier and Type | Method and Description |
|---|---|
android.view.View |
createAdView(android.content.Context context,
android.view.ViewGroup parent)
Creates a new view to be used as an ad.
|
void |
renderAdView(android.view.View view,
StaticNativeAd staticNativeAd)
Renders a view created by
MoPubAdRenderer.createAdView(android.content.Context, android.view.ViewGroup) by filling it with ad data. |
boolean |
supports(BaseNativeAd nativeAd)
Determines if this renderer supports the type of native ad passed in.
|
public MoPubStaticNativeAdRenderer(ViewBinder viewBinder)
viewBinder - The view binder to use when inflating and rendering an ad.public android.view.View createAdView(android.content.Context context,
android.view.ViewGroup parent)
MoPubAdRendererMoPubStreamAdPlacer.getAdView(int, android.view.View, android.view.ViewGroup)
and the convertView is null. You must return a valid view.createAdView in interface MoPubAdRenderer<StaticNativeAd>context - The context. Useful for creating a view. This is recommended to be an
Activity. If you have custom themes defined in your Activity, not passing
in that Activity will result in the default Application theme being used
when creating the ad view.parent - The parent that the view will eventually be attached to. You might use the
parent to determine layout parameters, but should return the view without
attaching it to the parent.public void renderAdView(android.view.View view,
StaticNativeAd staticNativeAd)
MoPubAdRendererMoPubAdRenderer.createAdView(android.content.Context, android.view.ViewGroup) by filling it with ad data.renderAdView in interface MoPubAdRenderer<StaticNativeAd>view - The ad ViewstaticNativeAd - The ad data that should be bound to the view.public boolean supports(BaseNativeAd nativeAd)
MoPubAdRenderersupports in interface MoPubAdRenderer<StaticNativeAd>nativeAd - The native ad to render.