11package org.joseph.designsystem
22
3- import androidx.compose.animation.core.*
3+ import androidx.compose.animation.core.Animatable
4+ import androidx.compose.animation.core.LinearEasing
5+ import androidx.compose.animation.core.tween
46import androidx.compose.foundation.Image
57import androidx.compose.foundation.background
6- import androidx.compose.foundation.isSystemInDarkTheme
7- import androidx.compose.foundation.layout.*
8- import androidx.compose.material3.*
9- import androidx.compose.runtime.*
8+ import androidx.compose.foundation.layout.Column
9+ import androidx.compose.foundation.layout.Spacer
10+ import androidx.compose.foundation.layout.WindowInsets
11+ import androidx.compose.foundation.layout.fillMaxSize
12+ import androidx.compose.foundation.layout.padding
13+ import androidx.compose.foundation.layout.safeDrawing
14+ import androidx.compose.foundation.layout.size
15+ import androidx.compose.foundation.layout.widthIn
16+ import androidx.compose.foundation.layout.windowInsetsPadding
17+ import androidx.compose.material3.ButtonDefaults
18+ import androidx.compose.material3.ElevatedButton
19+ import androidx.compose.material3.Icon
20+ import androidx.compose.material3.Text
21+ import androidx.compose.material3.TextButton
22+ import androidx.compose.runtime.Composable
23+ import androidx.compose.runtime.LaunchedEffect
24+ import androidx.compose.runtime.getValue
25+ import androidx.compose.runtime.mutableStateOf
26+ import androidx.compose.runtime.remember
27+ import androidx.compose.runtime.setValue
1028import androidx.compose.ui.Alignment
1129import androidx.compose.ui.Modifier
1230import androidx.compose.ui.draw.rotate
1331import androidx.compose.ui.graphics.ColorFilter
1432import androidx.compose.ui.platform.LocalUriHandler
1533import androidx.compose.ui.text.font.FontFamily
1634import androidx.compose.ui.unit.dp
17- import designsystem.composeapp.generated.resources.*
35+ import designsystem.composeapp.generated.resources.IndieFlower_Regular
36+ import designsystem.composeapp.generated.resources.Res
37+ import designsystem.composeapp.generated.resources.cyclone
38+ import designsystem.composeapp.generated.resources.ic_cyclone
39+ import designsystem.composeapp.generated.resources.ic_dark_mode
40+ import designsystem.composeapp.generated.resources.ic_light_mode
41+ import designsystem.composeapp.generated.resources.ic_rotate_right
42+ import designsystem.composeapp.generated.resources.open_github
43+ import designsystem.composeapp.generated.resources.run
44+ import designsystem.composeapp.generated.resources.stop
45+ import designsystem.composeapp.generated.resources.theme
1846import kotlinx.coroutines.isActive
1947import org.jetbrains.compose.resources.Font
2048import org.jetbrains.compose.resources.stringResource
@@ -33,11 +61,11 @@ internal fun App() = DesignSystemTheme {
3361 Text (
3462 text = stringResource(Res .string.cyclone),
3563 fontFamily = FontFamily (Font (Res .font.IndieFlower_Regular )),
36- style = MaterialTheme .typography.displayLarge
64+ style = DesignSystemTheme .typography.titleLarge.bold,
65+ color = DesignSystemTheme .colors.textPrimary
3766 )
3867
3968 var isRotating by remember { mutableStateOf(false ) }
40-
4169 val rotate = remember { Animatable (0f ) }
4270 val target = 360f
4371 if (isRotating) {
@@ -59,7 +87,7 @@ internal fun App() = DesignSystemTheme {
5987 .padding(16 .dp)
6088 .run { rotate(rotate.value) },
6189 imageVector = vectorResource(Res .drawable.ic_cyclone),
62- colorFilter = ColorFilter .tint(MaterialTheme .colorScheme.onSurface ),
90+ colorFilter = ColorFilter .tint(DesignSystemTheme .colors.primary ),
6391 contentDescription = null
6492 )
6593
@@ -72,9 +100,14 @@ internal fun App() = DesignSystemTheme {
72100 Icon (vectorResource(Res .drawable.ic_rotate_right), contentDescription = null )
73101 Spacer (Modifier .size(ButtonDefaults .IconSpacing ))
74102 Text (
75- stringResource(if (isRotating) Res .string.stop else Res .string.run)
103+ text = stringResource(if (isRotating) Res .string.stop else Res .string.run),
104+ style = DesignSystemTheme .typography.bodySmall.bold,
105+ color = DesignSystemTheme .colors.textPrimary
76106 )
77- }
107+ },
108+ colors = ButtonDefaults .elevatedButtonColors(
109+ containerColor = DesignSystemTheme .colors.backgroundModal
110+ ),
78111 )
79112
80113 var isDark by LocalThemeIsDark .current
@@ -89,16 +122,27 @@ internal fun App() = DesignSystemTheme {
89122 content = {
90123 Icon (vectorResource(icon), contentDescription = null )
91124 Spacer (Modifier .size(ButtonDefaults .IconSpacing ))
92- Text (stringResource(Res .string.theme))
93- }
125+ Text (
126+ text = stringResource(Res .string.theme),
127+ style = DesignSystemTheme .typography.bodySmall.bold,
128+ color = DesignSystemTheme .colors.textPrimary
129+ )
130+ },
131+ colors = ButtonDefaults .elevatedButtonColors(
132+ containerColor = DesignSystemTheme .colors.backgroundModal
133+ ),
94134 )
95135
96136 val uriHandler = LocalUriHandler .current
97137 TextButton (
98138 modifier = Modifier .padding(horizontal = 8 .dp, vertical = 4 .dp).widthIn(min = 200 .dp),
99139 onClick = { uriHandler.openUri(" https://github.com/terrakok" ) },
100140 ) {
101- Text (stringResource(Res .string.open_github))
141+ Text (
142+ text = stringResource(Res .string.open_github),
143+ style = DesignSystemTheme .typography.bodyMedium.medium,
144+ color = DesignSystemTheme .colors.textPrimary
145+ )
102146 }
103147 }
104148}
0 commit comments