Status Update
Comments
xx...@gmail.com <xx...@gmail.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...@elkroom.com <an...@elkroom.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
an...@google.com <an...@google.com>
an...@google.com <an...@google.com> #4
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit b79eaa2f9c0171e192dd14a8e958a3b0a1920d04
Author: Andrei Shikov <ashikov@google.com>
Date: Tue Mar 21 23:29:25 2023
Support arrangement for LazyGrid cells
Update grid measure logic to support custom arrangements of columns in vertical grid or rows in horizontal one.
Test: LazyGrid tests
Fixes: 235121277
Fixes: 267942510
Relnote: """Added support for fixed size cells in LazyGrid and arranging them with cross axis arrangement."""
Change-Id: I83ed9c6fa41d500ab049726b85373fade65a7ccc
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/ListDemos.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyArrangementsTest.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/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridDsl.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridMeasuredLine.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridMeasuredLineProvider.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridCells.kt
na...@google.com <na...@google.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.5.0-alpha02
da...@gmail.com <da...@gmail.com> #7
as...@google.com <as...@google.com> #8
Arrangement.SpaceBetween
is supported and should work as expected.
Make sure to use GridCells.FixedSize
to allow space for arrangement. Other types of GridCells
take all available space by default, which might cause it to appear differently.
mu...@gmail.com <mu...@gmail.com> #9
This doesn't solve the OP.
I need Fixed
with Arrangement.SpaceBetween
. Currently it just stretches Fixed.count
amount without adding SpaceBetween.
as...@google.com <as...@google.com> #10
Fixed
is always stretched to fill all available space (and fills in spacing from arrangement in between). You want to use FixedSize
to ensure there's some space left instead.
le...@gmail.com <le...@gmail.com> #11
@Composable
fun SimpleGrid() {
LazyVerticalGrid(
columns = GridCells.FixedSize(200.dp),
horizontalArrangement = Arrangement.SpaceBetween
) {
items(items = (1..10).toList(), span = {index -> if(index==5) {GridItemSpan(maxLineSpan)} else {GridItemSpan(1)}}) {
Button(onClick = {}, Modifier.wrapContentWidth()) {
Text(text = "$it")
}
}
}
}
an...@google.com <an...@google.com> #12
Can you please share the screenshot of what you are getting with this code and explain what behavior do you expect instead? Thanks
Description
Jetpack Compose version: 1.2.0-beta02
Jetpack Compose component used: LazyVerticalGrid
Android Studio Build: Android Studio Dolphin | 2021.3.1 Beta 2
Kotlin version: 1.6.21
Steps to Reproduce or Code Sample to Reproduce:
I expect grid items are arranged by horizontalArrangement property. However, these items are always arranged like
SpaceAround
.This may be caused by
Density.arrange
inArrangement.Horizontal
doesn't called bycalculateItemsOffsets
inLazyGridMeasure.kt
when VerticalGrid.Is anything update planned?