Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize LazyList by using scroll direction to influence the loaded window #2002

Open
swankjesse opened this issue May 1, 2024 · 2 comments
Labels
enhancement redwood/lazylayout Relating to `LazyColumn` or `LazyRow`

Comments

@swankjesse
Copy link
Collaborator

We currently load 15 items above and below the visible window. This is a simple strategy that mostly works, but there’s opportunities to make it more efficient:

  • Don't load items above when we're fling-scrolling down
  • Load already-requested items (the loaded window) in the current composition, then load next-requested items in the next composition.
@JakeWharton JakeWharton added enhancement redwood/lazylayout Relating to `LazyColumn` or `LazyRow` labels May 1, 2024
dnagler added a commit that referenced this issue May 1, 2024
…ding on scroll direction

This is a partial implementation for #2002
dnagler added a commit that referenced this issue May 1, 2024
…ding on scroll direction

This is a partial implementation for #2002
dnagler added a commit that referenced this issue May 1, 2024
…ding on scroll direction

This is a partial implementation for #2002
dnagler added a commit that referenced this issue May 1, 2024
…ding on scroll direction

This is a partial implementation for #2002
dnagler added a commit that referenced this issue May 1, 2024
…ding on scroll direction

This is a partial implementation for #2002
dnagler pushed a commit that referenced this issue May 7, 2024
- Reduce the size of the preload window while actively scrolling
- Once scrolling is completed, optimize the preload window so that, for example, if the user is scrolling down, we load more items below than above

This addresses issue #2002
dnagler pushed a commit that referenced this issue May 7, 2024
- Reduce the size of the preload window while actively scrolling
- Once scrolling is completed, optimize the preload window so that, for example, if the user is scrolling down, we load more items below than above

This addresses issue #2002
dnagler pushed a commit that referenced this issue May 7, 2024
- Reduce the size of the preload window while actively scrolling
- Once scrolling is completed, optimize the preload window so that, for example, if the user is scrolling down, we load more items below than above

This addresses issue #2002
dnagler pushed a commit that referenced this issue May 7, 2024
- Reduce the size of the preload window while actively scrolling
- Once scrolling is completed, optimize the preload window so that, for example, if the user is scrolling down, we load more items below than above

This addresses issue #2002
dnagler pushed a commit that referenced this issue May 7, 2024
- Reduce the size of the preload window while actively scrolling
- Once scrolling is completed, optimize the preload window so that, for example, if the user is scrolling down, we load more items below than above

This addresses issue #2002
dnagler added a commit that referenced this issue May 8, 2024
* Change LazyListState to be scroll-aware

- Reduce the size of the preload window while actively scrolling
- Once scrolling is completed, optimize the preload window so that, for example, if the user is scrolling down, we load more items below than above

This addresses issue #2002

* Track scrolled content changes

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
@dnagler dnagler closed this as completed May 8, 2024
@dnagler
Copy link
Collaborator

dnagler commented May 8, 2024

Fixed in #2013!

@dnagler dnagler reopened this May 14, 2024
@dnagler
Copy link
Collaborator

dnagler commented May 14, 2024

#2013 2013 was reverted in #2022--turns out the TODO we left should've been tackled in the same PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement redwood/lazylayout Relating to `LazyColumn` or `LazyRow`
Projects
None yet
Development

No branches or pull requests

3 participants