Status Update
Comments
ma...@google.com <ma...@google.com>
al...@mercari.com <al...@mercari.com> #2
```
SwipeToDismissBox(
state = swipeToDismissBoxState,
onDismissed = { finish() },
hasBackground = false
) { isBackground ->
```
Google Map inside SwipeToDismissBox - scrolling works, but no swipe to dismiss.
Branch
an...@google.com <an...@google.com> #3
Running the code from the map_swipe branch - I'm seeing that MapActivity and MapWithDismissActivity are scrolling the map ok, but the SwipeToDismiss is not working (so that's different to the behaviour reported above). But I do see the reported behaviour in App itself, that within SwipeDismissableNavHost, that SwipeToDismissBox is always handling horizontal swipes, so probably the map does not receive those gestures. Not clear yet why this is, because Modifier.edgeSwipeToDismiss is working for other horizontally scrollable components.
le...@google.com <le...@google.com>
ap...@google.com <ap...@google.com> #4
Having looked into this in more detail, GoogleMap does not support nested scrolling, so it's not compatible with Modifier.edgeSwipeToDismiss. Instead, we've seen that adding an 'enabled' parameter to SwipeDismissableNavHost and setting enabled = !cameraPositionState.isMoving would allow panning horizontally and vertically in the map (and adding a button to dismiss the screen). NB caveat is that there's a bug where the initial swipe needs to be vertical to avoid the parent handling it - this affects other scroll types as well as the Wear SwipeToDismiss.
We will look at adding the enabled parameter to Wear Compose in the near future (after release of 1.0).
na...@google.com <na...@google.com> #5
ch...@gmail.com <ch...@gmail.com> #6
Branch: androidx-main
commit 9ca92a49e6529a24f9678b319074a9c7c532d74b
Author: Rajat Biswas <rajatbiswas@google.com>
Date: Tue Jul 04 11:16:50 2023
userSwipeEnabled param added to SwipeDismissableNavHost
Bug: 230865655
Test: androidx.wear.compose.navigation.SwipeDismissableNavHostTest
Relnote: "Added a param userSwipeEnabled to SwipeDismissableNavHost
which can disable swipe gesture if turned false."
Change-Id: Id2a0befd6895598967ccc6d617a7d4b52756b8c6
M wear/compose/compose-navigation/api/current.txt
M wear/compose/compose-navigation/api/restricted_current.txt
M wear/compose/compose-navigation/src/androidTest/kotlin/androidx/wear/compose/navigation/SwipeDismissableNavHostTest.kt
M wear/compose/compose-navigation/src/main/java/androidx/wear/compose/navigation/SwipeDismissableNavHost.kt
le...@google.com <le...@google.com> #7
do...@gmail.com <do...@gmail.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.wear.compose:compose-navigation:1.3.0-alpha02
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: