Cómo integrar Admob Native Advanced Ads usando Kotlin – Android

Estoy trabajando en un proyecto que obtiene una list de un server externo y la coloca en una vista de reciclador. Ahora quiero include Admob Native Advanced Ads dentro de la list. Estoy usando FlexibleAdapter para el adaptador. Los bloques de código son los siguientes

Presenter.kt

fun restartPager(query: String = this.query, filters: FilterList = this.appliedFilters) { this.query = query this.appliedFilters = filters subscribeToMangaInitializer() // Create a new pager. pager = createPager(query, filters) val sourceId = source.id // Prepare the pager. pagerSubscription?.let { remove(it) } pagerSubscription = pager.results() .observeOn(Schedulers.io()) .map { it.first to it.second.map { networkToLocalManga(it, sourceId) } } .doOnNext { initializeMangas(it.second) } .map { it.first to it.second.map(::CatalogueItem) } .observeOn(AndroidSchedulers.mainThread()) .subscribeReplay({ view, (page, mangas) -> view.onAddPage(page, mangas) }, { _, error -> Timber.e(error) }) // Request first page. requestNext() } 

ViewHolder.kt

 override fun createViewHolder(adapter: FlexibleAdapter<*>, inflater: LayoutInflater, parent: ViewGroup): CatalogueHolder { if (parent is AutofitRecyclerView) { val view = parent.inflate(R.layout.catalogue_grid_item).apply { card.layoutParams = FrameLayout.LayoutParams( MATCH_PARENT, parent.itemWidth / 3 * 4) gradient.layoutParams = FrameLayout.LayoutParams( MATCH_PARENT, parent.itemWidth / 3 * 4 / 2, Gravity.BOTTOM) } return CatalogueGridHolder(view, adapter) } else { val view = parent.inflate(R.layout.catalogue_list_item) return CatalogueListHolder(view, adapter) } } 

Item.kt

 override fun createViewHolder(adapter: FlexibleAdapter<*>, inflater: LayoutInflater, parent: ViewGroup): CatalogueHolder { if (parent is AutofitRecyclerView) { val view = parent.inflate(R.layout.catalogue_grid_item).apply { card.layoutParams = FrameLayout.LayoutParams( MATCH_PARENT, parent.itemWidth / 3 * 4) gradient.layoutParams = FrameLayout.LayoutParams( MATCH_PARENT, parent.itemWidth / 3 * 4 / 2, Gravity.BOTTOM) } return CatalogueGridHolder(view, adapter) } else { val view = parent.inflate(R.layout.catalogue_list_item) return CatalogueListHolder(view, adapter) } }