Status Update
Comments
ma...@google.com <ma...@google.com>
al...@mercari.com <al...@mercari.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Louis Pullen-Freilich <
Link:
Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling
Expand for full commit details
Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling
These APIs allow overscroll to have events dispatched to it by one component, and rendered in a separate component.
Fixes: b/266550551
Fixes: b/204650733
Fixes: b/255554340
Fixes: b/229537244
Test: OverscrollTest
Relnote: "Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling APIs - these APIs create a wrapped instance of the provided overscroll effect that doesn't draw / handle events respectively, which allows for rendering overscroll in a separate component from the component that is dispatching events. For example, disabling drawing the overscroll inside a lazy list, and then drawing the overscroll separately on top / elsewhere."
Change-Id: Idbb3d91546b49c1987a041f959bce4b2b09a9f61
Files:
- M
compose/foundation/foundation/api/current.txt
- M
compose/foundation/foundation/api/restricted_current.txt
- M
compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/OverscrollDemo.kt
- M
compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/OverscrollSample.kt
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/OverscrollTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Overscroll.kt
Hash: f64e25b7a473c757d080521e7dd97b3f6670f60d
Date: Fri Nov 01 18:43:56 2024
an...@google.com <an...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha06
androidx.compose.foundation:foundation-android:1.8.0-alpha06
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha06
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-alpha06
le...@google.com <le...@google.com>
ap...@google.com <ap...@google.com> #4
Branch: androidx-main
commit 962b7c8f226e07976dce0fb63bfc51e7e3d9842e
Author: Levi Albuquerque <levima@google.com>
Date: Mon Oct 03 12:42:19 2022
Add option to create non-visible lazy items
Introduced parameter to internal APIs to enable the creation of
non-visible lazy items before and after visible items. We'll
compose and place beyond bounds items before and after the visible
items in the list.
Relnote: Introduced parameter in Lazy APIs to compose and place out of viewport items
Test: Added new tests and fixed old tests to consider offscreen items
Fixes: 172029355
Change-Id: I69e8973974b1e7fa0e1bd075b63ef42cbb4709cb
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/BaseLazyListTestWithOrientation.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListBeyondBoundsAndExtraItemsTest.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListBeyondBoundsItemCountTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListHeadersTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListPinningTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListPrefetcherTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListsIndexedTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyDsl.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListMeasure.kt
na...@google.com <na...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.4.0-alpha02
ch...@gmail.com <ch...@gmail.com> #6
LazyColumn/Row in androidx.compose.foundation:foundation:1.4.0-alpha02 doesn't seem to allow it
changed for LazyRow/LazyColumn from
seem to be missing in androidx.compose.foundation:foundation:1.4.0-alpha02
le...@google.com <le...@google.com> #7
Hi, the feature is still in the LazyList internal APIs. I've marked the feature complete because we'll opening it up in Pager (which is the main use case for it) and we're studying the possibility of opening it up in LazyRow/Column (
do...@gmail.com <do...@gmail.com> #8
le...@google.com <le...@google.com>
fr...@gmail.com <fr...@gmail.com> #9
I'm also interested in this feature. When will it be available on LazyRow/Column?
as...@google.com <as...@google.com>
aj...@physics.msu.ru <aj...@physics.msu.ru> #10
go...@umito.nl <go...@umito.nl> #11
Looking for this feature in LazyColumn.
go...@umito.nl <go...@umito.nl> #12
Any updates on this?
tp...@gmail.com <tp...@gmail.com> #13
as...@google.com <as...@google.com> #14
We are looking into creating custom prefetcher APIs to address this feature.
de...@gmail.com <de...@gmail.com> #15
an...@google.com <an...@google.com>
an...@google.com <an...@google.com> #16
We have api for that in Pager already, but we are not sure about adding the same api into lists or grids.
Do you need it in order to improve the performance only? Will it help if we instead make it easier to tweak when and what items are being prefetched? The important difference here is that prefetch is not blocking the main thread and is only trying to load next item when the main thread is free, while apis like `beyondViewportPageCount` from `HorizontalPager` are eating the main thread time while we compose the items users need to see right now, even that those extra items are not visible yet.
do...@gmail.com <do...@gmail.com> #17
go...@umito.nl <go...@umito.nl> #18
For my app, I have a list of xml lines that are heavily formatted and processed. I need to use a lazy listview with an item per line for it to render properly. However on slower devices it scrolls with hiccups because it doesn't prerender a few items in advance.
I am still a Compose newbie, but from what I understand it's not possible to do this in a non recomposing way: determine optimal linebreaking for xml formatting. So it recomposes a few times to determine optimal layout. A render ahead option would at least make this not visible.
wa...@gmail.com <wa...@gmail.com> #19
+111111111111111111111
an...@google.com <an...@google.com> #20
Writing "+1" is not helping to increase the priority for the request as we are currently collecting exact use cases for this api as mentioned in
fr...@gmail.com <fr...@gmail.com> #21
For my app I had a list/grid of videos that needed to open/close websockets while I scroll. Without offscreen loading, the loading of videos was too slow. I tried to load items offscreen using firstItemIndex, but since my list was highly customizable (multiple columns, dynamic items count on screen) it was pretty terrible.
wa...@gmail.com <wa...@gmail.com> #22
I am developing a continuous sliding interface for vertical galleries, and I hope to be able to render 2-4 pages off screen in advance, rather than having users slide to the next page and load it again
an...@google.com <an...@google.com> #23
From what we hear so far most of the use cases can be solved by prefetching adjacent items. Prefetch is our mechanism of composing and measuring extra items when the main thread is idle. Right now we only prefetch one extra item in the direction of scroll and we are considering tweaking this logic to prefetch more items by default and also make this logic configurable. We already created a simple experimental api for users to try to play with changing the logic completely (beyondViewportPageCount
from HorizontalPager
is when you really need to compose the adjacent items together with the visible items because you want the whole Paget to set its height to the height of the larger page including those extra item. As otherwise the height will be only using the heights of the currently visible items and "jump" once you scroll to the new larger page. For that use case we introduced this api into Pager, but are not seeing good reasons to add it into lazy lists for now
le...@google.com <le...@google.com>
bl...@gmail.com <bl...@gmail.com> #24
Do you need it in order to improve the performance only?
For me, yes
Will it help if we instead make it easier to tweak when and what items are being prefetched?
Yes. It would be helpful if I can just set a prefetch = 5
parameter.
The important difference here is that prefetch is not blocking the main thread and is only trying to load next item when the main thread is free
For me, that is fine.
Description
Requesting for an API to preload offscreen items in a LazyColumn. Currently I didn't find a way to do so.
Example Use case:
My request is similar to the following APIs: