Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. private fun getItem(position: Int): CampaignAd? {
  2. if (adsToWatch.isNotEmpty() && position <= adsToWatch.size) {
  3. return adsToWatch.getOrNull(position - 1)
  4. } else if (adsAlreadyWatched.isNotEmpty() && position > adsToWatch.size) {
  5. return adsAlreadyWatched.getOrNull(position.minus(if (adsToWatch.isEmpty()) 1 else 2))
  6. }
  7.  
  8. return null
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement