Status Update
Comments
so...@google.com <so...@google.com>
ma...@google.com <ma...@google.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
ya...@gmail.com <ya...@gmail.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
ap...@google.com <ap...@google.com> #4
Branch: androidx-master-dev
commit 03b8c488e9eb8764bd36e30590f5171823f9560a
Author: Matvei Malkov <malkov@google.com>
Date: Thu Oct 08 18:19:09 2020
Add InteractionState to scrollable and corresponding containers, add animation observation to LazyList
This CL adds InteractionState to the ScrollableColumn/Row and Lazy lists to allow people to observe interactions that are happening on this element. While doing so, to make functionality on par, I added isAnimationRunning and stopAnimation is LazyState, so people won't miss this menthods while migrating from ScrollableColumn.
Change-Id: I815666e1b4544dcd5da9f253ec1b539fdd777529
Relnote: Added interactionState to Modifier.scrollable, ScrollableColumn and LazyColumnFor
Fixes: 169509805
Test: added
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/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/ListDemos.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/ScrollerSamples.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyColumnForTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Scroll.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
ma...@google.com <ma...@google.com> #5
As I mentioned above, I exposed InteractionState on the scrollable containers (and their states), so you are now able to understand whether fling or drag is happening and distinguish between them. This thought doesn't solve your issue, as you need to wait for a proper nested scrolling support, unfortunately.
Closing this as the main feature request of exposing ongoing scroll/fling is completed, please, follow the rest of the work here:
Description
Component used: ScrollableColumn/verticalScroll modifier
Version used: alpha-03
Devices/Android versions reproduced on: Irrelevant
The
scrollable
modifier hasonScrollStarted
/onScrollStopped
parameters, but theverticalScroll
/horizontalScroll
modifiers are not exposing those. Some type visibility likestate.scrollableController
make it impossible to usescrollable
manually.Would also be nice to have those on
ScrollableColumn
/ScrollableRow
I guess.Use case: I'd like to receive the event where the user stopped scrolling, and use the velocity to trigger a snap behavior.
I have the following page:
I want to be able to trigger a smooth scroll to a certain value (
0
orcollapsingToolbarSize
) to snap the toolbar state.Maybe there is a different way of doing this. I tried using the
rawDragGestureFilter
, but the onStop was always receiving a value of0
for the offset. Maybe this is a bug?Thanks.