Fix detekt issue

This commit is contained in:
Benoit Marty
2026-06-19 15:02:29 +02:00
parent 3a5e9f43b9
commit fa5e871e7e
@@ -14,6 +14,8 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.movableContentOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.core.content.res.ResourcesCompat
@@ -44,19 +46,20 @@ fun ElementPreview(
}
) {
ElementTheme(theme = theme) {
val movableContent = remember { movableContentOf { content() } }
if (showBackground) {
// If we have a proper contentColor applied we need a Surface instead of a Box
Surface(
modifier = if (fillMaxSize) Modifier.fillMaxSize() else Modifier,
content = content,
content = movableContent,
)
} else {
if (fillMaxSize) {
Box(modifier = Modifier.fillMaxSize()) {
content()
movableContent()
}
} else {
content()
movableContent()
}
}
}