From 4ef337f1e92fcdbded2de57c8f248b60d7795649 Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Thu, 16 Jun 2022 22:37:57 +0700 Subject: [PATCH] Don't set text colors when creating compose theme (#7316) This avoids compose snackbar text color issue --- .../kanade/presentation/theme/TachiyomiTheme.kt | 1 - .../ui/base/controller/ComposeController.kt | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/theme/TachiyomiTheme.kt b/app/src/main/java/eu/kanade/presentation/theme/TachiyomiTheme.kt index bc98a03ede..1bc02a7f1a 100644 --- a/app/src/main/java/eu/kanade/presentation/theme/TachiyomiTheme.kt +++ b/app/src/main/java/eu/kanade/presentation/theme/TachiyomiTheme.kt @@ -14,7 +14,6 @@ fun TachiyomiTheme(content: @Composable () -> Unit) { val (colorScheme, typography) = createMdc3Theme( context = context, layoutDirection = layoutDirection, - setTextColors = true, ) MaterialTheme( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ComposeController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ComposeController.kt index 431b906ae4..15f562bec8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ComposeController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ComposeController.kt @@ -4,7 +4,10 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import androidx.compose.foundation.layout.consumeWindowInsets +import androidx.compose.material3.LocalContentColor +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.input.nestedscroll.NestedScrollConnection import androidx.compose.ui.platform.ViewCompositionStrategy import androidx.compose.ui.platform.rememberNestedScrollInteropConnection @@ -32,7 +35,9 @@ abstract class ComposeController
>(bundle: Bundle? = null) : setContent { val nestedScrollInterop = rememberNestedScrollInteropConnection() TachiyomiTheme { - ComposeContent(nestedScrollInterop) + CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground) { + ComposeContent(nestedScrollInterop) + } } } } @@ -58,7 +63,9 @@ abstract class BasicComposeController : setContent { val nestedScrollInterop = rememberNestedScrollInteropConnection() TachiyomiTheme { - ComposeContent(nestedScrollInterop) + CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground) { + ComposeContent(nestedScrollInterop) + } } } } @@ -81,7 +88,9 @@ abstract class SearchableComposeController
>(bundle: Bundle? setContent { val nestedScrollInterop = rememberNestedScrollInteropConnection() TachiyomiTheme { - ComposeContent(nestedScrollInterop) + CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground) { + ComposeContent(nestedScrollInterop) + } } } }