public int getOriginalContentPosition ( int position , int fetchedAdsCount , int sourceItemsCount ) { int noOfAds = getAdsCountToPublish ( fetchedAdsCount , sourceItemsCount ) ; // No of spaces for ads in the dataset, according to ad placement rules int adSpacesCount = ( getAdIndex ( position ) + 1 ) ; int originalPosition = position - Math . min ( adSpacesCount , noOfAds ) ; //Log.d("POSITION", position + " is originally " + originalPosition); return originalPosition ; }
Translates an adapter position to an actual position within the underlying dataset .