diff --git a/feature/timers/domain/src/commonMain/kotlin/io/timemates/app/users/usecases/TimerCreationUseCase.kt b/feature/timers/domain/src/commonMain/kotlin/io/timemates/app/users/usecases/TimerCreationUseCase.kt index 0cb3008..6d177f3 100644 --- a/feature/timers/domain/src/commonMain/kotlin/io/timemates/app/users/usecases/TimerCreationUseCase.kt +++ b/feature/timers/domain/src/commonMain/kotlin/io/timemates/app/users/usecases/TimerCreationUseCase.kt @@ -21,6 +21,6 @@ class TimerCreationUseCase( sealed class Result { data class Failure(val exception: Throwable) : Result() - object Success : Result() + data object Success : Result() } } diff --git a/feature/timers/presentation/src/commonMain/kotlin/io/timemates/app/timers/ui/timer_creation/TimerCreationScreen.kt b/feature/timers/presentation/src/commonMain/kotlin/io/timemates/app/timers/ui/timer_creation/TimerCreationScreen.kt index 3e7d35a..c914c38 100644 --- a/feature/timers/presentation/src/commonMain/kotlin/io/timemates/app/timers/ui/timer_creation/TimerCreationScreen.kt +++ b/feature/timers/presentation/src/commonMain/kotlin/io/timemates/app/timers/ui/timer_creation/TimerCreationScreen.kt @@ -6,9 +6,12 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.ArrowBack import androidx.compose.material3.Checkbox @@ -105,9 +108,12 @@ fun TimerCreationScreen( Column( modifier = Modifier.fillMaxSize() .padding(rootPaddings) - .padding(16.dp), + .padding(horizontal = 16.dp) + .verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(8.dp), ) { + Spacer(Modifier.height(4.dp)) + SizedOutlinedTextField( modifier = Modifier.fillMaxWidth(), value = state.name, @@ -158,7 +164,11 @@ fun TimerCreationScreen( modifier = Modifier .weight(1f), value = state.workTime.toInt(unit = DurationUnit.MINUTES).toString(), - onValueChange = { stateMachine.dispatchEvent(Event.WorkTimeIsChanged(it.toInt().minutes)) }, + onValueChange = { + stateMachine.dispatchEvent( + Event.WorkTimeIsChanged(it.toIntOrNull()?.minutes ?: state.workTime) + ) + }, label = { Text(LocalStrings.current.workTime) }, singleLine = true, enabled = !state.isLoading, @@ -289,6 +299,8 @@ fun TimerCreationScreen( Text(LocalStrings.current.save) } } + + Spacer(Modifier.height(16.dp)) } } }