Verified
Status Update
Comments
ap...@google.com <ap...@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
ap...@google.com <ap...@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
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 3d133f1208c0c2936b620e3940d6b61cb50b9ef5
Author: Mihai Popa <popam@google.com>
Date: Tue Feb 15 20:48:28 2022
Improve Lazy grids animateScrollToItem
Similar to I7c655d025e9e0a716b8b8dfba36117e043a529c7 and
Ie55adbd9d360c46362e96d125777e70e5c4334c6.
1) Start using expected distance to the item based on the average lines
size instead of just starting an animation to a fixed large offset.
This works better when the target item is close to the original
state, especially when scrolling backward as we can easily overshot
as we stop this animation only once the target item became visible
2) Properly pass the velocity between different animations and their
lastFrameTimeNanos so the sequentialAnimation param start to work
properly(previously it was doing nothing). The simplest way is to
just use AnimationState.copy() when we need to reset the current
value.
3) Added proper per frame offset assertions which allows us to verify
that the animation behave as a proper spring() animation in the cases
when the item sizes are the same and when we don't need to scroll too
much so we fall back to the teleport
4) Fix LazyGridState.animateScrollToItem() skipping the item on slow
devices. It was possible that we go into a wrong if branch in the
scrolling logic when the overshoot happened and the list ended up
scrolled to the end instead of pointing to the needed element.
Test: new tests in LazyScrollTest
Bug: 211753558
Change-Id: Iacca7cc7a074700b7d88a0317d995d49699b2b16
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyGridState.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyGridTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGrid.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyScrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridScrolling.kt
https://android-review.googlesource.com/1986826
Branch: androidx-main
commit 3d133f1208c0c2936b620e3940d6b61cb50b9ef5
Author: Mihai Popa <popam@google.com>
Date: Tue Feb 15 20:48:28 2022
Improve Lazy grids animateScrollToItem
Similar to I7c655d025e9e0a716b8b8dfba36117e043a529c7 and
Ie55adbd9d360c46362e96d125777e70e5c4334c6.
1) Start using expected distance to the item based on the average lines
size instead of just starting an animation to a fixed large offset.
This works better when the target item is close to the original
state, especially when scrolling backward as we can easily overshot
as we stop this animation only once the target item became visible
2) Properly pass the velocity between different animations and their
lastFrameTimeNanos so the sequentialAnimation param start to work
properly(previously it was doing nothing). The simplest way is to
just use AnimationState.copy() when we need to reset the current
value.
3) Added proper per frame offset assertions which allows us to verify
that the animation behave as a proper spring() animation in the cases
when the item sizes are the same and when we don't need to scroll too
much so we fall back to the teleport
4) Fix LazyGridState.animateScrollToItem() skipping the item on slow
devices. It was possible that we go into a wrong if branch in the
scrolling logic when the overshoot happened and the list ended up
scrolled to the end instead of pointing to the needed element.
Test: new tests in LazyScrollTest
Bug: 211753558
Change-Id: Iacca7cc7a074700b7d88a0317d995d49699b2b16
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyGridState.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyGridTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGrid.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyScrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridScrolling.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 2c087945231b7650f0a4d34cc6b23d30c6aa2f93
Author: Mihai Popa <popam@google.com>
Date: Tue Feb 08 13:57:41 2022
Accept negative offsets in LazyGridState scrolling
Similar to Iceb907f268a19db3e9315154ebd136764ad975a3 for lists.
Relnote: Now it is allowed to pass negative scroll offsets into LazyGridState.scrollToItem() and LazyGridState.animateScrollToItem().
Test: LazyScrollTest
Bug: 211753558
Change-Id: I025c608ce2eef36f90ad657bba78229b62bcd725
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyGridState.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyScrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridScrollPosition.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyScrollTest.kt
https://android-review.googlesource.com/1976767
Branch: androidx-main
commit 2c087945231b7650f0a4d34cc6b23d30c6aa2f93
Author: Mihai Popa <popam@google.com>
Date: Tue Feb 08 13:57:41 2022
Accept negative offsets in LazyGridState scrolling
Similar to Iceb907f268a19db3e9315154ebd136764ad975a3 for lists.
Relnote: Now it is allowed to pass negative scroll offsets into LazyGridState.scrollToItem() and LazyGridState.animateScrollToItem().
Test: LazyScrollTest
Bug: 211753558
Change-Id: I025c608ce2eef36f90ad657bba78229b62bcd725
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyGridState.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyScrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridScrollPosition.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyScrollTest.kt
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit b099fbd881bd782702cc24a5962c70fa66998214
Author: Mihai Popa <popam@google.com>
Date: Wed Feb 16 09:29:55 2022
Fill the content padding area after overscrolling in Lazy grids
Similar to Id2ceb60193951b7d49da6a4255bdd27ac9bbb485
When we overscroll and start scrolling back we were only composing items
needed to fill the main space not including the content padding which
was noticed by the Accompanist Pager users and reported as
https://github.com/google/accompanist/issues/875 .
Test: new tests in LazyGridsContentPaddingTest
Bug: 211753558
Change-Id: I67c21ea93c1ef9d21a10d3a7b3dc5888d1e49b68
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridMeasure.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyGridsContentPaddingTest.kt
https://android-review.googlesource.com/1987786
Branch: androidx-main
commit b099fbd881bd782702cc24a5962c70fa66998214
Author: Mihai Popa <popam@google.com>
Date: Wed Feb 16 09:29:55 2022
Fill the content padding area after overscrolling in Lazy grids
Similar to Id2ceb60193951b7d49da6a4255bdd27ac9bbb485
When we overscroll and start scrolling back we were only composing items
needed to fill the main space not including the content padding which
was noticed by the Accompanist Pager users and reported as
Test: new tests in LazyGridsContentPaddingTest
Bug: 211753558
Change-Id: I67c21ea93c1ef9d21a10d3a7b3dc5888d1e49b68
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridMeasure.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyGridsContentPaddingTest.kt
po...@google.com <po...@google.com>
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit e1016747f19bc1b9e05cf9edfe3a7f04f36b44f5
Author: Mihai Popa <popam@google.com>
Date: Thu Feb 24 18:06:56 2022
Add onlyOneInitialMeasurePass test for lazy grids
Bug: 211753558
Test: LazyGridTest
Change-Id: I6134c19c033c69cf6a34c0b8acd04f55872df4c6
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyGridTest.kt
https://android-review.googlesource.com/1998878
Branch: androidx-main
commit e1016747f19bc1b9e05cf9edfe3a7f04f36b44f5
Author: Mihai Popa <popam@google.com>
Date: Thu Feb 24 18:06:56 2022
Add onlyOneInitialMeasurePass test for lazy grids
Bug: 211753558
Test: LazyGridTest
Change-Id: I6134c19c033c69cf6a34c0b8acd04f55872df4c6
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyGridTest.kt
Description
No description yet.