From a328d2194f2fd62d4da27d9933050fd6a8ba6e51 Mon Sep 17 00:00:00 2001 From: Lukas Barragan Torres Date: Sat, 13 May 2023 15:36:04 +0200 Subject: [PATCH] isValid is optional and by default true --- .../ugent/sel/studeez/common/composable/TextFieldComposable.kt | 2 +- .../screens/timer_form/form_screens/BreakTimerFormScreen.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/be/ugent/sel/studeez/common/composable/TextFieldComposable.kt b/app/src/main/java/be/ugent/sel/studeez/common/composable/TextFieldComposable.kt index 9922985..47bdec5 100644 --- a/app/src/main/java/be/ugent/sel/studeez/common/composable/TextFieldComposable.kt +++ b/app/src/main/java/be/ugent/sel/studeez/common/composable/TextFieldComposable.kt @@ -117,7 +117,7 @@ fun LabeledErrorTextField( initialValue: String, @StringRes label: Int, singleLine: Boolean = false, - isValid: MutableState, + isValid: MutableState = remember { mutableStateOf(true) }, isFirst: MutableState = remember { mutableStateOf(false) }, @StringRes errorText: Int, keyboardType: KeyboardType, diff --git a/app/src/main/java/be/ugent/sel/studeez/screens/timer_form/form_screens/BreakTimerFormScreen.kt b/app/src/main/java/be/ugent/sel/studeez/screens/timer_form/form_screens/BreakTimerFormScreen.kt index 21e862d..333fc24 100644 --- a/app/src/main/java/be/ugent/sel/studeez/screens/timer_form/form_screens/BreakTimerFormScreen.kt +++ b/app/src/main/java/be/ugent/sel/studeez/screens/timer_form/form_screens/BreakTimerFormScreen.kt @@ -30,6 +30,7 @@ class BreakTimerFormScreen( initialValue = breakTimerInfo.repeats.toString(), label = R.string.repeats, errorText = AppText.repeats_error, + isValid = mutableStateOf(false), keyboardType = KeyboardType.Decimal, predicate = { it.matches(Regex("[1-9]+\\d*")) } ) { correctlyTypedInt ->