Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #3
The issue is caused by parent data modifier not being updated on layout node inside AndroidViewHolder
.
parentData
should be invalidated in measure delegate when the corresponding Modifier.Node
is attached. However, when LayoutNode
is detached, this invalidate call only parentDataDirty
on attach, and nothing calls updateParentData
again until modifier is updated.
pr...@google.com <pr...@google.com> #4
I assume that could also cause Modifier.align(BottomCenter)
on an Android View inside a Box to not work? Just asking because if not I'll file a separate bug for that
Description
Version used: 1.0.0-alpha07 / 1.0.0-alpha06
Devices/Android versions reproduced on: Sabrina (Android 12)
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
```
@Preview
@Composable
fun TestLazyGrid() {
val cardSpacing = 20.dp
val contentPadding = 20.dp
TvLazyVerticalGrid(
columns = TvGridCells.Fixed(3),
horizontalArrangement = Arrangement.spacedBy(cardSpacing),
verticalArrangement = Arrangement.spacedBy(cardSpacing),
contentPadding = PaddingValues(contentPadding),
modifier = Modifier.fillMaxSize()
) {
// Tested on Sabrina
// val height = 357.dp // works fine, can scroll to the last item
val height = 358.dp // can't scroll past the 2nd row
items((1..12).toList()) {
Card(
onClick = { },
Modifier.size(240.dp, height)
) {
Text(text = "Item #$it")
}
}
}
}
```
Depending on the card sizes in the grid (357dp vs 358dp in the example above), scrolling will stop at the 2nd row.