diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b2d25ce..4cb9390 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) @@ -28,11 +30,13 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } - kotlinOptions { - jvmTarget = "11" + kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) // Use the enum for target JVM version + } } buildFeatures { compose = true diff --git a/app/src/main/java/org/nsh07/pomodoro/ui/AppScreen.kt b/app/src/main/java/org/nsh07/pomodoro/ui/AppScreen.kt index 5434adf..e5383fa 100644 --- a/app/src/main/java/org/nsh07/pomodoro/ui/AppScreen.kt +++ b/app/src/main/java/org/nsh07/pomodoro/ui/AppScreen.kt @@ -1,15 +1,116 @@ package org.nsh07.pomodoro.ui +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.text.TextAutoSize +import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi +import androidx.compose.material3.FilledIconButton +import androidx.compose.material3.FilledTonalIconButton +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButtonDefaults +import androidx.compose.material3.MaterialTheme.colorScheme +import androidx.compose.material3.MaterialTheme.typography import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import org.nsh07.pomodoro.R +import org.nsh07.pomodoro.ui.theme.OpenRundeFontFamily.openRundeClock +@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class) @Composable fun AppScreen(modifier: Modifier = Modifier) { Scaffold( modifier = modifier.fillMaxSize() - ) { + ) { insets -> + Column( + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier + .fillMaxSize() + .padding(insets) + ) { + Column(horizontalAlignment = Alignment.CenterHorizontally) { + Box(contentAlignment = Alignment.Center) { + CircularProgressIndicator( + progress = { 0.3f }, + modifier = Modifier.size(350.dp), + strokeWidth = 32.dp, + gapSize = 32.dp + ) + Box(Modifier.width(220.dp)) { + Text( + text = "08:34", + style = TextStyle( + fontFamily = openRundeClock, + fontWeight = FontWeight.Bold, + fontSize = 76.sp, + letterSpacing = (-2).sp + ), + maxLines = 1, + autoSize = TextAutoSize.StepBased() + ) + } + } + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.padding(16.dp) + ) { + FilledTonalIconButton( + onClick = { /*TODO*/ }, + shapes = IconButtonDefaults.shapes(), + modifier = Modifier.size(96.dp) + ) { + Icon( + painterResource(R.drawable.restart_large), + contentDescription = "Restart" + ) + } + FilledIconButton( + onClick = { /*TODO*/ }, + shapes = IconButtonDefaults.shapes(), + modifier = Modifier.size(width = 128.dp, height = 96.dp) + ) { + Icon( + painterResource(R.drawable.pause_large), + contentDescription = "Pause" + ) + } + } + } + Spacer(Modifier.height(32.dp)) + + Column(horizontalAlignment = Alignment.CenterHorizontally) { + Text("Up next", style = typography.titleSmall) + Text( + "5:00", + style = TextStyle( + fontFamily = openRundeClock, + fontWeight = FontWeight.Bold, + fontSize = 22.sp, + lineHeight = 28.sp, + color = colorScheme.tertiary + ) + ) + Text("Short break", style = typography.titleMediumEmphasized) + } + } } } \ No newline at end of file diff --git a/app/src/main/java/org/nsh07/pomodoro/ui/theme/Type.kt b/app/src/main/java/org/nsh07/pomodoro/ui/theme/Type.kt index eaa2362..7963446 100644 --- a/app/src/main/java/org/nsh07/pomodoro/ui/theme/Type.kt +++ b/app/src/main/java/org/nsh07/pomodoro/ui/theme/Type.kt @@ -2,9 +2,11 @@ package org.nsh07.pomodoro.ui.theme import androidx.compose.material3.Typography import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp +import org.nsh07.pomodoro.R // Set of Material typography styles to start with val Typography = Typography( @@ -15,20 +17,10 @@ val Typography = Typography( lineHeight = 24.sp, letterSpacing = 0.5.sp ) - /* Other default text styles to override - titleLarge = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 22.sp, - lineHeight = 28.sp, - letterSpacing = 0.sp - ), - labelSmall = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Medium, - fontSize = 11.sp, - lineHeight = 16.sp, - letterSpacing = 0.5.sp +) + +object OpenRundeFontFamily { + val openRundeClock = FontFamily( + Font(R.font.open_runde_bold_clock_only, FontWeight.Bold) ) - */ -) \ No newline at end of file +} \ No newline at end of file diff --git a/app/src/main/res/drawable/pause_large.xml b/app/src/main/res/drawable/pause_large.xml new file mode 100644 index 0000000..4158d6f --- /dev/null +++ b/app/src/main/res/drawable/pause_large.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/restart_large.xml b/app/src/main/res/drawable/restart_large.xml new file mode 100644 index 0000000..52415d3 --- /dev/null +++ b/app/src/main/res/drawable/restart_large.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/font/open_runde_bold_clock_only.otf b/app/src/main/res/font/open_runde_bold_clock_only.otf new file mode 100644 index 0000000..9c1b2b4 Binary files /dev/null and b/app/src/main/res/font/open_runde_bold_clock_only.otf differ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e14896f..6234ece 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,13 +1,13 @@ [versions] agp = "8.11.0" -kotlin = "2.0.21" +kotlin = "2.2.0" coreKtx = "1.16.0" junit = "4.13.2" junitVersion = "1.2.1" espressoCore = "3.6.1" lifecycleRuntimeKtx = "2.9.1" activityCompose = "1.10.1" -composeBom = "2024.09.00" +composeBom = "2025.06.01" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -16,7 +16,7 @@ androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "j androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" } androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } -androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } +androidx-compose-bom = { group = "androidx.compose", name = "compose-bom-alpha", version.ref = "composeBom" } androidx-ui = { group = "androidx.compose.ui", name = "ui" } androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" } androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }