Office Hours — Today, December 17

Tuesday, December 15

Dec 17
7:20 PM
Mark M.
has entered the room
Mark M.
turned on guest access
7:30 PM
ani
has entered the room
ani
Hey Mark, how are you doing?
Mark M.
hello, ani!
sorry if there was a delay there
7:35 PM
Mark M.
how can I help you today?
7:35 PM
ani
No worries at all.
I was using Paging 2, and wanted to pick you brain on something around implementation
Mark M.
I played lightly with Paging 1, and I have done a fair bit with Paging 3
ani
ah..
Mark M.
Paging 2 seemed pretty close to Paging 1, so I didn't really do much with it
ani
cool
Mark M.
so, I'll try to help, but my Paging 1/2 depth is limited
ani
View paste
No worries. I understand. 
I have a backend API that is more link PageKeyed. the response of current page has the page link for the next page..
PS. I am implementing Database+network solution
let me find a link and paste here
Mark M.
OK, for Paging 1/2, I only successfully used Room for getting a DataSource.Factory
I tried once to wrap my head around the network approach, and I eventually gave up in frustration
7:40 PM
ani
Ah..
haha, no worries.
View paste
If you get a chance later, would you be able to take a look at this Stack overflow question that I asked:
https://stackoverflow.com/questions/65333763/android-paging2-library-networkpagekeyeddatasource-database-idiomatic-expe
Mark M.
OK, I will pull it up now
for what it's worth, if you are working in Kotlin, Paging 3 is *wonderful* compared to the Paging 1 API
ani
That link sums it up. but I understand that you have not worked on paging 2, I am thankful to you to take a look.
Mark M.
in terms of that Stack Overflow question... sorry, but that is beyond the scope of my Paging 1/2 expertise
I will put a bounty on it, though, this weekend when it becomes eligible
ani
totally fine, thanks so much for taking a look anyways.
7:45 PM
ani
View paste
ooh, thats cool :) 
Thank you very much
Ya, I heard about that(paging 3). My only gripe is that it is in alpha. Waiting for it to be RC.
View paste
another one on paging..
Say I have 5 pages worth oof records on server. I would normally fetch pages with recycler view scrolling as needed.
In case for some other use case, if I wanted all the pages, is there a way to make paging get all the pages(can be multiple network calls). Is there a way to trigger all pages to be loaded?
Mark M.
I do not recall an option for that, other than to progress through the PagedList yourself
but, other than putting the paging results into a RecyclerView, I did little with consuming the output of Paging
7:50 PM
ani
Ig I understand you correctly, calling pageList.get(some index that is not in the list currently) ?
7:50 PM
Mark M.
yes, or, effectively, copying the PagedList to an ArrayList or something
that may get tricky with the asynchronous data loads, though
ani
View paste
got ya, I ll git it a shot what I encounter it again. I ll keep async data loads in mind.
Thanks
View paste
On question 1, I posted it to Twitter and tagged Dustin, Chris:
https://twitter.com/itsdustinlam/status/1339305941469032448

Dustin was nice enough to answer it. Based on the answer, I feel like I didnt explain myself better though.
I like that Some devs like yourself, and some folks from google are available for taking questions.
7:55 PM
Mark M.
yeah, they will be *much* more familiar with earlier editions of Paging than I will be
8:20 PM
ani
View paste
Thanks again Mark, talk to you later.
Stay safe, cheers!
Mark M.
sorry I could not be of greater help!
ani
View paste
no, no.. not a problem. I totally understand. Thanks for giving it a shot.
May be someone on StackOverflow will suggest a better approach that what I had.
8:30 PM
Mark M.
that's a wrap for today's chat
the transcript, such as it is, will be posted to https://commonsware.com/office-hours/ shortly
the next chat is Saturday at 4pm US Eastern
have a pleasant day!
ani
has left the room
Mark M.
turned off guest access

Tuesday, December 15

 

Office Hours

People in this transcript

  • ani
  • Mark Murphy