diff --git a/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/components/TodoEditorTextFields.kt b/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/components/TodoEditorTextFields.kt index 68ea089..fa4e520 100644 --- a/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/components/TodoEditorTextFields.kt +++ b/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/components/TodoEditorTextFields.kt @@ -1,6 +1,10 @@ package cn.super12138.todo.ui.pages.editor.components import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.expandVertically +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.animation.shrinkVertically import androidx.compose.material3.Text import androidx.compose.material3.TextField import androidx.compose.runtime.Composable @@ -21,7 +25,11 @@ fun TodoContentTextField( label = { Text(stringResource(R.string.placeholder_add_todo)) }, isError = isError, supportingText = { - AnimatedVisibility(isError) { + AnimatedVisibility( + visible = isError, + enter = fadeIn() + expandVertically(), + exit = fadeOut() + shrinkVertically() + ) { Text(stringResource(R.string.error_no_content_entered)) } }, @@ -42,7 +50,11 @@ fun TodoCategoryTextField( label = { Text(stringResource(R.string.label_enter_category_name)) }, isError = isError, supportingText = { - AnimatedVisibility(isError) { + AnimatedVisibility( + visible = isError, + enter = fadeIn() + expandVertically(), + exit = fadeOut() + shrinkVertically() + ) { Text(stringResource(R.string.error_no_content_entered)) } },