diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-06-30 03:33:34 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-06-30 03:33:34 +0200 |
| commit | 4006eb93d3eec3afc37d46eca3f6faa4706abd1b (patch) | |
| tree | 953ac0a69864ceaf8c1a54f4ea54adc1b2967cc9 /android/lib | |
| parent | ff616600fe0f64d23129b4631aee0ad2f722dc5f (diff) | |
| download | mullvadvpn-hackday-expressive.tar.xz mullvadvpn-hackday-expressive.zip | |
Playing around a littlehackday-expressive
Diffstat (limited to 'android/lib')
| -rw-r--r-- | android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt | 6 | ||||
| -rw-r--r-- | android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Type.kt | 21 |
2 files changed, 21 insertions, 6 deletions
diff --git a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt index 3257ea2d5b..49dcd86c97 100644 --- a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt +++ b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt @@ -3,7 +3,9 @@ package net.mullvad.mullvadvpn.lib.theme import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.ripple.RippleAlpha import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi import androidx.compose.material3.LocalRippleConfiguration +import androidx.compose.material3.MaterialExpressiveTheme import androidx.compose.material3.MaterialTheme import androidx.compose.material3.RippleConfiguration import androidx.compose.material3.Shapes @@ -133,7 +135,7 @@ fun ProvideDimens(dimensions: Dimensions, content: @Composable () -> Unit) { private val LocalAppDimens = staticCompositionLocalOf { defaultDimensions } -@OptIn(ExperimentalMaterial3Api::class) +@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class) @Composable fun AppTheme(content: @Composable () -> Unit) { val typography = MullvadMaterial3Typography @@ -141,7 +143,7 @@ fun AppTheme(content: @Composable () -> Unit) { val dimensions = defaultDimensions ProvideDimens(dimensions = dimensions) { - MaterialTheme( + MaterialExpressiveTheme( colorScheme = darkColorScheme, shapes = Shapes, typography = typography, diff --git a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Type.kt b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Type.kt index 76b24c1327..be26322fa2 100644 --- a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Type.kt +++ b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Type.kt @@ -1,5 +1,6 @@ package net.mullvad.mullvadvpn.lib.theme +import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi import androidx.compose.material3.Typography import androidx.compose.ui.text.font.FontWeight @@ -15,12 +16,24 @@ bodySmall (12sp 400 weight) -> Disclaimer texts and error texts under inputs labelLarge (14sp 500 weight) -> Cell that are not header cells, Dialog texts, device name and expiry */ +@OptIn(ExperimentalMaterial3ExpressiveApi::class) internal val MullvadMaterial3Typography = with(Typography()) { this.copy( - headlineLarge = headlineLarge.merge(fontWeight = FontWeight.Bold), - headlineSmall = headlineSmall.merge(fontWeight = FontWeight.SemiBold), - titleLarge = titleLarge.merge(fontWeight = FontWeight.SemiBold), - titleMedium = titleMedium.merge(fontWeight = FontWeight.SemiBold), + displayLarge = displayLargeEmphasized, + displayMedium = displayMediumEmphasized, + displaySmall = displaySmallEmphasized, + headlineLarge = headlineLargeEmphasized.merge(fontWeight = FontWeight.Bold), + headlineMedium = headlineMediumEmphasized, + headlineSmall = headlineSmallEmphasized.merge(fontWeight = FontWeight.SemiBold), + titleLarge = titleLargeEmphasized.merge(fontWeight = FontWeight.SemiBold), + titleMedium = titleMediumEmphasized.merge(fontWeight = FontWeight.SemiBold), + titleSmall = titleSmallEmphasized, + bodyLarge = bodyLargeEmphasized, + bodyMedium = bodyMediumEmphasized, + bodySmall = bodySmallEmphasized, + labelLarge = labelLargeEmphasized, + labelMedium = labelMediumEmphasized, + labelSmall = labelSmallEmphasized, ) } |
