customViewForRendering

abstract fun customViewForRendering(container: ViewGroup, nimbusMolocoNativeAd: NimbusMolocoNativeAd): View

Override this method to provide a custom layout for a Moloco NativeAd.

The View returned from this method should have all the data set from the campaign on children views such as the call to action, image data, title, privacy icon etc. The call to action and any other views that should trigger a click through must be added to NimbusMolocoNativeAd.clickableViews before returning from this method. The view returned from this method should not be attached to the container passed in as it will be attached at a later time during the rendering process.

Return

A custom ad layout that will be attached to the container

Parameters

container

the container the layout will be attached to

nimbusMolocoNativeAd

object containing the relevant ad information to be presented. Use NimbusMolocoNativeAd.clickableViews to set the views that should be clickable and NimbusMolocoNativeAd.assets to access the native ad assets that can be used to populate your native view.