From cff3834fded2a6043cc5ab87159dda413b204ac1 Mon Sep 17 00:00:00 2001 From: Stypox Date: Thu, 21 Nov 2024 13:17:33 +0100 Subject: [PATCH] Fix setEmptyStateComposable dark theme --- .../schabi/newpipe/ui/emptystate/EmptyStateUtil.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateUtil.kt b/app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateUtil.kt index 422fb69fc..2fced431f 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateUtil.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateUtil.kt @@ -2,6 +2,10 @@ package org.schabi.newpipe.ui.emptystate +import androidx.compose.material3.LocalContentColor +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.contentColorFor +import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.platform.ComposeView import androidx.compose.ui.platform.ViewCompositionStrategy import org.schabi.newpipe.ui.theme.AppTheme @@ -14,9 +18,13 @@ fun ComposeView.setEmptyStateComposable( setViewCompositionStrategy(strategy) setContent { AppTheme { - EmptyStateComposable( - spec = spec - ) + CompositionLocalProvider( + LocalContentColor provides contentColorFor(MaterialTheme.colorScheme.background) + ) { + EmptyStateComposable( + spec = spec + ) + } } } }