T - The ad payload type.public interface MoPubAdRenderer<T extends BaseNativeAd>
MoPubStaticNativeAdRenderer with ViewBinder to customize your ad view with your own layout. However, if you
wish to programmatically create or manage your ad view, you can implement MoPubAdRenderer
directly.| 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,
T ad)
Renders a view created by
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.
|
android.view.View createAdView(android.content.Context context,
android.view.ViewGroup parent)
MoPubStreamAdPlacer.getAdView(int, android.view.View, android.view.ViewGroup)
and the convertView is null. You must return a valid view.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.void renderAdView(android.view.View view,
T ad)
createAdView(android.content.Context, android.view.ViewGroup) by filling it with ad data.view - The ad Viewad - The ad data that should be bound to the view.boolean supports(BaseNativeAd nativeAd)
nativeAd - The native ad to render.