Merge "Reuse compositions only when content key matching" into main
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 55fc3a2..17c4e02 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
@@ -194,6 +194,7 @@
items(
count = list.size,
key = { index -> list[index].key },
+ contentType = { index -> list[index].key },
span = { index -> GridItemSpan(list[index].size.span) },
) { index ->
val cardModifier = Modifier.width(Dimensions.CardWidth)
@@ -361,6 +362,8 @@
.createView(context, model.appWidgetId, model.providerInfo)
.apply { updateAppWidgetSize(Bundle.EMPTY, listOf(size)) }
},
+ // For reusing composition in lazy lists.
+ onReset = {},
)
}
}
@@ -376,7 +379,7 @@
FrameLayout(context).apply { addView(model.remoteViews.apply(context, this)) }
},
// For reusing composition in lazy lists.
- onReset = {}
+ onReset = {},
)
}