Merge pull request #1869 from esensar/feature/custom-themed-surface

Add separate `AppTheme` composable without any surface
This commit is contained in:
Tibor Kaputa 2023-10-05 16:42:35 +02:00 committed by GitHub
commit 543593cc03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,8 +14,7 @@ import com.simplemobiletools.commons.compose.theme.model.Theme
import com.simplemobiletools.commons.compose.theme.model.Theme.Companion.systemDefaultMaterialYou
@Composable
fun AppThemeSurface(
modifier: Modifier = Modifier,
fun AppTheme(
content: @Composable () -> Unit,
) {
val view = LocalView.current
@ -37,9 +36,19 @@ fun AppThemeSurface(
}
TransparentSystemBars()
Theme(theme = currentTheme) {
content()
OnContentDisplayed()
}
}
@Composable
fun AppThemeSurface(
modifier: Modifier = Modifier,
content: @Composable () -> Unit,
) {
AppTheme {
Surface(modifier = modifier.fillMaxSize()) {
content()
OnContentDisplayed()
}
}
}