Status Update
Comments
gr...@google.com <gr...@google.com> #2
Describing use case. Currently I have a following layout:
Box {
val state = rememberLazyListState()
LazyColumn(state) {
...
}
ThreeButtons(state)
}
In this example overscroll effect applied only to LazyColumn
, and because ThreeButtons
are outside of LazyColumn
, overscroll effect isn't applied to it. But ThreeButtons
are listening to the list scroll, and visually it looks like buttons are within the list. Video, attached to original description of the isue shows how it looks like.
But if I hoist overScrollController outside of LazyColumn
, I can achieve overscroll effect to be applied to buttons as well:
val overScrollController = ScrollableDefaults.overScrollController()
Box(Modifier.overScroll(overScrollController)) {
CompositionLocalProvider(LocalOverScrollConfiguration provides null) {
LazyColumn(state, overScrollController = overScrollController) {
...
}
}
ThreeButtons(state)
}
gr...@google.com <gr...@google.com> #3
To add more context on this issue though, we we were thinking how to correctly implement something similar to item decorators. For example to draw lines between cells in LazyVerticalGrids. Theoretically it is possible via just adding Modifier.drawBehind {} oh it where in the draw block we read LazyGridState.layoutInfo and draw what we need according to it. However such drawing will not be moved with the content when overscroll happens in the same way as with ThreeButtons in the example.
gr...@google.com <gr...@google.com> #4
Ok, filed
gr...@google.com <gr...@google.com> #5
Branch: androidx-main
commit 44ff305ba4ca7d70ea047c84c36968a30cd290d9
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Jun 06 19:57:46 2022
Add the ability to customise the overscroll on scrollable.
In order to customise the over scroll effect, the experimental OverscrollEffect has been exposed, as well as the default method to general the platform default for over scroll logic.
OverscrollEffect APIs have been revamped and changed to accommodate more usecases.
Test: ScrollableTest + OverscrollTest have been adjusted, the coverage was here already.
Bug: 204650733
Relnote: An experimental OverscrollEffect has been introduced to allow for custom overscroll effects, alongside the Modifier.scrollable overloads that accept it.
Relnote: Experimental LocalOverScrollConfiguration has been moved from foundation.gesture to foundation package and renamed to LocalOverscrollConfiguration
Change-Id: If19fb8063922eddf1ffcb020ec6a8fbe48471ccf
A compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/OverscrollSample.kt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/HighLevelGesturesDemo.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/ClipScrollableContainer.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
A compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/DesktopOverscroll.kt
M compose/foundation/foundation/api/current.ignore
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGrid.kt
M compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/AndroidOverscroll.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Scroll.kt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/OverscrollTest.kt
M compose/foundation/foundation/api/restricted_current.ignore
M compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/OverscrollConfiguration.kt
M compose/ui/ui-test-junit4/src/androidAndroidTest/kotlin/androidx/compose/ui/test/ComposeUiTestTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Overscroll.kt
D compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/OverScroll.kt
M compose/ui/ui-test-junit4/src/test/kotlin/androidx/compose/ui/test/junit4/RobolectricComposeTest.kt
M compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/EdgeEffectCompat.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/StretchOverscrollTest.kt
M compose/foundation/foundation/api/public_plus_experimental_1.2.0-beta04.txt
M compose/foundation/foundation/api/1.2.0-beta04.txt
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_1.2.0-beta04.txt
D compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/gestures/DesktopOverScroll.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/OverscrollScreenshotTest.kt
gr...@google.com <gr...@google.com>
so...@google.com <so...@google.com> #6
Branch: androidx-main
commit 2e11ab7513f2bbe0f4e66ba7257c1d5e36327d8d
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Tue Jun 07 20:36:06 2022
Fix for Modifier.vertical[horizontal]Scroll() not setting Modifier.overscroll()
This is required when you provide overscrollEffect into Modifier.scrollable() as otherwise there is not attached anywhere OverscrollEffect with zero size which we try to scroll. This was causing crash because of dividing by zero width/height internally.
Bug: 204650733
Test: new test in ScrollTest
Change-Id: Ibdaca7f30d85bf5d3ab2c67cb7d5b7d6dcb8ada7
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Scroll.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
gr...@google.com <gr...@google.com> #7
The following release(s) address this bug:
androidx.compose.foundation:foundation:1.3.0
gr...@google.com <gr...@google.com> #8
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
gr...@google.com <gr...@google.com> #9
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> #10
Branch: androidx-main
commit 9ed6b9a2f42e3a1f0c4c5e123f0e2c703b7d4fed
Author: Grant Toepfer <grantapher@google.com>
Date: Fri Jan 19 12:36:15 2024
Fix binary backwards compatibility in Text/ParagraphStyle
go/mangling-binary-compat
Since the properties introduced for binary backwards compatibility didn't include the inline class mangling in their jvm name, the changes were not truly backwards compatible. This change adds the correct inline class mangling to the jvm names of the getter methods.
Relnote: Fixed backwards binary incompatibility in TextStyle and ParagraphStyle
Test: Manually verified (see
Fixes:
Change-Id: I179f0ff77b3b85a05d98a28405ad936d2e9413cf
M compose/ui/ui-text/api/current.ignore
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/api/restricted_current.ignore
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/ParagraphStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextStyle.kt
gr...@google.com <gr...@google.com> #11
Expect the fix in the next compose release.
na...@google.com <na...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui-text:1.6.0
androidx.compose.ui:ui-text-android:1.6.0
androidx.compose.ui:ui-text-desktop:1.6.0
Description
Jetpack Compose version: 1.6.0-rc01
Jetpack Compose component(s) used: ui
Android Studio Build: 2023.2.1 Beta 2
Kotlin version: 1.9.20
Steps to Reproduce or Code Sample to Reproduce:
Compile a module with Compose 1.5.x, that has code reading a TextStyle.textAlign property
consume that module in another project that is using compose 1.6
at runtime crashes
Stack trace (if applicable):
I see in 1.6 there is an attempt to handle this incompatibility by adding this method, but its not working: