主题切换为 MaterialExpressiveTheme,全局启用 Expressive 弹簧动效
This commit is contained in:
@@ -6,7 +6,10 @@ import android.content.ContextWrapper
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.ColorScheme
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.MaterialExpressiveTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.MotionScheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
@@ -115,6 +118,7 @@ tailrec fun Context.findActivity(): Activity? = when (this) {
|
||||
else -> null
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
@Composable
|
||||
fun _2FAirTheme(
|
||||
themeMode: Int = 0, // 0: System, 1: Light, 2: Dark
|
||||
@@ -147,8 +151,9 @@ fun _2FAirTheme(
|
||||
}
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
MaterialExpressiveTheme(
|
||||
colorScheme = colorScheme,
|
||||
motionScheme = MotionScheme.expressive(),
|
||||
typography = Typography,
|
||||
content = content
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user