mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:05:28 +00:00
Fix detekt issue
This commit is contained in:
+6
-3
@@ -14,6 +14,8 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.CompositionLocalProvider
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
|
import androidx.compose.runtime.movableContentOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
@@ -44,19 +46,20 @@ fun ElementPreview(
|
|||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
ElementTheme(theme = theme) {
|
ElementTheme(theme = theme) {
|
||||||
|
val movableContent = remember { movableContentOf { content() } }
|
||||||
if (showBackground) {
|
if (showBackground) {
|
||||||
// If we have a proper contentColor applied we need a Surface instead of a Box
|
// If we have a proper contentColor applied we need a Surface instead of a Box
|
||||||
Surface(
|
Surface(
|
||||||
modifier = if (fillMaxSize) Modifier.fillMaxSize() else Modifier,
|
modifier = if (fillMaxSize) Modifier.fillMaxSize() else Modifier,
|
||||||
content = content,
|
content = movableContent,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
if (fillMaxSize) {
|
if (fillMaxSize) {
|
||||||
Box(modifier = Modifier.fillMaxSize()) {
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
content()
|
movableContent()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
content()
|
movableContent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user