Is there a way to remove a specific native ad item/cell from the
The ability to remove a specific cell from Twitter MoPub’s
MoPubRecyclerAdapter containing a native ad.
Use case: In a feed of content where the RecyclerView cells are dismissible it is important to keep the dismiss action consistent for the MoPub native ad cells in order to match the rest of the content. In addition, not being able to dismiss the native ads will create a scenario where multiple ads will be next to each other in the feed creating a poor user experience as the rest of the content is dismissed.
The function to dismiss a specific ad’s cell of the MoPubRecyclerAdapter is not accessible by the public API.
MoPubStreamAdPlacer object which is responsible for managing the ads in a given feed contains a
removeAdsInRange method which provides the required functionality. However, the
MoPubStreamAdPlacer object is private accessible within the
MoPubRecyclerAdapter and therefore can not be utilized.
CustomMoPubRecyclerAdapter that extends
MoPubRecyclerAdapter and making
MoPubStreamAdPlacer publicly accessible.