Don't set text colors when creating compose theme (#7316)

This avoids compose snackbar text color issue

(cherry picked from commit 4ef337f1e92fcdbded2de57c8f248b60d7795649)
This commit is contained in:
Ivan Iskandar 2022-06-16 22:37:57 +07:00 committed by Jobobby04
parent cbb201d63d
commit 3c6b22a37e
2 changed files with 12 additions and 4 deletions

View File

@ -14,7 +14,6 @@ fun TachiyomiTheme(content: @Composable () -> Unit) {
val (colorScheme, typography) = createMdc3Theme( val (colorScheme, typography) = createMdc3Theme(
context = context, context = context,
layoutDirection = layoutDirection, layoutDirection = layoutDirection,
setTextColors = true,
) )
MaterialTheme( MaterialTheme(

View File

@ -4,7 +4,10 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import androidx.compose.foundation.layout.consumeWindowInsets 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.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.platform.ViewCompositionStrategy import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
@ -32,11 +35,13 @@ abstract class ComposeController<P : Presenter<*>>(bundle: Bundle? = null) :
setContent { setContent {
val nestedScrollInterop = rememberNestedScrollInteropConnection() val nestedScrollInterop = rememberNestedScrollInteropConnection()
TachiyomiTheme { TachiyomiTheme {
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground) {
ComposeContent(nestedScrollInterop) ComposeContent(nestedScrollInterop)
} }
} }
} }
} }
}
} }
/** /**
@ -58,11 +63,13 @@ abstract class BasicComposeController(bundle: Bundle? = null) :
setContent { setContent {
val nestedScrollInterop = rememberNestedScrollInteropConnection() val nestedScrollInterop = rememberNestedScrollInteropConnection()
TachiyomiTheme { TachiyomiTheme {
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground) {
ComposeContent(nestedScrollInterop) ComposeContent(nestedScrollInterop)
} }
} }
} }
} }
}
} }
abstract class SearchableComposeController<P : BasePresenter<*>>(bundle: Bundle? = null) : abstract class SearchableComposeController<P : BasePresenter<*>>(bundle: Bundle? = null) :
@ -81,11 +88,13 @@ abstract class SearchableComposeController<P : BasePresenter<*>>(bundle: Bundle?
setContent { setContent {
val nestedScrollInterop = rememberNestedScrollInteropConnection() val nestedScrollInterop = rememberNestedScrollInteropConnection()
TachiyomiTheme { TachiyomiTheme {
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground) {
ComposeContent(nestedScrollInterop) ComposeContent(nestedScrollInterop)
} }
} }
} }
} }
}
} }
interface ComposeContentController { interface ComposeContentController {