I am trying to use recycler view with multiple view types in the getitemtype() method I used the below code when I use this code at 5th position one of my item is not visible its looking add when I add new values to that list....by the way here I'm using firebase fire store to store and retrieve data and in between this list I tried to place ad-mob native ads .
override fun getItemViewType(position: Int): Int {
if (position%5 == 0){
// after 5 items show add
return VIEW_TYPE_AD
} else{
// to show content
return VIEW_TYPE_CONTENT
}
}
i need to know how to show the 5th item of main list along with native ad...mean i want know to how to show both view types without overlapping.