Use Expressive MotionScheme
This commit is contained in:
1 parent
177c1889fa
commit
439899fbdc
2 files changed
+5
-19
No files matched your search
@@ -22,10 +22,8 @@ import soup.compose.material.motion.animation.rememberSlideDistance
|
||||
inline fun ComponentActivity.setMD3Content(crossinline content: @Composable () -> Unit) = setContent {
|
||||
EhTheme(useDarkTheme = isSystemInDarkTheme()) {
|
||||
ProvideVectorPainterCache {
|
||||
val dialogState = remember { DialogState() }
|
||||
dialogState.Intercept()
|
||||
CompositionLocalProvider(
|
||||
LocalDialogState provides dialogState,
|
||||
LocalDialogState provides remember { DialogState() }.apply { Intercept() },
|
||||
) {
|
||||
content()
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import androidx.compose.material3.MotionScheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.material3.expressiveLightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -43,7 +43,7 @@ fun EhTheme(useDarkTheme: Boolean, content: @Composable () -> Unit) {
|
||||
if (isAtLeastS) {
|
||||
dynamicLightColorScheme(context)
|
||||
} else {
|
||||
lightColorScheme()
|
||||
expressiveLightColorScheme()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,18 +58,6 @@ fun EhTheme(useDarkTheme: Boolean, content: @Composable () -> Unit) {
|
||||
}
|
||||
|
||||
// https://issuetracker.google.com/363892346
|
||||
object CustomMotionScheme : MotionScheme {
|
||||
private val motionScheme = MotionScheme.standard()
|
||||
|
||||
override fun <T> defaultSpatialSpec() = motionScheme.defaultEffectsSpec<T>()
|
||||
|
||||
override fun <T> fastSpatialSpec() = motionScheme.fastSpatialSpec<T>()
|
||||
|
||||
override fun <T> slowSpatialSpec() = motionScheme.slowSpatialSpec<T>()
|
||||
|
||||
override fun <T> defaultEffectsSpec() = motionScheme.defaultEffectsSpec<T>()
|
||||
|
||||
override fun <T> fastEffectsSpec() = motionScheme.fastEffectsSpec<T>()
|
||||
|
||||
override fun <T> slowEffectsSpec() = motionScheme.slowEffectsSpec<T>()
|
||||
object CustomMotionScheme : MotionScheme by MotionScheme.expressive() {
|
||||
override fun <T> defaultSpatialSpec() = defaultEffectsSpec<T>()
|
||||
}
|
||||
Reference in new issue
Block a user