Skip to content

Commit

Permalink
Merge pull request #59 from d-kostadinov/d-kostadinov-patch-1
Browse files Browse the repository at this point in the history
Fix issue when failed admob requests are < 0
  • Loading branch information
Philipp Mikheyev authored Jan 23, 2017
2 parents 8207355 + f6e7134 commit eed3b4c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void setLimitOfAds(int mLimitOfAds) {
* @return the original position that the adapter position would have been without ads
*/
public int getAdsCountToPublish(int fetchedAdsCount, int sourceItemsCount){
if(fetchedAdsCount == 0 || getNoOfDataBetweenAds() == 0) return 0;
if(fetchedAdsCount <= 0 || getNoOfDataBetweenAds() <= 0) return 0;
int expected = 0;
if(sourceItemsCount > 0 && sourceItemsCount >= getOffsetValue()+1)
expected = (sourceItemsCount - getOffsetValue()) / getNoOfDataBetweenAds() + 1;
Expand Down

0 comments on commit eed3b4c

Please sign in to comment.