summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Silva <lusilva@google.com> 2024-12-17 14:08:22 -0500
committer Lucas Silva <lusilva@google.com> 2024-12-17 14:08:22 -0500
commit967f73e3b012e6b4714b9081da6cf766f0c19fcf (patch)
treec07317ef50b82a078f3a6b94959f306e7fe83846
parent7de9e84af91695133c550dbfecb4ff0691627081 (diff)
Disable fade-out animation on grid items
Modifier.animateItem's fade out animation is not supported when the grid contains AndroidView instances. In this case, the animation breaks and is flashing unrelated pieces of UI during the fade. Fixes: 376495198 Test: manually by flashing and removing items from the grid Flag: EXEMPT bugfix Change-Id: I436f0f8972616d1bf017b1f3e2e1e6be37fdc2c3
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
index 5dbedc7045e4..bf3360f0ea14 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
@@ -931,7 +931,9 @@ private fun BoxScope.CommunalHubLazyGrid(
Modifier.requiredSize(dpSize)
.thenIf(!isItemDragging) {
Modifier.animateItem(
- placementSpec = spring(stiffness = Spring.StiffnessMediumLow)
+ placementSpec = spring(stiffness = Spring.StiffnessMediumLow),
+ // See b/376495198 - not supported with AndroidView
+ fadeOutSpec = null,
)
}
.thenIf(isItemDragging) { Modifier.zIndex(1f) },
@@ -980,11 +982,14 @@ private fun BoxScope.CommunalHubLazyGrid(
size = size,
selected = false,
modifier =
- Modifier.requiredSize(dpSize).animateItem().thenIf(
- communalResponsiveGrid()
- ) {
- Modifier.graphicsLayer { alpha = itemAlpha?.value ?: 1f }
- },
+ Modifier.requiredSize(dpSize)
+ .animateItem(
+ // See b/376495198 - not supported with AndroidView
+ fadeOutSpec = null
+ )
+ .thenIf(communalResponsiveGrid()) {
+ Modifier.graphicsLayer { alpha = itemAlpha?.value ?: 1f }
+ },
index = index,
contentListState = contentListState,
interactionHandler = interactionHandler,