Status Update
Comments
si...@google.com <si...@google.com> #2
We were not able to reproduce the issue with the information provided here. Can you please provide the below requested information to better understand the issue:
Steps to reproduce
Please provide sample project or apk to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample project or apk
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
Could you please explain the expected behavior.
Current output
Could you please explain the current behavior.
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
To avoid leaking private information, please share private files via Google Drive instead. Share by inviting android-bugreport@google.com to your Drive folder, then provide the shareable link found from Advanced options. (note: bug reports should always be shared only via Google Drive)
Steps to reproduce
Please provide sample project or apk to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample project or apk
Frequency
How frequently does this issue occur? (e.g 100% of the time, 10% of the time)
Expected output
Could you please explain the expected behavior.
Current output
Could you please explain the current behavior.
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
To avoid leaking private information, please share private files via Google Drive instead. Share by inviting android-bugreport@google.com to your Drive folder, then provide the shareable link found from Advanced options. (note: bug reports should always be shared only via Google Drive)
ja...@gmail.com <ja...@gmail.com> #3
It's not a bug, it's a lack of feature. PagedList doesnt support methods add() or remove(), throws UnsupportedException from the AbstractList. And I don't see other way to manually tamper the datasource list for purpose of adding, deleting, uptading single item. Havent found that in doc, what I found was just one unanswered stackoverflow question
si...@google.com <si...@google.com> #4
Can you please provide comment #2 information to better understand the issue:
ja...@gmail.com <ja...@gmail.com> #5
I feel like talking to the bot here. Could you point me to the method allowing to manually add/update/remove single item to/from PagedList? If no - there is the issue. if yes, then I've been mistaken.
si...@google.com <si...@google.com> #6
We have passed this to the development team and will update this issue with more information as it becomes available.
ni...@gmail.com <ni...@gmail.com> #7
anything new? it's been a few months
cc...@google.com <cc...@google.com> #8
Internal bug got filed to the wrong place, sorry we missed this.
It may be possible to implement this with the filter we're planning to implement:https://buganizer.corp.google.com/issues/111130543 You could have the UI, (any time that an item is swiped away) re-filter the current PagedList and call submitList() again with it.
Generally paging expects a one way data flow from the source of data (like network or database repository), so we don't want to make possible to mutate the UI's copy of PagedList directly.
It may be possible to implement this with the filter we're planning to implement:
Generally paging expects a one way data flow from the source of data (like network or database repository), so we don't want to make possible to mutate the UI's copy of PagedList directly.
ku...@gmail.com <ku...@gmail.com> #10
You could have the UI, (any time that an item is swiped away) re-filter the current PagedList and call submitList() again with it.`
Let's say I have one item I want to remove. Isn't it kinda expensive that if I want to remove that, I have to filter the whole list?
myPagedList.filter { it.id != removedItem.id }
What about a PagedList.update(item: T)
or PagedList.remove(item: T)
Generally paging expects a one way data flow from the source of data (like network or database repository), so we don't want to make possible to mutate the UI's copy of PagedList directly.
What do you think about passing a Flow
or Observable
to a DataSource
and have that listen to the updates and let the changes reflect on the PagedList
?
cc...@google.com <cc...@google.com> #11
Having to iterate through the whole list to filter one item out doesn't seem terrible to me. That filter API is the shape of things in the Paging 3.0 codebase right now.
The problem is that an API to directly mutate the UI's copy is that it needs to account for further updates coming in. If I modify an item locally, and send a network request to update that item, I might race a refresh that's already in progress.
That's what's nice about making these transformations on the stream - you can set a rule for what and how to replace, conditionally, and it'll keep working even if new updates occur.
Marking as dupe of master feature request tracking this general feature.
The problem is that an API to directly mutate the UI's copy is that it needs to account for further updates coming in. If I modify an item locally, and send a network request to update that item, I might race a refresh that's already in progress.
That's what's nice about making these transformations on the stream - you can set a rule for what and how to replace, conditionally, and it'll keep working even if new updates occur.
Marking as dupe of master feature request tracking this general feature.
Description
Simple case:
Screen contains list of network fetched items. Element can be swipe-deleted. There is no way of telling any of the mentioned classes that it should just remove a single item from the list.
Same goes for adding or updating.