Replace SharedTransitionScope with SharedTransitionLayout

This commit is contained in:
MM20 2024-06-14 23:18:50 +02:00
parent 997f7d29d0
commit 8d7afb486f
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -1,6 +1,7 @@
package de.mm20.launcher2.ui.launcher.search.common.grid package de.mm20.launcher2.ui.launcher.search.common.grid
import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.SharedTransitionLayout
import androidx.compose.animation.SharedTransitionScope import androidx.compose.animation.SharedTransitionScope
import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut import androidx.compose.animation.fadeOut
@ -30,10 +31,12 @@ fun SearchResultGrid(
highlightedItem: SavableSearchable? = null, highlightedItem: SavableSearchable? = null,
transitionKey: Any? = items transitionKey: Any? = items
) { ) {
SharedTransitionScope { SharedTransitionLayout(
modifier = modifier,
) {
AnimatedContent( AnimatedContent(
items to transitionKey, items to transitionKey,
modifier = it then modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(4.dp), .padding(4.dp),
transitionSpec = { transitionSpec = {