Fixed
Status Update
Comments
cc...@google.com <cc...@google.com> #2
How would you like to control where to insert them?
Paging 3.0 (not yet released) has two APIs that can let you insert elements in between others, in PagingData, the structure that replaces PagedList:
pagingData.flatMap { elementInList ->
// return ListOfElements
}
and
pagingData.insertSeparators { elementBefore, elementAfter ->
// return element to insert, or null if none
}
With either of those, you can insert items into your list, but only if you can query whether an element has an ad after it. Does that work for your use case? If not, can you specify what you'd be looking for?
Paging 3.0 (not yet released) has two APIs that can let you insert elements in between others, in PagingData, the structure that replaces PagedList:
pagingData.flatMap { elementInList ->
// return ListOfElements
}
and
pagingData.insertSeparators { elementBefore, elementAfter ->
// return element to insert, or null if none
}
With either of those, you can insert items into your list, but only if you can query whether an element has an ad after it. Does that work for your use case? If not, can you specify what you'd be looking for?
ra...@verse.in <ra...@verse.in> #3
Mostly the ad would need to be inserted at a given index. Next ad would be inserted at a distance of 'x' from this index, and so on.
ra...@verse.in <ra...@verse.in> #4
Any timeline for Paging 3.0 release known yet?
[Deleted User] <[Deleted User]> #5
Hi Team,
Same use case. Any update when this will be release, of any alpha version ?
Same use case. Any update when this will be release, of any alpha version ?
du...@google.com <du...@google.com> #6
Paging3 has been released in alpha now with support for transformations including insertSeparators
, which should fulfill this use-case. Feel free to file a new bug or comment here and I can re-open if the current implementation is somehow insufficient!
Description
Version used: 2.1.0
Devices/Android versions reproduced on: Any device or version
Hi,
I am loading my list content from a room DB via LiveData. My requirement is to add ads in adapter at random offsets. Unfortunately I cannot save ads in the db. I need to directly insert it to adapter list. But PagedList does not allow that.
Please support this usecase.
Thanks,