Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 989dfd71 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Use the expressive MotionScheme in PlatformTheme

This CL makes PlatformTheme use the expressive MotionScheme everywhere.
The expressive theme is meant to be used for the new M3, and given that
MotionScheme is almost not used anywhere yet apart from STL and the
Motion Mechanics libraries, I think that this is a good and safe change
to do now. This should make our animations slightly bouncy and more
delightful.

Bug: 417444347
Test: Manual, observed slightly bouncier animations
Flag: com.android.systemui.scene_container
Change-Id: I8f986b7b8693986e2a36c3510bab9f56a901ac17
parent b677808e
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -14,12 +14,16 @@
 * limitations under the License.
 */

@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)

package com.android.compose.theme

import android.content.Context
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MotionScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.runtime.Composable
@@ -57,7 +61,11 @@ fun PlatformTheme(isDarkTheme: Boolean = isSystemInDarkTheme(), content: @Compos
        }
    val windowSizeClass = calculateWindowSizeClass()

    MaterialTheme(colorScheme = colorScheme, typography = typography) {
    MaterialTheme(
        colorScheme = colorScheme,
        typography = typography,
        motionScheme = ExpressiveMotionScheme,
    ) {
        CompositionLocalProvider(
            LocalAndroidColorScheme provides androidColorScheme,
            LocalWindowSizeClass provides windowSizeClass,
@@ -91,3 +99,5 @@ private fun platformColorScheme(isDarkTheme: Boolean, context: Context): ColorSc
            )
    }
}

private val ExpressiveMotionScheme = MotionScheme.expressive()