https://kotlinlang.org logo
d

Dustin Lam

03/24/2021, 7:35 PM
what do you mean by "keep fetching"?
s

Saiedmomen

03/24/2021, 7:36 PM
keeps prepending data with previous keys.
d

Dustin Lam

03/24/2021, 7:37 PM
do you expect it to stop because you reached prefetch distance or because you ran out of data to load?
s

Saiedmomen

03/24/2021, 7:38 PM
for example if init key is zero, it imediately fetches -1 and then immediately -2 and so on.
d

Dustin Lam

03/24/2021, 7:38 PM
are those pages you're loading with key = -1, etc empty?
s

Saiedmomen

03/24/2021, 7:38 PM
no
I think the problem is that it scrolls to start of -1
d

Dustin Lam

03/24/2021, 7:39 PM
is your layout nested scrolling by any chance?
s

Saiedmomen

03/24/2021, 7:39 PM
it's compose lazycolumn
d

Dustin Lam

03/24/2021, 7:39 PM
oh i see
that sounds like a bug, would you mind filing ine and attaching your project? ill find some time to take a look
but in general yes, loading in both directions is supposed to be supported
s

Saiedmomen

03/24/2021, 7:42 PM
Ok. will do tomorrow. that would be awesome!
d

dustin

03/24/2021, 7:42 PM
right now new page loads cause compose to re-compose the entire list, so that's probably part of the problem, but i am surprised it is affecting scroll position
thanks for bringing this up blob smile
👍 1
s

Saiedmomen

03/24/2021, 7:47 PM
Maybe its because it remembers current index zero, but after the prepend, index zero is start of -1.
@dustin https://issuetracker.google.com/issues/183623944 Also Made a MWE. Please let me know if I could help more. Hope gets fixed soon 👍
d

Dustin Lam

03/24/2021, 11:48 PM
Thanks!
s

Saiedmomen

06/05/2021, 6:07 PM
@dustin Hey Dustin 🙂 Any news on this?
d

Dustin Lam

06/05/2021, 7:09 PM
hey! it's on the queue, haven't forgotten about this 🙂 we need to do a bit of work on compose itself so we can support prepend and i have a meeting next week to discuss these exact changes
👏 1
👌 1